events.listen('recipes', function (event) {
    event.remove({ mod: "botanypots" })
    event.remove({ mod: "botanypotstiers" })
    //Seed
    function seedPot(seed, categorie, growth) {
        event.remove({ id: "mysticalagriculture:crops/" + seed })
        event.custom({
            "type": "botanypots:crop",
            "seed": { "item": "mysticalagriculture:" + seed + "_seeds" },
            "categories": [categorie],
            "growthTicks": growth,
            "display": { "block": "mysticalagriculture:" + seed + "_crop", "properties": { "age": 7 } },
            "results": [
                {
                    "chance": 1, "minRolls": 1, "maxRolls": 1,
                    "output": { "item": "mysticalagriculture:" + seed + "_essence", "count": 1 }
                },
                {
                    "chance": 0.01, "minRolls": 1, "maxRolls": 1,
                    "output": { "item": "mysticalagriculture:fertilized_essence", "count": 1 }
                }]
        })
    }
   
    var seed1 = ["air", "earth", "water", "fire", "inferium", "stone", "dirt", "wood", "ice"]
    seed1.forEach(S => { seedPot(S, "Farmland_all", 1200) })
    var seed2 = ["nature", "dye", "nether", "coal", "coral", "honey", "pig", "chicken", "cow", "sheep", "squid", "fish", "slime", "turtle", "sulfur", "aluminum", "copper"]
    seed2.forEach(S => { seedPot(S, "Farmland_t2", 2400) })
    var seed3 = ["iron", "nether_quartz", "glowstone", "redstone", "obsidian", "prismarine", "zombie", "skeleton", "creeper", "spider", "rabbit", "tin", "silver", "lead", "fire_stone", "water_stone", "leaf_stone", "thunder_stone", "ice_stone", "shiny_stone",  "red_zychorium", "blue_zychorium", "green_zychorium", "white_zychorium", "black_zychorium"]
    seed3.forEach(S => { seedPot(S, "Farmland_t3", 3600) })
    var seed4 = ["gold", "lapis_lazuli", "end", "experience", "blaze", "ghast", "enderman", "uranium", "osmium", "fluorite", "sapphire", "ruby", "dawn_stone", "dusk_stone", "sun_stone", "moon_stone", "electrotine", "amethyst", "crystal", "quartz_crystal"]
    seed4.forEach(S => { seedPot(S, "Farmland_t4", 4000) })
    var seed5 = ["platinum", "diamond", "emerald", "netherite", "wither_skeleton", "draconium", "prosperity_shard"]
    seed5.forEach(S => { seedPot(S, "Farmland_t5", 4500) })
    var seed6 = ["allthemodium", "vibranium", "unobtainium", "chaos_shard"]
    seed6.forEach(S => { seedPot(S, "Farmland_t6", 5000)})

    seedPot("nether_star", "nether_star_crux", 3000)
    seedPot("dragon_egg", "dragon_egg_crux", 3000) 
    seedPot("awakened_draconium", "awakened_draconium_crux", 3000) 

    //soil
    function soil(item, categorie, growth) {
        event.recipes.botanypots.soil({
            input: { item: item },
            display: { block: item },
            categories: categorie,
            growthModifier: growth
        })
    }

    soil("mysticalagradditions:nether_star_crux", ["nether_star_crux"], 0.90)
    soil("mysticalagradditions:dragon_egg_crux", ["dragon_egg_crux"], 0.90)
    soil("mysticalagradditions:awakened_draconium_crux", ["awakened_draconium_crux"], 0.90)

    event.remove({ id: "mysticalagriculture:soils/inferium_farmland" })
    event.remove({ id: "mysticalagriculture:soils/prudentium_farmland" })
    event.remove({ id: "mysticalagriculture:soils/tertium_farmland" })
    event.remove({ id: "mysticalagriculture:soils/imperium_farmland" })
    event.remove({ id: "mysticalagriculture:soils/supremium_farmland" })
    event.remove({ id: "mysticalagriculture:soils/insanium_farmland" })
    soil("minecraft:soul_sand", ["soul"], 0.15)
    soil("minecraft:end_stone", ["end"], 0.15)
    soil("minecraft:sand", ["sand"], 0.10)
    soil("#forge:water", ["water"], 0.10)
    soil("minecraft:dirt", ["dirt"], 0.10)
    soil("minecraft:farmland", ["Dirt", "Farmland_all"], 0.10)
    soil("mysticalagriculture:inferium_farmland", ["Dirt", "Farmland_all", "Farmland_t1"], 0.15)
    soil("mysticalagriculture:prudentium_farmland", ["Dirt", "Farmland_all", "Farmland_t1", "Farmland_t2"], 0.30)
    soil("mysticalagriculture:tertium_farmland", ["Dirt", "Farmland_all", "Farmland_t1", "Farmland_t2", "Farmland_t3"], 0.45)
    soil("mysticalagriculture:imperium_farmland", ["Dirt", "Farmland_all", "Farmland_t1", "Farmland_t2", "Farmland_t3", "Farmland_t4"], 0.60)
    soil("mysticalagriculture:supremium_farmland", ["Dirt", "Farmland_all", "Farmland_t1", "Farmland_t2", "Farmland_t3", "Farmland_t4", "Farmland_t5"], 0.75)
    soil('mysticalagradditions:insanium_farmland', ["Dirt", "Farmland_all", "Farmland_t1", "Farmland_t2", "Farmland_t3", "Farmland_t4", "Farmland_t5", "Farmland_t6"], 0.90)
})