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

    const id_prefix = 'masterfulmachinery:kubejs/mechanical_artifact_assembler';
    const recipes = [
        {
            outputs: 'eidolon:mind_shielding_plate',
            inputs: [
                'minecraft:lapis_block',
                '6* emendatusenigmatica:lead_ingot',
                '2* minecraft:leather',
                'eidolon:soul_shard',
                'minecraft:quartz'
            ],
            ticks: 100,
            id: 'mind_shielding_plate'
        },
        {
            outputs: 'eidolon:cleaving_axe',
            inputs: [
                '3* eidolon:pewter_ingot',
                '2* minecraft:stick',
                'eidolon:pewter_inlay',
                'eidolon:unholy_symbol'
            ],
            ticks: 100,
            id: 'cleaving_axe'
        },
        {
            outputs: 'eidolon:reaper_scythe',
            inputs: [
                '3* eidolon:pewter_ingot',
                '2* minecraft:stick',
                '2* eidolon:soul_shard',
                'eidolon:tattered_cloth',
                'eidolon:unholy_symbol'
            ],
            ticks: 100,
            id: 'reaper_scythe'
        },
        {
            outputs: 'eidolon:soulfire_wand',
            inputs: [
                '2* eidolon:arcane_gold_ingot',
                'eidolon:shadow_gem',
                'minecraft:stick',
                'eidolon:gold_inlay',
                'eidolon:lesser_soul_gem',
                '3* minecraft:blaze_powder'
            ],
            ticks: 100,
            id: 'soulfire_wand'
        },
        {
            outputs: 'eidolon:reversal_pick',
            inputs: [
                '2* minecraft:obsidian',
                'minecraft:crying_obsidian',
                'eidolon:pewter_ingot',
                'eidolon:pewter_inlay',
                'minecraft:ender_pearl',
                '2* eidolon:soul_shard',
                'eidolon:lesser_soul_gem'
            ],
            ticks: 100,
            id: 'reversal_pick'
        },
        {
            outputs: 'eidolon:gravity_belt',
            inputs: [
                'minecraft:ender_pearl',
                '2* minecraft:feather',
                'eidolon:basic_belt',
                'eidolon:lesser_soul_gem',
                '2* eidolon:ender_calx',
                '2* eidolon:pewter_inlay'
            ],
            ticks: 100,
            id: 'gravity_belt'
        },
        {
            outputs: 'eidolon:resolute_belt',
            inputs: [
                'eidolon:gold_inlay',
                '2* eidolon:arcane_gold_ingot',
                'eidolon:basic_belt',
                'minecraft:diamond',
                'minecraft:leather',
                '2* eidolon:soul_shard',
                'eidolon:enchanted_ash'
            ],
            ticks: 100,
            id: 'resolute_belt'
        },
        {
            outputs: 'eidolon:glass_hand',
            inputs: [
                'minecraft:diamond_block',
                'eidolon:basic_amulet',
                'minecraft:glass',
                'eidolon:zombie_heart',
                '2* eidolon:lesser_soul_gem',
                'eidolon:wraith_heart'
            ],
            ticks: 100,
            id: 'glass_hand'
        },
        {
            outputs: 'eidolon:prestigious_palm',
            inputs: [
                '4* eidolon:wicked_weave',
                'eidolon:lesser_soul_gem',
                'eidolon:warped_sprouts',
                '2* eidolon:ender_calx',
                'eidolon:soul_shard'
            ],
            ticks: 100,
            id: 'prestigious_palm'
        },
        {
            outputs: 'eidolon:warded_mail',
            inputs: [
                'eidolon:lesser_soul_gem',
                '3* eidolon:enchanted_ash',
                'minecraft:iron_chestplate',
                '4* eidolon:pewter_inlay'
            ],
            ticks: 100,
            id: 'warded_mail'
        },
        {
            outputs: 'eidolon:bonechill_wand',
            inputs: [
                '2* eidolon:pewter_ingot',
                'eidolon:wraith_heart',
                'minecraft:stick',
                'eidolon:pewter_inlay',
                'eidolon:lesser_soul_gem',
                '3* minecraft:bone_meal'
            ],
            ticks: 100,
            id: 'bonechill_wand'
        },
        {
            outputs: 'eidolon:void_amulet',
            inputs: [
                'eidolon:pewter_ingot',
                '2* eidolon:pewter_inlay',
                'eidolon:basic_amulet',
                'minecraft:obsidian',
                '2* eidolon:soul_shard'
            ],
            ticks: 100,
            id: 'void_amulet'
        },
        {
            outputs: 'atum:scarab',
            inputs: [
                'kubejs:scarab_body',
                '4* kubejs:scarab_leg',
                '4* kubejs:scarab_wing',
            ],
            ticks: 200,
            id: 'scarab'
        },
        {
            outputs: 'naturesaura:eye_improved',
            inputs: [
                'naturesaura:eye',
                '4* naturesaura:sky_ingot',
                'integrateddynamics:part_world_reader'
            ],
            ticks: 200,
            id: 'eye_improved'
        },
        {
            outputs: 'bloodmagic:sacrificialdagger',
            inputs: [
                'integrateddynamics:logic_director',
                '2* emendatusenigmatica:brass_rod',
                '2* bloodmagic:reagentbinding',
                'naturesaura:token_grief'
            ],
            ticks: 200,
            id: 'sacrificialdagger'
        },
        {
            outputs: 'bloodmagic:ritualdiviner',
            inputs: [
                '2* naturesaura:ancient_stick',
                '2* eidolon:wicked_weave',
                'bloodmagic:airscribetool',
                'bloodmagic:firescribetool',
                'bloodmagic:waterscribetool',
                'bloodmagic:earthscribetool'
            ],
            ticks: 250,
            id: 'ritualdiviner'
        },
        {
            outputs: 'bloodmagic:soulsword',
            inputs: [
                'atum:limestone_sword',
                '4* bloodmagic:ingot_hellforged',
                'create:shadow_steel'
            ],
            ticks: 250,
            id: 'soul_sword'
        },
        {
            outputs: 'bloodmagic:soulscythe',
            inputs: [
                'atum:limestone_hoe',
                '4* bloodmagic:ingot_hellforged',
                'create:shadow_steel'
            ],
            ticks: 250,
            id: 'soul_scythe'
        },
        {
            outputs: 'bloodmagic:soulaxe',
            inputs: [
                'atum:limestone_axe',
                '4* bloodmagic:ingot_hellforged',
                'create:shadow_steel'
            ],
            ticks: 250,
            id: 'soul_axe'
        },
        {
            outputs: 'bloodmagic:soulpickaxe',
            inputs: [
                'atum:limestone_pickaxe',
                '4* bloodmagic:ingot_hellforged',
                'create:shadow_steel'
            ],
            ticks: 250,
            id: 'soul_pickaxe'
        },
        {
            outputs: 'bloodmagic:soulshovel',
            inputs: [
                'atum:limestone_shovel',
                '4* bloodmagic:ingot_hellforged',
                'create:shadow_steel'
            ],
            ticks: 250,
            id: 'soul_shovel'
        },
        {
            outputs: 'createaddition:diamond_grit_sandpaper',
            inputs: [
                'minecraft:paper',
                '4* emendatusenigmatica:diamond_dust',
                'bloodmagic:bow_power_anointment_l'
            ],
            ticks: 200,
            id: 'diamond_grit_sandpaper'
        },
        {
            outputs: 'createaddition:overcharged_hammer',
            inputs: [
                '2* emendatusenigmatica:cast_iron_rod',
                'jaept:dark_dough',
                '2* createaddition:overcharged_casing'
            ],
            ticks: 200,
            id: 'overcharged_hammer'
        },
        {
            outputs: 'atum:godforged_block',
            inputs: [
                '6* atum:nebu_drop',
                '4* kubejs:holy_ingot',
                '3* #atum:godshards'
            ],
            ticks: 200,
            id: 'godforged_block'
        },
        {
            outputs: 'occultism:lens_frame',
            inputs: [
                '2* occultism:otherstone_frame',
                '3* emendatusenigmatica:silver_crystal'
            ],
            ticks: 200,
            id: 'lens_frame'
        },
        {
            outputs: 'occultism:storage_remote_inert',
            inputs: [
                'occultism:otherstone_tablet',
                'atum:relic_gold_ring',
                '9* immersiveengineering:component_steel'
            ],
            ticks: 200,
            id: 'storage_remote_inert'
        }
    ];

    recipes.forEach((recipe) => {
        
        var buildRecipe = {
            type: 'masterfulmachinery:machine_process',
            structureId: 'mechanical_artifact_assembler_structure',
            controllerId: 'mechanical_artifact_assembler'
        };
        buildRecipe.outputs = [{ type: 'masterfulmachinery:items', data: { item: recipe.outputs.includes('*')? recipe.outputs.substring(3):recipe.outputs, count: 1 } }];
        buildRecipe.inputs = [];
        recipe.inputs.forEach((input) => {
            if(typeof input == 'string'){
                cnt = input.includes('*')? parseInt(input.charAt(0)):1;
                if(input.includes('#')){
                    jsonInput = { type: 'masterfulmachinery:items', data: { tag: input.includes('*')? input.substring(4):input.substring(1), count: cnt } };
                }else{
                    jsonInput = { type: 'masterfulmachinery:items', data: { item: input.includes('*')? input.substring(3):input, count: cnt } };
                }
            }else{
                jsonInput = { type: 'masterfulmachinery:items', data: input};
            }
            buildRecipe.inputs.push(jsonInput);
        });
        buildRecipe.ticks = recipe.ticks;
        event.custom(buildRecipe).id(`${id_prefix}/${recipe.id}`);

    });
});
