ServerEvents.recipes(event => {
    // CreateChromaticReturn recipes
    [
        {
            ingredient: "minecraft:coal",
            results: [{ item: "createchromaticreturn:carbon_powder", chance: 0.1 }],
            time: 300
        },
        {
            ingredient: "minecraft:coal_block",
            results: [{ count: 9, item: "createchromaticreturn:carbon_powder", chance: 0.1 }],
            time: 300
        }
    ].forEach(recipe => {
        event.custom({
            type: "create:crushing",
            ingredients: [{ item: recipe.ingredient }],
            processingTime: recipe.time,
            results: recipe.results
        });
    });

    // EnigmaticLegacy recipes with specific chances
    [
        {
            ingredient: "enigmaticlegacy:extradimensional_eye",
            results: [
                { item: "minecraft:ender_eye" },
                { count: 6, item: "minecraft:gold_nugget", chance: 0.8 },
                { count: 2, item: "minecraft:gold_nugget", chance: 0.5 }
            ],
            time: 400
        },
        {
            ingredient: "enigmaticlegacy:magnet_ring",
            results: [
                { count: 8, item: "minecraft:iron_nugget", chance: 0.8 }
            ],
            time: 300
        },
        {
            ingredient: "enigmaticlegacy:lore_inscriber",
            results: [
                { item: "enigmaticlegacy:astral_dust", chance: 0.6 },
                { item: "minecraft:ink_sac", chance: 0.7 },
                { item: "quark:clear_shard", }
            ],
            time: 300
        }
    ].forEach(recipe => {
        event.custom({
            type: "create:crushing",
            ingredients: [{ item: recipe.ingredient }],
            processingTime: recipe.time,
            results: recipe.results
        });
    });


    // IronsSpellbooks recipes 
    event.custom({
        type: "create:crushing",
        ingredients: [{ item: "irons_spellbooks:keeper_flamberge" }],
        processingTime: 450,
        results: [
            { item: "minecraft:netherite_scrap", chance: 0.25 }
        ]
    });

    // Custom Tiered recipes 
    [
        {
            tag: "custom:tier1",
            results: [
                { item: "enicreo:essense" }
            ],
            time: 600
        },
        {
            tag: "custom:tier2",
            results: [
                { item: "enicreo:essense_1" }
            ],
            time: 900
        }
    ].forEach(recipe => {
        event.custom({
            type: "create:crushing",
            ingredients: [{ tag: recipe.tag }],
            processingTime: recipe.time,
            results: recipe.results
        });
    });

    // Essense Crushing Recipes
    [
        {
            ingredient: "enicreo:essense",
            results: [
                { count: 8, item: "create:experience_nugget" }
            ],
            time: 300
        },
        {
            ingredient: "enicreo:essense_1",
            results: [
                { count: 12, item: "create_sa:heap_of_experience" }
            ],
            time: 900
        },
        {
            ingredient: "enicreo:essense_2",
            results: [
                { count: 42, item: "create:experience_block" }
            ],
            time: 2700
        },
        {
            ingredient: "enicreo:essense_3",
            results: [
                { count: 296, item: "create:experience_block" }
            ],
            time: 8100
        }
    ].forEach(recipe => {
        event.custom({
            type: "create:crushing",
            ingredients: [{ item: recipe.ingredient }],
            processingTime: recipe.time,
            results: recipe.results
        });
    });

    // Tier1_50 Crushing Recipe with Tag
    event.custom({
        type: "create:crushing",
        ingredients: [{ tag: "custom:tier1_50" }],
        processingTime: 400,
        results: [
            { item: "enicreo:essense" }
        ]
    });

    // Crushing recipes for Tier 3 items to produce essense_2
    event.custom({
        type: "create:crushing",
        ingredients: [{ tag: "custom:tier3" }],
        processingTime: 600,
        results: [
            { item: "enicreo:essense_2" }
        ]
    });

    // Crushing recipes for Tier 4 items to produce essense_3
    event.custom({
        type: "create:crushing",
        ingredients: [{ tag: "custom:tier4" }],
        processingTime: 900,
        results: [
            { item: "enicreo:essense_3" }
        ]
    });
    event.custom({
        type: "create:crushing",
        ingredients: [{ item: "enigmaticlegacy:etherium_ore" }],
        processingTime: 300,
        results: [
            { item: "enigmaticlegacy:etherium_scraps" },
            { item: "enigmaticlegacy:etherium_scraps", chance: 0.5 }
        ]
    });
    // Дробление для золотой брони
    event.custom({
        type: "create:crushing",
        ingredients: [{ tag: "custom:golden_armor" }],
        processingTime: 300,
        results: [
            { item: "minecraft:gold_nugget", count: 18 },
            { item: "minecraft:gold_nugget", count: 12, chance: 0.5 }
        ]
    });

    // Дробление для золотых инструментов
    event.custom({
        type: "create:crushing",
        ingredients: [{ tag: "custom:golden_tools" }],
        processingTime: 300,
        results: [
            { item: "minecraft:gold_nugget", count: 4 },
            { item: "minecraft:gold_nugget", count: 3, chance: 0.5 },
            { item: "minecraft:stick" }
        ]

    });
    // Дробление для алмазной брони
    event.custom({
        type: "create:crushing",
        ingredients: [{ tag: "custom:diamond_armor" }],
        processingTime: 300,
        results: [
            { item: "born_in_chaos_v1:diamond_termite_shard", count: 18 },
            { item: "born_in_chaos_v1:diamond_termite_shard", count: 12, chance: 0.5 }
        ]
    });

    // Дробление для алмазных инструментов
    event.custom({
        type: "create:crushing",
        ingredients: [{ tag: "custom:diamond_tools" }],
        processingTime: 300,
        results: [
            { item: "born_in_chaos_v1:diamond_termite_shard", count: 4 },
            { item: "born_in_chaos_v1:diamond_termite_shard", count: 3, chance: 0.5 },
            { item: "minecraft:stick" }
        ]
    });
    // Дробление для железной брони
    event.custom({
        type: "create:crushing",
        ingredients: [{ tag: "custom:iron_armor" }],
        processingTime: 300,
        results: [
            { item: "minecraft:iron_nugget", count: 18 },
            { item: "minecraft:iron_nugget", count: 12, chance: 0.5 }
        ]
    });
    event.custom({
        type: "create:crushing",
        ingredients: [{ tag: "custom:iron_tools" }],
        processingTime: 300,
        results: [
            { item: "minecraft:iron_nugget", count: 4 },
            { item: "minecraft:iron_nugget", count: 3, chance: 0.5 },
            { item: "minecraft:stick" }
        ]
    });
    event.custom({
        type: "create:crushing",
        ingredients: [{ tag: "custom:netherite_armor" }],
        processingTime: 300,
        results: [
            { item: "minecraft:netherite_scrap" },
            { item: "minecraft:netherite_scrap", chance: 0.5 },
            { item: "minecraft:netherite_scrap", chance: 0.12 }
        ]
    });

    // Дробление для незеритовых инструментов
    event.custom({
        type: "create:crushing",
        ingredients: [{ tag: "custom:netherite_tools" }],
        processingTime: 300,
        results: [
            { item: "minecraft:netherite_scrap", },
            { item: "minecraft:netherite_scrap", chance: 0.5 },
            { item: "minecraft:netherite_scrap", chance: 0.12 },
            { item: "minecraft:stick" }
        ]
    });
    // Дробление для медной брони
    event.custom({
        type: "create:crushing",
        ingredients: [{ tag: "custom:copper_armor" }],
        processingTime: 300,
        results: [
            { item: "create:copper_nugget", count: 18 },
            { item: "create:copper_nugget", count: 12, chance: 0.5 }
        ]
    });

    // Дробление для медных инструментов
    event.custom({
        type: "create:crushing",
        ingredients: [{ tag: "custom:copper_tools" }],
        processingTime: 300,
        results: [
            { item: "create:copper_nugget", count: 4 },
            { item: "create:copper_nugget", count: 3, chance: 0.5 },
            { item: "minecraft:stick" }
        ]
    });
    // Дробление для латунной брони
    event.custom({
        type: "create:crushing",
        ingredients: [{ tag: "custom:brass_armor" }],
        processingTime: 300,
        results: [
            { item: "create:brass_nugget", count: 18 },
            { item: "create:brass_nugget", count: 12, chance: 0.5 }
        ]
    });

    // Дробление для латунных инструментов
    event.custom({
        type: "create:crushing",
        ingredients: [{ tag: "custom:brass_tools" }],
        processingTime: 300,
        results: [
            { item: "create:brass_nugget", count: 4 },
            { item: "create:brass_nugget", count: 3, chance: 0.5 },
            { item: "minecraft:stick" }
        ]
    });
    event.custom({
        type: 'create:crushing',
        ingredients: [{ item: 'royalvariations:royal_bone' }],
        processingTime: 100,
        results: [
            { item: 'royalvariations:royal_bone_meal', count: 6 },
            { item: 'minecraft:yellow_dye', chance: 0.25 },
            { item: 'royalvariations:royal_bone_meal', count: 6, chance: 0.25 }
        ]
    });
    event.custom({
        type: 'create:crushing',
        ingredients: [{ item: 'royalvariations:spiritual_crown' }],
        processingTime: 100,
        results: [
            { item: 'royalvariations:spiritual_crown_shard', count: 4 }
        ]
    });
    event.custom({
        type: 'create:crushing',
        ingredients: [{ item: 'royalvariations:royal_bomb' }],
        processingTime: 100,
        results: [
            { item: 'royalvariations:royal_gunpowder', },
            { item: "minecraft:gold_nugget", count: 26 }
        ]
    });
    const backpacks = [
        { item: 'sophisticatedbackpacks:backpack', result: [] },
        { item: 'sophisticatedbackpacks:copper_backpack', result: [{ item: 'minecraft:copper_ingot', count: 4 }] },
        { item: 'sophisticatedbackpacks:iron_backpack', result: [{ item: 'minecraft:iron_ingot', count: 4 }] },
        { item: 'sophisticatedbackpacks:gold_backpack', result: [{ item: 'minecraft:gold_ingot', count: 4 }] },
        { item: 'sophisticatedbackpacks:diamond_backpack', result: [{ item: 'minecraft:diamond', count: 4 }] },
        {
            item: 'sophisticatedbackpacks:netherite_backpack',
            result: [
                { item: 'minecraft:netherite_scrap', count: 2 },
                { item: 'minecraft:netherite_scrap', count: 2, chance: 0.5 }
            ]
        }
    ];


    backpacks.forEach(backpack => {
        const item = backpack.item;
        const result = backpack.result;

        const results = [
            { item: 'minecraft:leather', count: 2 },
            { item: 'minecraft:leather', count: 2, chance: 0.5 }
        ].concat(result);

        event.custom({
            type: 'create:crushing',
            ingredients: [{ item: item }],
            processingTime: 200,
            results: results
        });
    });
    event.custom({
        type: 'create:crushing',
        ingredients: [{ item: 'alexsmobs:straddle_saddle' }],
        processingTime: 200,
        results: [
            { item: 'minecraft:leather', count: 4 },
            { item: 'minecraft:leather', count: 4, chance: 0.5 },
            { item: 'alexsmobs:straddlite' },
            { item: 'alexsmobs:straddlite', chance: 0.5 }
        ]
    });
    event.custom({
        type: 'create:crushing',
        ingredients: [{ item: 'iammusicplayer:cassette_tape' }],
        processingTime: 150,
        results: [
            { item: 'create:cogwheel' },
            { item: 'create:belt_connector' },
            { item: 'create:copper_nugget', count: 5 }
        ]
    });
    event.custom({
        type: 'create:crushing',
        ingredients: [{ item: 'iammusicplayer:boombox' }],
        processingTime: 200,
        results: [
            { item: 'minecraft:iron_nugget', count: 12 },
            { item: 'quark:pink_shard', count: 4 },
            { item: 'create:cogwheel' },
            { item: 'minecraft:redstone', count: 2 }
        ]
    });
    event.custom({
        type: 'create:crushing',
        ingredients: [{ item: 'iammusicplayer:radio_antenna' }],
        processingTime: 200,
        results: [
            { item: 'minecraft:iron_nugget', count: 5 },
            { item: 'minecraft:redstone' },
            { item: 'create:andesite_alloy', chance: 0.5 }
        ]
    });
    event.custom({
        type: 'create:crushing',
        ingredients: [{ item: 'iammusicplayer:parabolic_antenna' }],
        processingTime: 200,
        results: [
            { item: 'iammusicplayer:radio_antenna', count: 2 },
            { item: 'create:brass_nugget', count: 5 },
            { item: 'minecraft:iron_nugget', count: 17 }
        ]
    });
    event.custom({
        type: 'create:crushing',
        ingredients: [{ tag: 'nyfsquiver:quiver_items/arrows' }],
        processingTime: 200,
        results: [
            { item: 'ars_nouveau:source_gem', chance: 0.15 }
        ]
    });
    event.custom({
        type: 'create:crushing',
        ingredients: [{ item: 'minecraft:bow' }],
        processingTime: 200,
        results: [
            { item: 'minecraft:stick', count: 2 },
            { item: 'minecraft:string', count: 2 }
        ]
    });
    event.custom({
        type: 'create:crushing',
        ingredients: [{ tag: 'minecraft:bookshelf_books' }],
        processingTime: 200,
        results: [
            { item: 'minecraft:paper', count: 3 }
        ]
    });
    event.custom({
        type: 'create:crushing',
        ingredients: [{ item: 'enicreo:resonatinggem' }],
        processingTime: 800,
        results: [
            { item: 'enicreo:nightdust' }
        ]
    });
    event.custom({
        type: 'create:crushing',
        ingredients: [{ tag: 'forge:seeds' }],
        processingTime: 200,
        results: [
            { item: 'createchromaticreturn:four_leaf_clover', chance: 0.1 }
        ]
    });
    event.custom({
        type: "create:crushing",
        ingredients: [{ tag: "custom:zinc_armor" }],
        processingTime: 300,
        results: [
            { item: "create:zinc_nugget", count: 18 },
            { item: "create:zinc_nugget", count: 12, chance: 0.5 }
        ]
    });
    event.custom({
        type: "create:crushing",
        ingredients: [{ tag: "custom:zinc_tools" }],
        processingTime: 300,
        results: [
            { item: "create:zinc_nugget", count: 4 },
            { item: "create:zinc_nugget", count: 3, chance: 0.5 },
            { item: "minecraft:stick" }
        ]
    });
    const leatherArmor = [
        'minecraft:leather_helmet',
        'minecraft:leather_chestplate',
        'minecraft:leather_leggings',
        'minecraft:leather_boots',
        'minecraft:bundle'
    ];

    leatherArmor.forEach(item => {
        event.custom({
            type: 'create:crushing',
            ingredients: [{ item: item }],
            processingTime: 200,
            results: [
                { item: 'minecraft:leather' }
            ]
        });
    });
    event.custom({
        type: 'create:crushing',
        ingredients: [{ item: 'aquamirae:remnants_saber' }],
        processingTime: 200,
        results: [
            { item: 'minecraft:bone_meal', count: 6 },
            { item: 'minecraft:bone_meal', count: 3, chance: 0.25 },
            { item: 'minecraft:white_dye', chance: 0.25 },
            { item: 'minecraft:stick', chance: 0.15 }
        ]
    });
    event.custom({
        type: 'create:crushing',
        ingredients: [{ item: 'aquamirae:sharp_bones' }],
        processingTime: 200,
        results: [
            { item: 'minecraft:bone_meal'},
            { item: 'minecraft:bone_meal', chance: 0.25 },
            { item: 'minecraft:white_dye', chance: 0.25 }
        ]
    });
    event.custom({
        type: 'create:crushing',
        ingredients: [{ item: 'born_in_chaos_v1:icy_sweetness' }],
        processingTime: 200,
        results: [
            { item: 'minecraft:sugar', chance: 0.50 }
        ]
    });
    event.custom({
        type: 'create:crushing',
        ingredients: [{ item: 'born_in_chaos_v1:nut_hammer' }],
        processingTime: 200,
        results: [
            { item: 'minecraft:stick', count: 5 },
            { item: 'minecraft:stick', count: 2, chance: 0.5 }
        ]
    });
    event.custom({
        type: 'create:crushing',
        ingredients: [{ item: 'born_in_chaos_v1:creepy_nutcracker' }],
        processingTime: 200,
        results: [
            { item: 'minecraft:string', count: 8 },
            { item: 'minecraft:string', count: 4, chance: 0.50 },
            { item: 'born_in_chaos_v1:permafrost_shard', chance: 0.05 }
        ]
    });
    event.custom({
        type: 'create:crushing',
        ingredients: [{ item: 'alexsmobs:frontier_cap', nbt: '{Damage:64}' }],
        processingTime: 200,
        results: [
            { item: 'alexsmobs:raccoon_tail', count: 1 },
            { item: 'alexsmobs:bear_fur', count: 2 },
            { item: 'minecraft:leather', count: 2 }
        ]
    });
    event.custom({
        type: 'create:crushing',
        ingredients: [{ item: 'born_in_chaos_v1:sharpened_dark_metal_sword' }],
        processingTime: 300,
        results: [
            { item: 'born_in_chaos_v1:pieceofdarkmetal', count: 8 },
            { item: 'born_in_chaos_v1:pieceofdarkmetal', count: 4, chance: 0.50 }
        ]
    });
    event.custom({
        type: 'create:crushing',
        ingredients: [{ item: 'alexsmobs:skelewag_sword' }],
        processingTime: 200,
        results: [
            { item: 'minecraft:bone_meal', count: 6 },
            { item: 'minecraft:bone_meal', count: 3, chance: 0.25 },
            { item: 'minecraft:white_dye', chance: 0.25 }
        ]
    });
    event.custom({
        type: 'create:crushing',
        ingredients: [{ item: 'minecraft:goat_horn' }],
        processingTime: 200,
        results: [
            { item: 'minecraft:bone_meal'},
            { item: 'minecraft:bone_meal', chance: 0.25 },
            { item: 'minecraft:gray_dye', chance: 0.25 }
        ]
    });
    event.custom({
        type: 'create:crushing',
        ingredients: [{ item: 'born_in_chaos_v1:soul_cutlass' }],
        processingTime: 300,
        results: [
            { item: 'born_in_chaos_v1:pieceofdarkmetal', count: 4 },
            { item: 'born_in_chaos_v1:pieceofdarkmetal', count: 3, chance: 0.5 }
        ]
    });
    event.custom({
        type: "create:crushing",
        ingredients: [{ item: 'minecraft:flint_and_steel' }],
        processingTime: 300,
        results: [
            { item: "minecraft:iron_nugget", count: 4 },
            { item: "minecraft:flint" }
        ]
    });
    event.custom({
        type: "create:crushing",
        ingredients: [{ item: 'aquamirae:poisoned_blade' }],
        processingTime: 300,
        results: [
            { item: "minecraft:iron_nugget", count: 8 },
            { item: "aquamirae:anglers_fang", chance: 0.5 },
            { item: "aquamirae:anglers_fang", chance: 0.5 },
            { item: 'minecraft:stick', chance: 0.50 }
        ]
    });
    event.custom({
        type: 'create:crushing',
        ingredients: [{ item: 'irons_spellbooks:ice_staff' }],
        processingTime: 300,
        results: [
            { item: 'irons_spellbooks:permafrost_shard', chance: 0.5  },
            { item: 'irons_spellbooks:arcane_essence', count: 2, chance: 0.5 },
            { item: 'minecraft:bone_meal', count: 3, chance: 0.25 }
        ]
    });
    event.custom({
        type: "create:crushing",
        ingredients: [{ tag: 'forge:gems/arclight' }],
        processingTime: 300,
        results: [
            { item: "create:experience_nugget", count: 1, chance: 0.3 }
        ]
    });
    event.custom({
        type: "create:crushing",
        ingredients: [{ tag: 'forge:gems/moonlight' }],
        processingTime: 300,
        results: [
            { item: "create:experience_nugget", count: 1, chance: 0.3 }
        ]
    });
    event.custom({
        type: "create:crushing",
        ingredients: [{ tag: 'forge:gems/jade' }],
        processingTime: 300,
        results: [
            { item: "create:experience_nugget", count: 1, chance: 0.3 }
        ]
    });
    event.custom({
        type: "create:crushing",
        ingredients: [{ tag: 'forge:gems/bloodstone' }],
        processingTime: 300,
        results: [
            { item: "create:experience_nugget", count: 1, chance: 0.3 }
        ]
    });
    event.custom({
        type: "create:crushing",
        ingredients: [{ tag: 'forge:gems/cryorium' }],
        processingTime: 300,
        results: [
            { item: "create:experience_nugget", count: 1, chance: 0.3 }
        ]
    });
    event.custom({
        type: "create:crushing",
        ingredients: [{ tag: 'forge:gems/ruby' }],
        processingTime: 300,
        results: [
            { item: "create:experience_nugget", count: 1, chance: 0.3 }
        ]
    });
    event.custom({
        type: "create:crushing",
        ingredients: [{ tag: 'forge:gems/aquamarine' }],
        processingTime: 300,
        results: [
            { item: "create:experience_nugget", count: 1, chance: 0.3 }
        ]
    });    event.custom({
        type: "create:crushing",
        ingredients: [{ tag: 'forge:gems/onyx' }],
        processingTime: 300,
        results: [
            { item: "create:experience_nugget", count: 1, chance: 0.3 }
        ]
    });
    event.custom({
        type: 'create:crushing',
        ingredients: [{ item: 'quark:charcoal_block' }],
        processingTime: 900,
        results: [
            { item: 'createchromaticreturn:carbon_powder', count: 9, chance: 0.25  },
            { item: 'quark:charcoal_block', chance: 0.25 }
        ]
    });
});