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

    const recipes =  [
        {
            input: '#forge:coral_fans',
            output: 'kubejs:coral_dust',
            secondary: [],
            id: 'coral_dust_from_fans'
        },
        {
            input: '#forge:corals',
            output: 'kubejs:coral_dust',
            secondary: [Item.of('kubejs:coral_dust').withChance(0.5)],
            id: 'coral_dust'
        },
        {
            input: '#forge:coral_blocks',
            output: '2x kubejs:coral_dust',
            secondary: [],
            id: 'coral_dust_from_block'
        },
        {
            input: 'atum:nebu_ingot',
            output: 'emendatusenigmatica:nebu_dust',
            secondary: [],
            id: 'nebu_dust_from_ingot'
        },
        {
            input: 'atum:nebu_block',
            output: '9x emendatusenigmatica:nebu_dust',
            secondary: [],
            id: 'nebu_dust_from_block'
        },
        {
            input: 'buildinggadgets:construction_block_dense',
            output: '2x buildinggadgets:construction_paste',
            secondary: [Item.of('buildinggadgets:construction_paste').withChance(0.25)],
            id: 'construction_paste'
        },
        {
            input: 'minecraft:end_stone',
            output: '2x occultism:crushed_end_stone',
            secondary: [],
            id: 'crushed_end_stone'
        },
        {
            input: '#forge:ores/titanium',
            output: '2x jaopca:dusts.titanium',
            secondary: ['occultism:crushed_end_stone', Item.of('jaopca:dusts.vanadium').withChance(0.1)],
            id: 'titanium_dust'
        },
        {
            input: '#forge:ores/chromium',
            output: '2x jaopca:dusts.chromium',
            secondary: ['occultism:crushed_end_stone'],
            id: 'chromium_dust'
        },
        {
            input: 'rftoolspower:blazing_rod',
            output: '4x kubejs:blazing_powder',
            secondary: [],
            id: 'blazing_powder'
        },
        {
            input: 'minecraft:ender_pearl',
            output: 'emendatusenigmatica:ender_dust',
            secondary: [Item.of('emendatusenigmatica:ender_dust').withChance(0.5)],
            id: 'ender_dust'
        },
    ];
    
    recipes.forEach((recipe) => {
        event.recipes.immersiveengineering.crusher(recipe.output, recipe.input, recipe.secondary).id(`${id_prefix}/${recipe.id}`);
    });

    metals.concat(gems).forEach(metal => {
        const ingot = itemOf(`#forge:ingots/${metal}`);
        const gem = itemOf(`#forge:gems/${metal}`);
        const dust = itemOf(`#forge:dusts/${metal}`);
        const block = itemOf(`#forge:storage_blocks/${metal}`);
        if(dust!=null){
            let input = ingot!=null? ingot:gem;
            event.recipes.immersiveengineering.crusher(dust, input, []).id(`${id_prefix}/${metal}_dust_from_ingot`);
            if(block!=null && !quartz.includes(metal)){
                event.recipes.immersiveengineering.crusher(Item.of(dust,9), block, []).id(`${id_prefix}/${metal}_dust_from_block`);
            }
        }
    });

    quartz.forEach(type => {
        const gem = itemOf(`#forge:gems/${type}`);
        const block = itemOf(`#forge:storage_blocks/${type}`);
        event.recipes.immersiveengineering.crusher(Item.of(gem,4), block, []).id(`${id_prefix}/${type}`);
    });

    bbbb.forEach(type => {
        const rod = itemOf(`#forge:rods/${type}`);
        const dust = itemOf(`#forge:dusts/${type}`);
        event.recipes.immersiveengineering.crusher(Item.of(dust,4), rod, []).id(`${id_prefix}/${type}_powder`);
    });

});