onEvent('recipes', (event) => {

    const id_prefix = 'masterfulmachinery:kubejs/primitive_artificial_assembler';
    const recipes = [
        {
            output: 'eidolon:crucible',
            inputs: {
                items: [
                    '7x eidolon:pewter_ingot',
                    'farmersdelight:cooking_pot',
                    '2x create:dough'
                ],
                speed: 32
            },
            ticks: 50,
            id: 'crucible'
        },
        {
            output: 'eidolon:brazier',
            inputs: {
                items: [
                    '3x eidolon:pewter_ingot',
                    '4x emendatusenigmatica:lead_rod',
                    '3x farmersdelight:rope'
                ],
                speed: 32
            },
            ticks: 30,
            id: 'brazier'
        },
        {
            output: 'eidolon:stone_hand',
            inputs: {
                items: [
                    '3x minecraft:stone',
                    '4x mekanism:crystal_iron',
                    'create:dough'
                ],
                speed: 32
            },
            ticks: 20,
            id: 'stone_hand'
        },
        {
            output: '8x farmersdelight:rope',
            inputs: {
                items: [
                    '8x farmersdelight:straw'
                ],
                speed: 32
            },
            ticks: 20,
            id: 'rope'
        },
        {
            output: 'eidolon:wooden_altar',
            inputs: {
                items: [
                    '3x eidolon:polished_planks',
                    '2x eidolon:polished_planks_fence',
                    '2x create:dough'
                ],
                speed: 32
            },
            ticks: 40,
            id: 'wooden_altar'
        },
        {
            output: 'eidolon:straw_effigy',
            inputs: {
                items: [
                    '5x minecraft:wheat',
                    'eidolon:polished_planks_slab',
                    '2x farmersdelight:rope'
                ],
                speed: 32
            },
            ticks: 30,
            id: 'straw_effigy'
        },
        {
            output: 'thermal:satchel',
            inputs: {
                items: [
                    'minecraft:chest',
                    '4x minecraft:leather',
                    'eidolon:pewter_inlay',
                    '3x farmersdelight:rope'
                ],
                speed: 32
            },
            ticks: 30,
            id: 'satchel'
        },
        {
            output: 'kubejs:scarlet_gem',
            inputs: {
                items: [
                    '4x jaept:scarlet_rope',
                    'eidolon:shadow_gem'
                ],
                speed: 64
            },
            ticks: 30,
            id: 'scarlet_gem'
        },
        {
            output: 'eidolon:necrotic_focus',
            inputs: {
                items: [
                    '3x minecraft:stone_slab',
                    '2x minecraft:bone',
                    'eidolon:pewter_inlay',
                    'eidolon:wraith_heart',
                    '3x create:dough'
                ],
                speed: 32
            },
            ticks: 40,
            id: 'necrotic_focus'
        },
        {
            output: 'create:water_wheel',
            inputs: {
                items: [
                    'create:large_cogwheel',
                    '2x eidolon:polished_planks_slab',
                    '2x create:dough'
                ],
                speed: 32
            },
            ticks: 40,
            id: 'water_wheel'
        },
        {
            output: 'immersiveengineering:waterwheel_segment',
            inputs: {
                items: [
                    '3x immersiveengineering:treated_wood_horizontal',
                    '4x immersiveengineering:stick_treated',
                    '2x create:dough'
                ],
                speed: 256
            },
            ticks: 80,
            id: 'waterwheel_segment'
        },
        {
            output: 'immersiveengineering:windmill_blade',
            inputs: {
                items: [
                    '3x immersiveengineering:treated_wood_horizontal',
                    '4x immersiveengineering:stick_treated',
                    '2x farmersdelight:rope'
                ],
                speed: 256
            },
            ticks: 80,
            id: 'windmill_blade'
        }
    ];

    recipes.forEach((recipe) => {
        
        var buildRecipe = {
            type: 'masterfulmachinery:machine_process',
            structureId: 'primitive_artificial_assembler_structure',
            controllerId: 'primitive_artificial_assembler'
        };
        buildRecipe.outputs = [{ type: 'masterfulmachinery:items', data: Item.of(recipe.output).toResultJson() }];
        buildRecipe.inputs = recipe.inputs.items.map((item) => (
            { type: 'masterfulmachinery:items', data: Item.of(item).toResultJson() }
        ));
        buildRecipe.inputs.push({ type: 'masterfulmachinery:create_rotation', data: { speed: recipe.inputs.speed } });
        buildRecipe.ticks = recipe.ticks;
        event.custom(buildRecipe).id(`${id_prefix}/${recipe.id}`);

    });
});
