events.listen('recipes', function (e) {


      function CustomSeed(essence, nugget) {
            e.custom({
                  "type": "crafting_shaped",
                  "pattern": ["XXX","X X","XXX"],
                  "key": {"X": { "item": essence }},
                  "result": { "item": nugget, "count": 2},
            })
}

      CustomSeed('mysticalagriculture:inferium_ingot_essence', 'mysticalagriculture:inferium_ingot')
      CustomSeed('mysticalagriculture:prudentium_ingot_essence', 'mysticalagriculture:prudentium_ingot')
      CustomSeed('mysticalagriculture:tertium_ingot_essence', 'mysticalagriculture:tertium_ingot')
      CustomSeed('mysticalagriculture:imperium_ingot_essence', 'mysticalagriculture:imperium_ingot')
      CustomSeed('mysticalagriculture:supremium_ingot_essence', 'mysticalagriculture:supremium_ingot')
      CustomSeed('mysticalagriculture:insanium_ingot_essence', 'mysticalagradditions:insanium_ingot')
      CustomSeed('mysticalagriculture:ornium_ingot_essence', 'kubejs:ornium_ingot')
      CustomSeed('mysticalagriculture:lightium_ingot_essence', 'kubejs:lightium_ingot')
      CustomSeed('mysticalagriculture:tornium_ingot_essence', 'kubejs:tornium_ingot')
      CustomSeed('mysticalagriculture:ouranium_ingot_essence', 'kubejs:ouranium_ingot')
      CustomSeed('mysticalagriculture:manyerium_essence', 'berseria_sky:manyerium_ingot')
      CustomSeed('mysticalagriculture:queens_steel_essence', 'berseria_sky:queens_steel_ingot')
      CustomSeed('mysticalagriculture:fayronium_essence', 'berseria_sky:fayronium_ingot')
      CustomSeed('mysticalagriculture:manronium_steel_essence', 'berseria_sky:manronium_steel_ingot')
      CustomSeed('mysticalagriculture:sun_essence', 'kubejs:sun_ingot')
      CustomSeed('mysticalagriculture:moon_essence', 'kubejs:moon_ingot')
      CustomSeed('mysticalagriculture:antimatter_essence', 'mekanism:ingot_antimatter')
      CustomSeed('mysticalagriculture:comerald_essence', 'berseria_sky:comerald_ingot')
      CustomSeed('mysticalagriculture:duralumin_essence', 'tinkers_reforged:duralumin_ingot')
      CustomSeed('mysticalagriculture:gausum_essence', 'tinkers_reforged:gausum_ingot')
      CustomSeed('mysticalagriculture:electrical_copper_essence', 'tinkers_reforged:electrical_copper_ingot')
      CustomSeed('mysticalagriculture:lavium_essence', 'tinkers_reforged:lavium_ingot')
      CustomSeed('mysticalagriculture:qivium_essence', 'tinkers_reforged:qivium_ingot')
      CustomSeed('mysticalagriculture:ultimate_essence', 'extendedcrafting:the_ultimate_nugget')


      //Fairy Ingot//
      e.shaped(item.of('materialis:fairy_ingot', 2), ['XXX', 'X X', 'XXX'], {
            X: 'mysticalagriculture:fairy_ingot_essence'
      })

      //Gaia Spirit Essence//
      e.shaped(item.of('botania:life_essence', 2), ['XXX', 'XXX', 'XXX'], {
            X: 'mysticalagriculture:gaia_spirit_essence'})

      //Amethyst Essence//
      e.shaped(item.of('minecraft:amethyst_shard', 4), ['XXX', 'X X', 'XXX'], {
            X: 'mysticalagriculture:amethyst_essence'})

      //Zauvium Essence//
      e.shaped(item.of('thermal_extra:zauvium_ingot', 2), ['XXX', 'X X', 'XXX'], {
            X: 'mysticalagriculture:zauvium_essence'})

      //Fluix Steel Ingot Essence//
      e.shaped(item.of('lazierae2:fluix_steel_ingot', 2), ['XXX', 'X X', 'XXX'], {
            X: 'mysticalagriculture:fluix_steel_ingot_essence'})

//*************************************Blue Skies******************************************************/
      //Ventium Ingot//
      e.shaped(item.of('blue_skies:ventium_ingot', 2), ['XXX', 'X X', 'XXX'], {
            X: 'mysticalagriculture:ventium_essence'})

      //Flasite Ingot//
      e.shaped(item.of('blue_skies:falsite_ingot', 2), ['XXX', 'X X', 'XXX'], {
            X: 'mysticalagriculture:falsite_essence'})

      //Horizonite Ingot//
      e.shaped(item.of('blue_skies:horizonite_ingot', 2), ['XXX', 'X X', 'XXX'], {
            X: 'mysticalagriculture:horizonite_essence'})

      //Chaotic Essence//
      e.shaped(item.of('draconicevolution:small_chaos_frag', 2), ['XXX', 'XXX', 'XXX'], {
            X: 'mysticalagriculture:chaotic_essence'})

      //Chaotic Crux//
            e.custom({
                  "type": "extendedcrafting:shaped_table",
                  "pattern": [
                    "ABBBA",
                    "BCCCB",
                    "BCDCB",
                    "BCCCB",
                    "ABBBA"
                  ],
                  "key": {
                    "A": {"item": "draconicevolution:chaotic_core"},
                    "B": {"item": "draconicevolution:large_chaos_frag"},
                    "C": {"item": "minecraft:dragon_breath"},
                    "D": {"item": "mysticalagradditions:insanium_farmland"}
                  },
                  "result": {"item": "berseria_sky:chaotic_crux"}
                })

      //Neutronium Essence//
      e.shaped(item.of('endless:neutronium_pile', 2), ['XXX', 'XXX', 'XXX'], {
            X: 'mysticalagriculture:neutronium_essence'})

      //Infinity Essence//
      e.shaped(item.of('endless:infinity_nugget', 2), ['XXX', 'XXX', 'XXX'], {
            X: 'mysticalagriculture:infinity_essence'})
      

      //Insamium Seeds//
      e.shapeless('4x mysticalagradditions:insanium_essence', 'kubejs:ornium_essence')

      //Ornium//
      e.shapeless('kubejs:ornium_block', '9x kubejs:ornium_essence')
      e.shapeless('9x kubejs:ornium_essence', 'kubejs:ornium_block')
      e.shapeless('kubejs:ornium_coal_block', '9x kubejs:ornium_coal')
      e.shapeless('9x kubejs:ornium_coal', 'kubejs:ornium_coal_block')
      e.shapeless('kubejs:ornium_gemstone_block', '9x kubejs:ornium_gemstone')
      e.shapeless('9x kubejs:ornium_gemstone', 'kubejs:ornium_gemstone_block')
      e.shapeless('kubejs:ornium_ingot', '9x kubejs:ornium_nugget')
      e.shapeless('9x kubejs:ornium_nugget', 'kubejs:ornium_ingot')
      e.shapeless('kubejs:ornium_ingot_block', '9x kubejs:ornium_ingot')
      e.shapeless('9x kubejs:ornium_ingot', 'kubejs:ornium_ingot_block')

      //Lightium//
      e.shapeless('4x kubejs:ornium_essence', 'kubejs:lightium_essence')
      e.shapeless('kubejs:lightium_block', '9x kubejs:lightium_essence')
      e.shapeless('9x kubejs:lightium_essence', 'kubejs:lightium_block')
      e.shapeless('kubejs:lightium_coal_block', '9x kubejs:lightium_coal')
      e.shapeless('9x kubejs:lightium_coal', 'kubejs:lightium_coal_block')
      e.shapeless('kubejs:lightium_ingot', '9x kubejs:lightium_nugget')
      e.shapeless('9x kubejs:lightium_nugget', 'kubejs:lightium_ingot')
      e.shapeless('kubejs:lightium_ingot_block', '9x kubejs:lightium_ingot')
      e.shapeless('9x kubejs:lightium_ingot', 'kubejs:lightium_ingot_block')
      e.shapeless('kubejs:lightium_gemstone_block', '9x kubejs:lightium_gemstone')
      e.shapeless('9x kubejs:lightium_gemstone', 'kubejs:lightium_gemstone_block')

      //Tornium//
      e.shapeless('4x kubejs:lightium_essence', 'kubejs:tornium_essence')
      e.shapeless('kubejs:tornium_block', '9x kubejs:tornium_essence')
      e.shapeless('9x kubejs:tornium_essence', 'kubejs:tornium_block')
      e.shapeless('kubejs:tornium_coal_block', '9x kubejs:tornium_coal')
      e.shapeless('9x kubejs:tornium_coal', 'kubejs:tornium_coal_block')
      e.shapeless('kubejs:tornium_ingot', '9x kubejs:tornium_nugget')
      e.shapeless('9x kubejs:tornium_nugget', 'kubejs:tornium_ingot')
      e.shapeless('kubejs:tornium_ingot_block', '9x kubejs:tornium_ingot')
      e.shapeless('9x kubejs:tornium_ingot', 'kubejs:tornium_ingot_block')
      e.shapeless('kubejs:tornium_gemstone_block', '9x kubejs:tornium_gemstone')
      e.shapeless('9x kubejs:tornium_gemstone', 'kubejs:tornium_gemstone_block')

      //Ouranium//
      e.shapeless('4x kubejs:tornium_essence', 'kubejs:ouranium_essence')
      e.shapeless('kubejs:ouranium_block', '9x kubejs:ouranium_essence')
      e.shapeless('9x kubejs:ouranium_essence', 'kubejs:ouranium_block')
      e.shapeless('kubejs:ouranium_coal_block', '9x kubejs:ouranium_coal')
      e.shapeless('9x kubejs:ouranium_coal', 'kubejs:ouranium_coal_block')
      e.shapeless('kubejs:ouranium_ingot', '9x kubejs:ouranium_nugget')
      e.shapeless('9x kubejs:ouranium_nugget', 'kubejs:ouranium_ingot')
      e.shapeless('kubejs:ouranium_ingot_block', '9x kubejs:ouranium_ingot')
      e.shapeless('9x kubejs:ouranium_ingot', 'kubejs:ouranium_ingot_block')
      e.shapeless('kubejs:ouranium_gemstone_block', '9x kubejs:ouranium_gemstone')
      e.shapeless('9x kubejs:ouranium_gemstone', 'kubejs:ouranium_gemstone_block')
      
      //Ouranium Ingot/Gemstone//
      e.shaped(item.of('kubejs:ouranium_ingot', 1), [' X ', 'XOX', ' X '],
            { X: 'kubejs:ouranium_essence', O: 'kubejs:tornium_ingot' })
      e.shaped(item.of('kubejs:ouranium_gemstone', 1), [' X ', 'XOX', ' X '],
            { X: 'kubejs:ouranium_essence', O: 'kubejs:tornium_gemstone' })

      //Creative Ingot//
      e.shaped(item.of('kubejs:creative_ingot', 1), ['XXX', 'XOX', 'XXX'],
            { X: 'mysticalagradditions:creative_essence', O: 'extendedcrafting:the_ultimate_ingot' })
      
      e.shapeless('kubejs:creative_block', '9x kubejs:creative_ingot')
      e.shapeless('9x kubejs:creative_ingot', 'kubejs:creative_block')

      //Empty Crystal//
      e.custom({ 
      "type": "mysticalagriculture:infusion",
      "input": {
        "item": "mysticalagriculture:prosperity_seed_base"
      },
      "ingredients": [
        {"item": "berseria_sky:manyerium_block"},
        {"item": "mysticalagriculture:prosperity_block"},
        {"item": "berseria_sky:manyerium_block"},
        {"item": "mysticalagriculture:prosperity_block"},
        {"item": "berseria_sky:manyerium_block"},
        {"item": "mysticalagriculture:prosperity_block"},
        {"item": "berseria_sky:manyerium_block"},
        {"item": "mysticalagriculture:prosperity_block"}
      ],
        "result": {"item": "berseria_sky:prosperity_crystal"}
      })
//************************************Essence**********************************************//
      //Ornium Essence//
      e.shaped('kubejs:ornium_essence', [' D ', 'DSD', ' D '], {
            S: Item.of('kubejs:insanium_crystal').ignoreNBT(),
            D: 'mysticalagradditions:insanium_essence'
      })
            .keepIngredient('kubejs:insanium_crystal')

      //Ornium Block//
      e.shaped('kubejs:ornium_block', [' D ', 'DSD', ' D '], {
            S: Item.of('kubejs:insanium_crystal').ignoreNBT(),
            D: 'mysticalagradditions:insanium_block'
      })
            .keepIngredient('kubejs:insanium_crystal')

      //Ornium Block Master Crystaux//
      e.shaped('kubejs:ornium_block', [' D ', 'DSD', ' D '], {
            S: 'mysticalagriculture:master_infusion_crystal',
            D: 'mysticalagradditions:insanium_block'
      })
            

      //Ornium Crystal//
      e.custom({
            "type": "extendedcrafting:shaped_table",
            "tier": 4,
            "pattern": [
              "ABBBBBBBA",
              "BCCCCCCCB",
              "BCDDDDDCB",
              "BCDEEEDCB",
              "BCDEFEDCB",
              "BCDEEEDCB",
              "BCDDDDDCB",
              "BCCCCCCCB",
              "ABBBBBBBA"
            ],
            "key": {
              "A": {"item": "kubejs:ornium_ingot_block"},
              "B": {"item": "betterendforge:terminite_block"},
              "C": {"item": "thermal_extra:nebulium_block"},
              "D": {"item": "betternether:blue_obsidian_tile"},
              "E": {"item": "cagedmobs:star_infused_netherite_block"},
              "F": {"item": "berseria_sky:prosperity_crystal"}
            },
            "result": {"item": "kubejs:ornium_crystal"}
          })

      //Lightium Essence//
      e.shaped('kubejs:lightium_essence', [' D ', 'DSD', ' D '], {
            S: Item.of('kubejs:ornium_crystal').ignoreNBT(),
            D: 'kubejs:ornium_essence'})
            .keepIngredient('kubejs:ornium_crystal')

      //Lightium Block//
      e.shaped('kubejs:lightium_block', [' D ', 'DSD', ' D '], {
            S: Item.of('kubejs:ornium_crystal').ignoreNBT(),
            D: 'kubejs:ornium_block'})
            .keepIngredient('kubejs:ornium_crystal')

      //Lightium Block Master Crystaux//
      e.shaped('kubejs:lightium_block', [' D ', 'DSD', ' D '], { 
            S: 'mysticalagriculture:master_infusion_crystal',
            D: 'kubejs:ornium_block'
      })
           

      //Lightium Crystal//
      e.custom({
            "type": "extendedcrafting:shaped_table",
            "tier": 4,
            "pattern": [
              "ABBBBBBBA",
              "BCCCCCCCB",
              "BCDDDDDCB",
              "BCDEEEDCB",
              "BCDEFEDCB",
              "BCDEEEDCB",
              "BCDDDDDCB",
              "BCCCCCCCB",
              "ABBBBBBBA"
            ],
            "key": {
              "A": {"item": "kubejs:lightium_ingot_block"},
              "B": {"item": "astralsorcery:starmetal"},
              "C": {"item": "bigreactors:cyanite_block"},
              "D": {"item": "extendedcrafting:enhanced_ender_ingot_block"},
              "E": {"item": "cagedmobs:star_infused_netherite_block"},
              "F": {"item": "berseria_sky:prosperity_crystal"}
            },
            "result": {"item": "kubejs:lightium_crystal"}
          })

      //Tornium Essence//
      e.shaped('kubejs:tornium_essence', [' D ', 'DSD', ' D '], {
            S: Item.of('kubejs:lightium_crystal').ignoreNBT(),
            D: 'kubejs:lightium_essence'
      })
            .keepIngredient('kubejs:lightium_crystal')

      //Tornium Essence//
      e.shaped('kubejs:tornium_block', [' D ', 'DSD', ' D '], {
            S: Item.of('kubejs:lightium_crystal').ignoreNBT(),
            D: 'kubejs:lightium_block'
      })
            .keepIngredient('kubejs:lightium_crystal')

      //Tornium Block Master Crystaux//
      e.shaped('kubejs:tornium_block', [' D ', 'DSD', ' D '], { 
            S: 'mysticalagriculture:master_infusion_crystal',
            D: 'kubejs:lightium_block'
      })

      //Tornium Crystal//
      e.custom({
            "type": "extendedcrafting:shaped_table",
            "tier": 4,
            "pattern": [
              "ABBBBBBBA",
              "BCCCCCCCB",
              "BCDDDDDCB",
              "BCDEEEDCB",
              "BCDEFEDCB",
              "BCDEEEDCB",
              "BCDDDDDCB",
              "BCCCCCCCB",
              "ABBBBBBBA"
            ],
            "key": {
              "A": {"item": "kubejs:tornium_ingot_block"},
              "B": {"item": "mekanism:block_antimatter"},
              "C": {"item": "draconicevolution:large_chaos_frag"},
              "D": {"item": "extendedcrafting:black_iron_block"},
              "E": {"item": "kubejs:sun_block"},
              "F": {"item": "berseria_sky:prosperity_crystal"}
            },
            "result": {"item": "kubejs:tornium_crystal"}
          })


      //Ouranium Essence//
      e.shaped('kubejs:ouranium_essence', [' D ', 'DSD', ' D '], {
            S: Item.of('kubejs:tornium_crystal').ignoreNBT(),
            D: 'kubejs:tornium_essence'
      })
            .keepIngredient('kubejs:tornium_crystal')

      //Ouranium Essence//
      e.shaped('kubejs:ouranium_block', [' D ', 'DSD', ' D '], {
            S: Item.of('kubejs:tornium_crystal').ignoreNBT(),
            D: 'kubejs:tornium_block'
      })
            .keepIngredient('kubejs:tornium_crystal')

      //Tornium Block Master Crystaux//
      e.shaped('kubejs:ouranium_block', [' D ', 'DSD', ' D '], { 
            S: 'mysticalagriculture:master_infusion_crystal',
            D: 'kubejs:tornium_block'
      })


      //Master Crystal//
      e.custom({
            "type": "extendedcrafting:shaped_table",
            "tier": 4,
            "pattern": [
              "ABBBBBBBA",
              "BLCCCCCOB",
              "BCGDDDICB",
              "BCDEEEDCB",
              "BCDEFEDCB",
              "BCDEEEDCB",
              "BCJDDDKCB",
              "BPCCCCCVB",
              "ABBBBBBBA"
            ],
            "key": {
              "A": {"item": "kubejs:ouranium_ingot_block"},
              "B": {"item": "mekanism:block_antimatter"},
              "C": {"item": "extendedcrafting:the_ultimate_block"},
              "D": {"item": "kubejs:moon_block"},
              "E": {"item": "kubejs:creative_plate"},
              "F": {"item": "matc:inferium_crystal"},
              "G": {"item": "kubejs:lightium_crystal"},
              "I": {"item": "kubejs:ornium_crystal"},
              "J": {"item": "kubejs:insanium_crystal"},
              "K": {"item": "matc:supremium_crystal"},
              "L": {"item": "matc:imperium_crystal"},
              "O": {"item": "matc:tertium_crystal"},
              "P": {"item": "matc:prudentium_crystal"},
              "V": {"item": "kubejs:tornium_crystal"}
            },
            "result": {"item": "mysticalagriculture:master_infusion_crystal"}
          })

      /******************************************Mystical*************************************/
      //Mystical Seed//
      function MysticalSeed(essence, seed, ingot, output) {
            e.custom({
                  "type": "crafting_shaped",
                  "pattern": [
                        "MPM",
                        "PXP",
                        "MPM"],
                  "key": {
                        "P": { "item": essence },
                        "X": { "item": seed },
                        "M": { "item": ingot }
                  },
                  "result": { "item": output }
            })
      }

      MysticalSeed('mysticalagriculture:inferium_essence', 'mysticalagriculture:prosperity_seed_base', 'kubejs:ardite_ingot', 'kubejs:inferium_seed')
      MysticalSeed('mysticalagriculture:prudentium_essence', 'kubejs:inferium_seed', 'create:brass_ingot', 'kubejs:prudentium_seed')
      MysticalSeed('mysticalagriculture:tertium_essence', 'kubejs:prudentium_seed', 'kubejs:platinum_ingot', 'kubejs:tertium_seed')
      MysticalSeed('mysticalagriculture:imperium_essence', 'kubejs:tertium_seed', 'tconstruct:manyullyn_ingot', 'kubejs:imperium_seed')
      MysticalSeed('mysticalagriculture:supremium_essence', 'kubejs:imperium_seed', 'berseria_sky:elinvonze_ingot', 'kubejs:supremium_seed')
      MysticalSeed('mysticalagradditions:insanium_essence', 'kubejs:supremium_seed', 'cagedmobs:star_infused_netherite_ingot', 'kubejs:insanium_seed')
      MysticalSeed('kubejs:ornium_essence', 'kubejs:insanium_seed', 'berseria_sky:queens_steel_ingot', 'kubejs:ornium_seed')
      MysticalSeed('kubejs:lightium_essence', 'kubejs:ornium_seed', 'berseria_sky:fayronium_ingot', 'kubejs:lightium_seed')
      MysticalSeed('kubejs:tornium_essence', 'kubejs:lightium_seed', 'berseria_sky:manronium_steel_ingot', 'kubejs:tornium_seed')
      MysticalSeed('kubejs:ouranium_essence', 'kubejs:tornium_seed', 'extendedcrafting:the_ultimate_ingot', 'kubejs:ouranium_seed')















})