ServerEvents.recipes(event => {
    // Usuwanie starych przepisów
    [
        'cure:weak_antidote_recipe',
        'cure:super_antidote_recipe',
        'cure:antidote_small_recipe',
        'cure:cure_recipe',
        'cure:cure_recipe_large'
    ].forEach(recipe => event.remove({id: recipe}));


    event.shaped('cure:antidote', ['ABC', 'DED', 'FGH'], {
        A: 'butcher:sulfuricacid',
        B: Item.of('minecraft:potion', '{Potion:"butcher:infectedbloodpotion"}').weakNBT(),
        C: 'butcher:oil',
        D: 'farmersdelight:milk_bottle',
        E: 'cure:shot',
        F: 'minecraft:slime_ball',
        G: 'legendarysurvivaloverhaul:tonic',
        H: 'farmersdelight:apple_cider'
    }).id('kubejs:custom_antidote_recipe')

    // Przepis na fragment serca
    event.shaped('legendarysurvivaloverhaul:heart_fragment', [
        'VGV',
        'GHG',
        'VGV'
    ], {
        V: 'bioforge:viral_suppressor',
        G: 'minecraft:golden_apple',
        H: 'butcher:heart'
    });


    // Alternatywny proch strzelniczy
    event.shaped('3x minecraft:gunpowder', [
        ' C ',
        ' B ',
        ' S '
    ], {
        C: 'minecraft:charcoal',
        B: 'minecraft:bone_meal',
        S: ['bioforge:sulfur', 'butcher:sulfur'] // Wybór między dwoma przedmiotami
    });


    // Wełna na sznurek
    event.shapeless('2x minecraft:string', ['#minecraft:wool'])


    event.shaped('minecraft:leather', [
        'RR',
        'RR'
    ], {
        R: 'minecraft:rotten_flesh'
    }).id('kubejs:rotten_flesh_to_leather');

    
    // 1 butelka z wodą → 1 purified water bottle na ognisku
    event.campfireCooking('legendarysurvivaloverhaul:purified_water_bottle', 'minecraft:potion')
        .xp(0.1)           // opcjonalnie: ile XP za przepalanie
        .cookingTime(600)  // opcjonalnie: czas w tickach (600 = 30 sekund)
        .id('kubejs:purified_water_on_campfire');
        

        event.shaped('minecraft:blaze_powder', [
            'GGG',
            'GPG',
            'GGG'
        ], {
            G: 'minecraft:gold_nugget',
            P: 'minecraft:gunpowder'
        }).id('kubejs:golden_blaze_powder');


        event.shaped('minecraft:blaze_rod', [
            'GGG',
            'GLG',
            'GGG'
        ], {
            G: 'minecraft:gold_nugget',
            L: 'minecraft:lightning_rod'
        }).id('kubejs:golden_blaze_rod');      


        event.custom({
            type: "minecraft:crafting_shapeless",
            ingredients: [
                { item: "butcher:infectedblood_bucket" },
                { item: "minecraft:glass_bottle" }
            ],
            result: {
                item: "minecraft:potion",
                count: 1,
                nbt: "{Potion:'butcher:infectedbloodpotion'}"
            },
            leftovers: [{ item: "minecraft:bucket" }] // Dodaje puste wiaderko do ekwipunku
        }).id('kubejs:infected_blood_potion_advanced');


});