onEvent('recipes', (event) => {
    
    const id_prefix = 'immersiveengineering:kubejs/alloy';

    const recipes = [
        {
            inputs: ['minecraft:iron_ingot', 'emendatusenigmatica:lead_ingot'],
            output: '2x eidolon:pewter_ingot',
            id: 'pewter_ingot'
        },
        {
            inputs: ['3x emendatusenigmatica:copper_ingot', '#forge:sand'],
            output: '3x tconstruct:tinkers_bronze_ingot',
            id: 'tinkers_bronze'
        },
        {
            inputs: ['naturesaura:tainted_gold', 'jaept:holy_ingot'],
            output: '2x emendatusenigmatica:electrum_ingot',
            id: 'electrum_ingot'
        },
        {
            inputs: ['miniutilities:cursed_earth', 'miniutilities:blessed_earth'],
            output: '2x miniutilities:blursed_earth',
            id: 'blursed_earth'
        },
        {
            inputs: ['4x atum:sand', '4x atum:sand'],
            output: '8x atum:crystal_glass',
            id: 'crystal_glass'
        },
        {
            inputs: ['apotheosis:null_book', '8x emendatusenigmatica:enderium_ingot'],
            output: 'pedestals:bookarea',
            id: 'book_area'
        },
        {
            inputs: ['apotheosis:null_book', '8x naturesaura:sky_ingot'],
            output: 'pedestals:bookrange',
            id: 'book_range'
        },
        {
            inputs: ['apotheosis:null_book', '4x bloodmagic:quick_draw_anointment_2'],
            output: 'pedestals:bookspeed',
            id: 'book_speed'
        },
        {
            inputs: ['apotheosis:null_book', '4x bloodmagic:reagentholding'],
            output: 'pedestals:bookcapacity',
            id: 'book_capacity'
        },
        {
            inputs: ['apotheosis:null_book', '4x bloodmagic:reagentmagnetism'],
            output: 'pedestals:bookmagnet',
            id: 'book_magnet'
        },
        {
            inputs: ['apotheosis:null_book', '4x #forge:storage_blocks/holy'],
            output: 'pedestals:bookadvanced',
            id: 'book_advanced'
        },
        {
            inputs: ['atum:golden_date', '4x atum:nebu_block'],
            output: 'atum:golden_date_enchanted',
            id: 'golden_date_enchanted'
        },
        {
            inputs: ['4x darkutils:dark_glass', '4x engineersdecor:panzerglass_block'],
            output: '8x mob_grinding_utils:tinted_glass',
            id: 'tinted_glass'
        },
        {
            inputs: ['minecraft:netherite_scrap', '2x atum:nebu_drop'],
            output: '2x tconstruct:netherite_nugget',
            id: 'netherite_nugget'
        },
        {
            inputs: ['3x emendatusenigmatica:cobalt_nugget', 'tconstruct:debris_nugget'],
            output: '4x tconstruct:manyullyn_nugget',
            id: 'manyullyn_nugget'
        },
        {
            inputs: ['4x emendatusenigmatica:steel_ingot', 'alexsmobs:soul_heart'],
            output: '4x tconstruct:soulsteel_ingot',
            id: 'soulsteel_ingot'
        },
        {
            inputs: ['immersiveengineering:dust_hop_graphite', 'occultism:iesnium_ingot'],
            output: 'immersiveengineering:ingot_hop_graphite',
            id: 'ingot_hop_graphite'
        },
        // {
        //     inputs: ['astralsorcery:stardust', '#forge:ingots/titanium'],
        //     output: 'astralsorcery:starmetal_ingot',
        //     id: 'starmetal_ingot'
        // }
    ];

    recipes.forEach((recipe) => {
        event.recipes.immersiveengineering.alloy(recipe.output, recipe.inputs[0], recipe.inputs[1]).id(`${id_prefix}/${recipe.id}`);
    });

    ores.forEach((ore) => {
        let crystal = itemOf(`#mekanism:crystals/${ore}`);
        let gear = itemOf(`#forge:gears/${ore}`);
        if(crystal!=null && gear!=null){
            event.recipes.immersiveengineering.alloy(
                gear, Item.of(crystal,8), 'immersiveengineering:component_iron'
            ).id(`${id_prefix}/${ore}_gear`);
        }
    });

    colors.forEach((color) => {
        event.recipes.immersiveengineering.alloy(
            `2x atum:ceramic_${color}`,
            '2x atum:marl',
            `#forge:dyes/${color}`
        ).id(`${id_prefix}/ceramic_${color}`);
        event.recipes.immersiveengineering.alloy(
            `8x atum:${color}_stained_crystal_glass`,
            '8x atum:sand',
            `#forge:dyes/${color}`
        ).id(`${id_prefix}/${color}_stained_crystal_glass`);
    });

    artifacts.forEach((type) => {
        event.recipes.immersiveengineering.alloy(
            `4x atum:torch_of_${type.godId}`,
            '4x atum:nebu_torch',
            `atum:${type.godId}_godshard`
        ).id(`${id_prefix}/torch_of_${type.godId}`);
        event.remove({id: `atum:torch_of_${type.godId}`});
        event.recipes.immersiveengineering.alloy(
            `atum:lantern_of_${type.godId}`,
            'atum:nebu_lantern',
            `atum:${type.godId}_godshard`
        ).id(`${id_prefix}/lantern_of_${type.godId}`);
        event.remove({id: `atum:lantern_of_${type.godId}`});
    })
});