ServerEvents.recipes(event => {
    // 1. Bulk Removal of No Tree Punching Tool-Gated Recipes
    const recipesToRemove = [
        'notreepunching:sticks_from_logs_with_saw',
        'notreepunching:sticks_from_logs_with_flint_axe',
        'notreepunching:sticks_from_planks_with_saw',
        'notreepunching:sticks_from_planks_with_flint_axe',
        'notreepunching:clay_brick_from_blocks',
        'notreepunching:clay_brick_from_balls',
        'notreepunching:leather_from_boots_with_knife',
        'notreepunching:leather_from_chestplate_with_knife',
        'notreepunching:leather_from_helmet_with_knife',
        'notreepunching:leather_from_leggings_with_knife',
        'notreepunching:melon_slices_with_knife',
        // Plant Fiber & String Knife-Gate Removal
        'notreepunching:plant_fiber_from_wheat_with_knife',
        'notreepunching:plant_fiber_from_cactus_with_knife',
        'notreepunching:plant_fiber_from_leaves_with_knife',
        'notreepunching:plant_fiber_from_saplings_with_knife',
        'notreepunching:plant_fiber_from_small_flowers_with_knife',
        'notreepunching:plant_fiber_from_sugarcane_with_knife',
        'notreepunching:plant_fiber_from_tall_flowers_with_knife',
        'notreepunching:plant_fiber_from_vines_with_knife',
        'notreepunching:string_from_web_with_knife',
        'notreepunching:string_from_wool_with_knife'
    ];
    
    recipesToRemove.forEach(id => {
        event.remove({ id: id });
    });

    // 2. Restore Stick & Wood Progression
    event.shaped('4x minecraft:stick', ['P', 'P'], { P: '#minecraft:planks' });

    // 3. Restore Clay Brick Crafting
    event.shapeless('4x notreepunching:clay_brick', ['minecraft:clay']);
    event.shapeless('notreepunching:clay_brick', ['minecraft:clay_ball']);

    // 4. Restore Plant Fiber & String (No Knife Required)
    event.shapeless('2x notreepunching:plant_fiber', ['minecraft:wheat']);
    event.shapeless('3x notreepunching:plant_fiber', ['minecraft:cactus']);
    event.shapeless('notreepunching:plant_fiber', ['#minecraft:leaves']);
    event.shapeless('2x notreepunching:plant_fiber', ['#minecraft:saplings']);
    event.shapeless('notreepunching:plant_fiber', ['#minecraft:small_flowers']);
    event.shapeless('3x notreepunching:plant_fiber', ['minecraft:sugar_cane']);
    event.shapeless('2x notreepunching:plant_fiber', ['#minecraft:tall_flowers']);
    event.shapeless('5x notreepunching:plant_fiber', ['minecraft:vine']);
    event.shapeless('8x minecraft:string', ['minecraft:cobweb']);
    event.shapeless('4x minecraft:string', ['#minecraft:wool']);

    // 5. Restore the Vanilla Campfire
    event.shaped('minecraft:campfire', [' S ', 'SCS', 'LLL'], { S: 'minecraft:stick', C: '#minecraft:coals', L: '#minecraft:logs_that_burn' });

    // 6. Restore the Vanilla Soul Campfire
    event.shaped('minecraft:soul_campfire', [' S ', 'SCS', 'LLL'], { S: 'minecraft:stick', C: 'minecraft:soul_sand', L: '#minecraft:logs_that_burn' });

    // 7. Restore Stone Tools & Sword
    const stoneMaterials = '#minecraft:stone_tool_materials';
    event.shaped('minecraft:stone_sword', [' M ', ' M ', ' S '], { M: stoneMaterials, S: 'minecraft:stick' });
    event.shaped('minecraft:stone_pickaxe', ['MMM', ' S ', ' S '], { M: stoneMaterials, S: 'minecraft:stick' });
    event.shaped('minecraft:stone_axe', ['MM ', 'MS ', ' S '], { M: stoneMaterials, S: 'minecraft:stick' });
    event.shaped('minecraft:stone_shovel', [' M ', ' S ', ' S '], { M: stoneMaterials, S: 'minecraft:stick' });
    event.shaped('minecraft:stone_hoe', ['MM ', ' S ', ' S '], { M: stoneMaterials, S: 'minecraft:stick' });
});