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: 1.0,
            consumeMultiple: true,
            output: {
                item: 'minecraft:ender_eye',
                count: 1,
            },
            duration: 80,
            id: 'ender_eye'
        },
        {
            input: Item.of('apotheosis:hellshelf').enchant('apotheosis:hell_infusion', 3).toJson(),
            fluid: 'tconstruct:blazing_blood',
            consumptionChance: 0.25,
            consumeMultiple: true,
            output: {
                item: 'apotheosis:blazing_hellshelf',
                count: 1,
            },
            duration: 160,
            id: 'blazing_hellshelf'
        },
        {
            input: { item: 'create:cinder_flour' },
            fluid: 'tconstruct:blazing_blood',
            consumptionChance: 0.1,
            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,
            consumeMultiple: true,
            output: {
                item: 'atum:efreet_heart',
                count: 1,
            },
            duration: 100,
            id: 'efreet_heart'
        },
        {
            input: { item: 'occultism:chalk_red_impure' },
            fluid: 'kubejs:energetic_molten_redstone',
            consumptionChance: 1.0,
            consumeMultiple: true,
            output: Item.of('occultism:chalk_red', '{Unbreakable:1b}').toResultJson(),
            duration: 200,
            id: 'chalk_red'
        },
        {
            input: Item.of('occultism:otherworld_sapling_natural').ignoreNBT().toJson(),
            fluid: 'kubejs:otherworld_plantoil',
            consumptionChance: 0.25,
            consumeMultiple: true,
            output: Item.of('occultism:otherworld_sapling').toResultJson(),
            duration: 160,
            id: 'otherworld_sapling'
        }
    ]

    recipes.forEach((recipe) => {

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

    ores.forEach((ore) => {
        var crystal = itemOf(`#mekanism:crystals/${ore}`);
        if(Item.exists(crystal)){
            event.custom({
                type: 'astralsorcery:infuser',
                fluidInput: 'industrialforegoing:ether_gas',
                input: `#forge:ores/${ore}`,
                output: Item.of(crystal,3).toResultJson(),
                consumptionChance: 0.1,
                duration: 40,
                consumeMultipleFluids: false,
                acceptChaliceInput: true,
                copyNBTToOutputs: false
            }).id(`${id_prefix}/${ore}_crystal`)
        }
    });

})