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: 'astralsorcery:starmetal_ore',
            output: '2x astralsorcery:stardust',
            secondary: [],
            id: 'stardust'
        },
        {
            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: 'kubejs:titanium_ore',
            output: '2x kubejs:titanium_dust',
            secondary: [Item.of('kubejs:vanadium_dust').withChance(0.1)],
            id: 'titanium_dust'
        },
        {
            input: 'kubejs:chromium_ore',
            output: '2x kubejs:chromium_dust',
            secondary: ['occultism:crushed_end_stone'],
            id: 'chromium_dust'
        },
        {
            input: 'kubejs:titanium_ingot',
            output: 'kubejs:titanium_dust',
            secondary: [],
            id: 'titanium_dust_from_ingot'
        },
        {
            input: 'kubejs:chromium_ingot',
            output: 'kubejs:chromium_dust',
            secondary: [],
            id: 'chromium_dust_from_ingot'
        },
        {
            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).concat(cgems).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`);
    });

});