onEvent('recipes', event => {

    const id_prefix = 'createaddition:kubejs/rolling';

    const recipes = [
        {result: '2x immersiveengineering:wire_copper', ingredient: 'emendatusenigmatica:copper_plate', id: 'copper_wire'},
        {result: '2x emendatusenigmatica:lapis_rod', ingredient: 'minecraft:lapis_lazuli', id: 'lapis_rod'}
    ]

    metals.forEach((metal) => {
        
        const ingot = itemOf(`#forge:ingots/${metal}`);
        const rod = itemOf(`#forge:rods/${metal}`);

        if(rod!=null){
            event.custom({
                type: 'createaddition:rolling',
                input: Item.of(ingot).toJson(),
                result: Item.of(rod,2).toResultJson()
            }).id(`${id_prefix}/${metal}_rod`);
        }
    });

    gems.forEach((metal) => {
        
        const ingot = itemOf(`#forge:gems/${metal}`);
        const rod = itemOf(`#forge:rods/${metal}`);

        if(rod!=null){
            event.custom({
                type: 'createaddition:rolling',
                input: Item.of(ingot).toJson(),
                result: Item.of(rod,2).toResultJson()
            }).id(`${id_prefix}/${metal}_rod`);
        }
    });

    recipes.forEach((recipe) => {
        event.custom({
            type: 'createaddition:rolling',
            input: { item: recipe.ingredient },
            result: Item.of(recipe.result).toResultJson()
        }).id(`${id_prefix}/${recipe.id}`);
    })

})