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

    const id_prefix = 'astralsorcery:kubejs/infuser';

    const recipes = [
        {
            input: { item: 'emendatusenigmatica:lumium_dust' },
            fluid: 'astralsorcery:liquid_starlight',
            consumptionChance: 0.05,
            output: {
                item: 'astralsorcery:illumination_powder',
                count: 2,
            },
            duration: 40,
            id: 'illumination_powder'
        },
        {
            input: { item: 'atum:crystal_glass' },
            fluid: 'astralsorcery:liquid_starlight',
            consumptionChance: 0.1,
            output: {
                item: 'astralsorcery:glass_lens',
                count: 1,
            },
            duration: 40,
            id: 'glass_lens'
        },
        {
            input: { item: 'astralsorcery:parchment' },
            fluid: 'astralsorcery:liquid_starlight',
            consumptionChance: 0.1,
            output: {
                item: 'astralsorcery:constellation_paper',
                count: 1,
            },
            duration: 40,
            id: 'constellation_paper'
        },
        {
            input: { item: 'kubejs:quartz_crystal_pack' },
            fluid: 'astralsorcery:liquid_starlight',
            consumptionChance: 0.2,
            output: {
                item: 'appliedenergistics2:purified_nether_quartz_crystal',
                count: 4,
            },
            duration: 80,
            id: 'purified_nether_quartz_crystal'
        },
        {
            input: { item: 'minecraft:ender_pearl' },
            fluid: 'tconstruct:blazing_blood',
            consumptionChance: 0.5,
            output: {
                item: 'minecraft:ender_eye',
                count: 1,
            },
            duration: 80,
            id: 'ender_eye'
        },
        {
            input: { item: 'create:blaze_cake_base' },
            fluid: 'tconstruct:blazing_blood',
            consumptionChance: 0.25,
            output: {
                item: 'create:blaze_cake',
                count: 1,
            },
            duration: 40,
            id: 'blaze_cake'
        },
        {
            input: { item: 'tconstruct:necrotic_bone' },
            fluid: 'tconstruct:blazing_blood',
            consumptionChance: 0.2,
            output: {
                item: 'tconstruct:blazing_bone',
                count: 1,
            },
            duration: 40,
            id: 'blazing_bone'
        },
        {
            input: { tag: 'forge:slimeballs' },
            fluid: 'tconstruct:blazing_blood',
            consumptionChance: 0.05,
            output: {
                item: 'minecraft:magma_cream',
                count: 1,
            },
            duration: 20,
            id: 'magma_cream'
        },
        {
            input: { tag: 'tconstruct:congealed_slime' },
            fluid: 'tconstruct:blazing_blood',
            consumptionChance: 0.2,
            output: {
                item: 'minecraft:magma_block',
                count: 1,
            },
            duration: 60,
            id: 'magma_block'
        },
        {
            input: { item: 'eidolon:zombie_heart' },
            fluid: 'tconstruct:blazing_blood',
            consumptionChance: 0.5,
            output: {
                item: 'atum:efreet_heart',
                count: 1,
            },
            duration: 100,
            id: 'efreet_heart'
        }
    ]

    recipes.forEach((recipe)=>{
        event.custom({
            type: 'astralsorcery:infuser',
            fluidInput: recipe.fluid,
            input: recipe.input,
            output: recipe.output,
            consumptionChance: recipe.consumptionChance,
            duration: recipe.duration,
            consumeMultipleFluids: false,
            acceptChaliceInput: true,
            copyNBTToOutputs: false
        }).id(`${id_prefix}/${recipe.id}`)
    })

    metals.forEach((metal) => {
        let modid = Item.exists(`minecraft:${metal}_ingot`)? 'minecraft':'emendatusenigmatica';
        if(Item.exists(`#forge:ores/${metal}`)){
            event.custom({
                type: 'astralsorcery:infuser',
                fluidInput: 'astralsorcery:liquid_starlight',
                input: `#forge:ores/${metal}`,
                output: {
                    item: `${modid}:${metal}_ingot`,
                    count: 3
                },
                consumptionChance: 0.1,
                duration: 100,
                consumeMultipleFluids: false,
                acceptChaliceInput: true,
                copyNBTToOutputs: false
            }).id(`${id_prefix}/${metal}_ingot`)
        }
    });

    gems.forEach((gem) => {
        let id = Item.exists(`minecraft:${gem}`)? `minecraft:${gem}`:`emendatusenigmatica:${gem}_gem`;
        event.custom({
                type: 'astralsorcery:infuser',
                fluidInput: 'astralsorcery:liquid_starlight',
                input: `#forge:ores/${gem}`,
                output: {
                    item: id,
                    count: 3
                },
                consumptionChance: 0.2,
                duration: 200,
                consumeMultipleFluids: false,
                acceptChaliceInput: true,
                copyNBTToOutputs: false
            }).id(`${id_prefix}/${gem}`)
    });

    cgems.forEach((cgem) => {
        let id = Item.exists(`minecraft:${cgem}_block`)? `minecraft:${cgem}_block`:`emendatusenigmatica:${cgem}_block`;
        event.custom({
                type: 'astralsorcery:infuser',
                fluidInput: 'astralsorcery:liquid_starlight',
                input: `#forge:ores/${cgem}`,
                output: {
                    item: id,
                    count: 1
                },
                consumptionChance: 0.2,
                duration: 200,
                consumeMultipleFluids: false,
                acceptChaliceInput: true,
                copyNBTToOutputs: false
            }).id(`${id_prefix}/${cgem}`)
    });

})