onEvent('recipes', event => {

    const id_prefix = 'bloodmagic:kubejs/soulforge';

    const recipes = [
        {
            output: 'bloodmagic:soulgempetty',
            items: [
                'emendatusenigmatica:silver_crystal',
                'create:refined_radiance',
                '#quark:shards',
                'bloodmagic:reagentholding'
            ],
            minDrain: 1.0,
            drain: 1.0,
            id: 'pettytartaricgem'
        },
        {
            output: 'bloodmagic:soulgemlesser',
            items: [
                'bloodmagic:soulgempetty',
                'eidolon:lesser_soul_gem',
                'createaddition:overcharged_casing',
                'bloodmagic:dungeon_metal'
            ],
            minDrain: 60.0,
            drain: 20.0,
            id: 'lessertartaricgem'
        },
        {
            output: 'bloodmagic:soulgemcommon',
            items: [
                'bloodmagic:soulgemlesser',
                'bloodmagic:mundanelengtheningcatalyst',
                'emendatusenigmatica:nebu_dust',
                'bloodmagic:altarcapacityrune'
            ],
            minDrain: 200.0,
            drain: 80.0,
            id: 'commontartaricgem'
        },
        {
            output: 'bloodmagic:soulgemgreater',
            items: [
                'bloodmagic:soulgemcommon',
                '#bloodmagic:crystals/demon',
                'atum:godforged_block',
                'bloodmagic:bettercapacityrune'
            ],
            minDrain: 1000.0,
            drain: 200.0,
            id: 'greatertartaricgem'
        },
        {
            output: '3x bloodmagic:ingot_hellforged',
            items: [
                'naturesaura:sky_ingot',
                'naturesaura:sky_ingot',
                'emendatusenigmatica:aluminum_ingot',
                'integrateddynamics:crystalized_menril_chunk'
            ],
            minDrain: 4.0,
            drain: 4.0,
            id: 'hellforged_ingot'
        },
        {
            output: '2x bloodmagic:dungeon_stone',
            items: [
                'bloodmagic:stonetilepath',
                'bloodmagic:stonetilepath',
                'alexsmobs:soul_heart',
                'emendatusenigmatica:enderium_dust'
            ],
            minDrain: 60.0,
            drain: 16.0,
            id: 'demon_stone'
        },
        {
            output: '2x integrateddynamics:proto_chorus',
            items: [
                'eidolon:warped_sprouts',
                'integrateddynamics:menril_berries',
                'integrateddynamics:menril_berries',
                'naturesaura:ancient_leaves'
            ],
            minDrain: 60.0,
            drain: 20.0,
            id: 'proto_chorus'
        },
        {
            output: 'bloodmagic:airscribetool',
            items: [
                'kubejs:inscription_bottle',
                'bloodmagic:reagentair',
                'bloodmagic:reagentair',
                'bloodmagic:reagentair'
            ],
            minDrain: 40.0,
            drain: 20.0,
            id: 'air_tool'
        },
        {
            output: 'bloodmagic:firescribetool',
            items: [
                'kubejs:inscription_bottle',
                'bloodmagic:reagentlava',
                'bloodmagic:reagentlava',
                'bloodmagic:reagentlava'
            ],
            minDrain: 40.0,
            drain: 20.0,
            id: 'fire_tool'
        },
        {
            output: 'bloodmagic:waterscribetool',
            items: [
                'kubejs:inscription_bottle',
                'bloodmagic:reagentwater',
                'bloodmagic:reagentwater',
                'bloodmagic:reagentwater'
            ],
            minDrain: 40.0,
            drain: 20.0,
            id: 'water_tool'
        },
        {
            output: 'bloodmagic:earthscribetool',
            items: [
                'kubejs:inscription_bottle',
                'bloodmagic:reagentgrowth',
                'bloodmagic:reagentgrowth',
                'bloodmagic:reagentgrowth'
            ],
            minDrain: 40.0,
            drain: 20.0,
            id: 'earth_tool'
        },
        {
            output: 'bloodmagic:duskscribetool',
            items: [
                'kubejs:inscription_bottle',
                'bloodmagic:reagentvoid',
                'bloodmagic:reagentvoid',
                'bloodmagic:reagentvoid'
            ],
            minDrain: 500.0,
            drain: 100.0,
            id: 'dusk_tool'
        },
        {
            output: 'bloodmagic:masterritualstone',
            items: [
                'bloodmagic:ritualstone',
                'bloodmagic:ritualstone',
                'integrateddynamics:logic_director',
                'naturesaura:token_terror'
            ],
            minDrain: 200.0,
            drain: 40.0,
            id: 'master_ritual_stone'
        },
        {
            output: 'bloodmagic:simplekey',
            items: [
                'emendatusenigmatica:redstone_crystal',
                'emendatusenigmatica:aluminum_rod',
                'emendatusenigmatica:aluminum_fragment',
                'bloodmagic:infusedslate'
            ],
            minDrain: 200.0,
            drain: 50.0,
            id: 'simple_key'
        },
        {
            output: 'bloodmagic:primitive_explosive_cell',
            items: [
                'bloodmagic:explosivepowder',
                'appliedenergistics2:sky_stone_block',
                'bloodmagic:reinforcedslate',
                'emendatusenigmatica:cast_iron_ingot'
            ],
            minDrain: 200.0,
            drain: 50.0,
            id: 'primitive_explosive_cell'
        },
        {
            output: 'bloodmagic:itemroutingnode',
            items: [
                'integratedterminals:menril_glass',
                'bloodmagic:reagentmagnetism',
                'bloodmagic:demonslate',
                'atum:khnumite'
            ],
            minDrain: 400.0,
            drain: 20.0,
            id: 'item_routing_node'
        },
        {
            output: 'bloodmagic:noderouter',
            items: [
                'bloodmagic:demonslate',
                'integrateddynamics:logic_director',
                'emendatusenigmatica:cast_iron_rod',
                'emendatusenigmatica:aluminum_crystal'
            ],
            minDrain: 400.0,
            drain: 100.0,
            id: 'node_router'
        },
        {
            output: 'bloodmagic:sanguinereverter',
            items: [
                'minecraft:shears', 
                'bloodmagic:dungeon_stone',
                'bloodmagic:infusedslate',
                'bloodmagic:ingot_hellforged'
            ],
            minDrain: 500.0,
            drain: 100.0,
            id: 'sanguine_reverter'
        },
        {
            output: 'bloodmagic:demonwillgauge',
            items: [
                'naturesaura:eye_improved', 
                'bloodmagic:reagentsight',
                'emendatusenigmatica:aluminum_plate',
                '#bloodmagic:crystals/demon'
            ],
            minDrain: 500.0,
            drain: 100.0,
            id: 'demon_will_gauge'
        },
        {
            output: 'bloodmagic:primitive_crystalline_resonator',
            items: [
                'appliedenergistics2:sky_stone_block', 
                '#bloodmagic:crystals/demon',
                '#forge:rods/all_metal',
                '#forge:rods/all_metal'
            ],
            minDrain: 1500.0,
            drain: 200.0,
            id: 'primitive_crystalline_resonator'
        },
        {
            output: 'jaept:dark_dough',
            items: [
                'create:dough',
                'emendatusenigmatica:obsidian_dust',
                'minecraft:black_dye',
                'minecraft:black_dye'
            ],
            minDrain: 1500.0,
            drain: 40.0,
            id: 'dark_dough' 
        },
        {
            output: 'occultism:chalk_white_impure',
            items: [
                'astralsorcery:rock_crystal', 
                'occultism:otherworld_ashes',
                'occultism:burnt_otherstone',
                'emendatusenigmatica:coke_dust'
            ],
            minDrain: 2000.0,
            drain: 500.0,
            id: 'chalk_white_impure'
        },
        {
            output: 'occultism:chalk_purple_impure',
            items: [
                'astralsorcery:attuned_rock_crystal', 
                'occultism:otherworld_ashes',
                'occultism:burnt_otherstone',
                'occultism:spirit_attuned_gem'
            ],
            minDrain: 2000.0,
            drain: 500.0,
            id: 'chalk_purple_impure'
        },
        {
            output: '2x emendatusenigmatica:electrum_ingot',
            items: [
                'atum:nebu_ingot',
                'kubejs:holy_ingot',
                'emendatusenigmatica:signalum_nugget',
                'emendatusenigmatica:signalum_nugget'
            ],
            minDrain: 1500.0,
            drain: 80.0,
            id: 'electrum_ingot'
        }
    ]

    recipes.forEach((recipe) => {
        event.recipes.bloodmagic
            .soulforge(recipe.output, recipe.items)
            .minimumDrain(recipe.minDrain)
            .drain(recipe.drain)
            .id(`${id_prefix}/${recipe.id}`);
    })

    const will_types = ['raw', 'corrosive', 'destructive', 'steadfast', 'vengeful'];
    will_types.forEach((type) => {
        var id = type;
        if(type=="raw"){
            id = 'default';
        }
        event.recipes.bloodmagic
            .soulforge(`bloodmagic:${type}catalyst`, [
                'bloodmagic:simplecatalyst',
                `bloodmagic:${id}crystal`,
                'atum:ectoplasm',
                'integrateddynamics:crystalized_chorus_chunk'
            ]).minimumDrain(500).drain(40).id(`${id_prefix}/${type}_catalyst`);
    })

})