onEvent('recipes', (event) => {

    const time_multiplier = 10,
        id_prefix = 'naturesaura:kubejs/tree_ritual';

    const recipes = [
        {
            ingredients: [
                'minecraft:spider_eye',
                'emendatusenigmatica:silver_ingot',
                'naturesaura:gold_leaf',
                'naturesaura:gold_leaf',
                'eidolon:soul_shard',
                'tconstruct:sky_slime_crystal',
                'eidolon:soul_shard',
                'tconstruct:sky_slime_crystal'
            ],
            output: 'naturesaura:eye',
            time: 5 * time_multiplier,
            sapling: 'quark:yellow_blossom_sapling',
            id: 'eye'
        },
        {
            ingredients: [
                Item.of('naturesaura:aura_bottle', '{stored_type:"naturesaura:nether"}'),
                'eidolon:gold_inlay',
                'eidolon:arcane_gold_ingot',
                'eidolon:arcane_gold_ingot'
            ],
            output: 'eidolon:goblet',
            time: 5 * time_multiplier,
            sapling: 'quark:orange_blossom_sapling',
            id: 'goblet'
        },
        {
            ingredients: [
                'minecraft:crafting_table',
                'eidolon:wooden_altar',
                'eidolon:unholy_symbol',
                'mekanism:crystal_tin',
                'minecraft:red_carpet',
                'mekanism:crystal_tin',
                'minecraft:red_carpet',
                'tconstruct:iron_reinforcement'
            ],
            output: 'eidolon:worktable',
            time: 10 * time_multiplier,
            sapling: 'quark:red_blossom_sapling',
            id: 'worktable'
        },
        {
            ingredients: [
                Item.of('tconstruct:large_plate', '{Material:"tconstruct:invar"}'),
                'eidolon:pewter_block',
                '#forge:stone',
                '#forge:stone',
                'minecraft:smooth_stone_slab',
                'mekanism:crystal_lead',
                'minecraft:smooth_stone_slab',
                'mekanism:crystal_lead'
            ],
            output: '2x eidolon:stone_altar',
            time: 12 * time_multiplier,
            sapling: 'quark:lavender_blossom_sapling',
            id: 'eidolon:stone_altar'
        },
        {
            ingredients: [
                Item.of('naturesaura:aura_bottle', '{stored_type:"naturesaura:overworld"}'),
                'kubejs:blank_token',
                '#minecraft:small_flowers',
                'create:honeyed_apple',
                'farmersdelight:canvas',
                'tconstruct:pig_iron_ingot'
            ],
            output: '2x naturesaura:token_joy',
            time: 5 * time_multiplier,
            sapling: 'quark:yellow_blossom_sapling',
            id: 'token_joy'
        },
        {
            ingredients: [
                Item.of('naturesaura:aura_bottle', '{stored_type:"naturesaura:nether"}'),
                'kubejs:blank_token',
                'eidolon:death_essence',
                'minecraft:gravel',
                'tconstruct:necrotic_bone',
                'emendatusenigmatica:cast_iron_ingot'
            ],
            output: '2x naturesaura:token_fear',
            time: 5 * time_multiplier,
            sapling: 'quark:lavender_blossom_sapling',
            id: 'token_fear'
        },
        {
            ingredients: [
                Item.of('naturesaura:aura_bottle', '{stored_type:"naturesaura:nether"}'),
                'kubejs:blank_token',
                'eidolon:crimson_essence',
                'minecraft:fire_coral',
                'alexsmobs:mosquito_larva',
                'tconstruct:scorched_brick'
            ],
            output: '2x naturesaura:token_anger',
            time: 5 * time_multiplier,
            sapling: 'quark:red_blossom_sapling',
            id: 'token_anger'
        },
        {
            ingredients: [
                Item.of('naturesaura:aura_bottle', '{stored_type:"naturesaura:overworld"}'),
                'kubejs:blank_token',
                'occultism:tallow',
                'minecraft:crying_obsidian',
                'eidolon:lesser_soul_gem',
                'tconstruct:slimesteel_ingot'
            ],
            output: '2x naturesaura:token_sorrow',
            time: 5 * time_multiplier,
            sapling: 'quark:blue_blossom_sapling',
            id: 'token_sorrow'
        },
        {
            ingredients: [
                'thermal:satchel',
                'eidolon:gold_inlay',
                'tconstruct:silky_cloth',
                'tconstruct:silky_cloth',
                'farmersdelight:rope',
                'farmersdelight:rope',
                'create:dough',
                'create:dough'
            ],
            output: 'sophisticatedbackpacks:backpack',
            time: 10 * time_multiplier,
            sapling: 'quark:orange_blossom_sapling',
            id: 'backpack'
        },
        {
            ingredients: [
                'naturesaura:furnace_heater',
                'supplementaries:cage',
                'emendatusenigmatica:cast_iron_plate',
                'emendatusenigmatica:cast_iron_plate',
                'tconstruct:scorched_brick',
                'tconstruct:scorched_brick',
                'tconstruct:scorched_brick',
                'tconstruct:scorched_brick'
            ],
            output: 'create:empty_blaze_burner',
            time: 5 * time_multiplier,
            sapling: 'quark:red_blossom_sapling',
            id: 'empty_blaze_burner'
        },
        {
            ingredients: [
                'naturesaura:gold_brick',
                'naturesaura:infused_stone',
                'minecraft:piston',
                'thermal:earth_charge',
                'naturesaura:token_anger',
                Item.of('eidolon:reversal_pick').ignoreNBT()
            ],
            output: 'naturesaura:crushing_catalyst',
            time: 10 * time_multiplier,
            sapling: 'quark:lavender_blossom_sapling',
            id: 'crushing_catalyst'
        },
        {
            ingredients: [
                'minecraft:target',
                'create:radial_chassis',
                'naturesaura:infused_stone',
                'naturesaura:infused_stone',
                'naturesaura:token_anger',
                Item.of('eidolon:void_amulet').ignoreNBT(),
                'naturesaura:sky_ingot',
                'naturesaura:sky_ingot'
            ],
            output: 'naturesaura:projectile_generator',
            time: 15 * time_multiplier,
            sapling: 'quark:orange_blossom_sapling',
            id: 'projectile_generator'
        },
        {
            ingredients: [
                'emendatusenigmatica:lumium_plate',
                'naturesaura:tainted_gold_block',
                'minecraft:nether_bricks',
                'minecraft:nether_bricks',
                'naturesaura:token_fear',
                'kubejs:scarlet_gem',
                'naturesaura:sky_ingot',
                'naturesaura:sky_ingot'
            ],
            output: 'naturesaura:potion_generator',
            time: 15 * time_multiplier,
            sapling: 'quark:red_blossom_sapling',
            id: 'potion_generator'
        },
        {
            ingredients: [
                Item.of('minecraft:firework_rocket').ignoreNBT(),
                'appliedenergistics2:smooth_sky_stone_block',
                'naturesaura:infused_stone',
                'naturesaura:infused_stone',
                'naturesaura:token_anger',
                'minecraft:firework_star',
                'naturesaura:sky_ingot',
                'naturesaura:sky_ingot'
            ],
            output: 'naturesaura:firework_generator',
            time: 15 * time_multiplier,
            sapling: 'quark:pink_blossom_sapling',
            id: 'firework_generator'
        },
        {
            ingredients: [
                'naturesaura:infused_iron',
                'naturesaura:tainted_gold',
                'farmingforblockheads:red_fertilizer',
                'farmingforblockheads:red_fertilizer',
                'naturesaura:token_euphoria',
                'create:chromatic_compound',
                'minecraft:dragon_breath',
                'minecraft:dragon_breath'
            ],
            output: 'naturesaura:ancient_sapling',
            time: 10 * time_multiplier,
            sapling: 'quark:pink_blossom_sapling',
            id: 'ancient_sapling'
        },
        {
            ingredients: [
                'create:tree_fertilizer',
                'jaept:dark_dough',
                'eidolon:wicked_weave',
                'eidolon:wicked_weave',
                'naturesaura:sky_ingot',
                'naturesaura:sky_ingot',
                'naturesaura:sky_ingot',
                'naturesaura:sky_ingot'
            ],
            output: 'integrateddynamics:menril_sapling',
            time: 10 * time_multiplier,
            sapling: 'quark:blue_blossom_sapling',
            id: 'menril_sapling'
        },
        {
            ingredients: [
                Item.of('eidolon:sapping_sword').ignoreNBT(),
                'create:portable_fluid_interface',
                'emendatusenigmatica:invar_plate',
                'emendatusenigmatica:invar_plate',
                'naturesaura:token_terror',
                'alexsmobs:bone_serpent_tooth'
            ],
            output: 'bloodmagic:daggerofsacrifice',
            time: 10 * time_multiplier,
            sapling: 'quark:lavender_blossom_sapling',
            id: 'dagger_of_sacrifice'
        },
        {
            ingredients: [
                'naturesaura:gold_brick',
                'create:refined_radiance_casing',
                'minecraft:brewing_stand',
                'naturesaura:sky_ingot',
                'naturesaura:token_euphoria',
                'eidolon:gold_inlay'
            ],
            output: 'naturesaura:conversion_catalyst',
            time: 10 * time_multiplier,
            sapling: 'quark:yellow_blossom_sapling',
            id: 'conversion_catalyst'
        },
        {
            ingredients: [
                'kubejs:inductive_mechanism',
                'kubejs:inductive_mechanism',
                'naturesaura:token_rage',
                'create:electron_tube',
                'minecraft:redstone_block',
                'minecraft:redstone_block',
                'naturesaura:infused_iron_block',
                'naturesaura:infused_iron_block'
            ],
            output: 'naturesaura:rf_converter',
            time: 10 * time_multiplier,
            sapling: 'quark:red_blossom_sapling',
            id: 'rf_converter'
        },
        {
            ingredients: [
                'naturesaura:infused_iron_block',
                'naturesaura:infused_iron_block',
                'naturesaura:gold_brick',
                'naturesaura:gold_brick',
                'naturesaura:token_euphoria',
                'naturesaura:token_euphoria',
                'create:fluid_tank',
                'bloodmagic:watersigil'
            ],
            output: 'naturesaura:spring',
            time: 10 * time_multiplier,
            sapling: 'quark:blue_blossom_sapling',
            id: 'spring'
        },
        /*
            ,
            {
                ingredients: [
                    item, //top
                    item, //bottom
                    item, //left
                    item, //right

                    item, //topleft
                    item, //bottomright
                    item, //topright
                    item //bottomleft
                output: 'naturesaura:oak_generator',
                sapling: 'quark:yellow_blossom_sapling',
                id: 'naturesaura:oak_generator'
            }
            */
    ];
    recipes.forEach((recipe) => {
        recipe.type = 'naturesaura:tree_ritual';
        recipe.ingredients = recipe.ingredients.map((input) => Ingredient.of(input).toJson());
        recipe.sapling = Item.of(recipe.sapling).toJson();
        recipe.output = Item.of(recipe.output).toResultJson();

        event.custom(recipe).id(recipe.id.includes(':')?recipe.id:`${id_prefix}/${recipe.id}`);
    });
});
