LootJS.modifiers((event) => {

const removeTargets = event.addTableModifier([
    "big_lost_city:chests/tier_1",
    "big_lost_city:chests/tier_2",
    "big_lost_city:chests/tier_3",
    "big_lost_city:chests/tier_4",
    "modern_structure:chests/toolloottable",
    "modern_structure:chests/foodloottable",
    "outpostzero:chests/hub_additional",
    "outpostzero:chests/hub_starter",
    "outpostzero:chests/lab_additional",
    "outpostzero:chests/lab_crate",
    "outpostzero:chests/lab_starter",
    "outpostzero:chests/storage",
    "outpostzero:chests/storage_abandoned",
    "outpostzero:chests/workshop",
    "spore:chests/food_chest",
    "spore:chests/equipment_chest",
    "spore:chests/ice_chest"
]);

removeTargets.removeLoot(/minecraft:diamond/);
removeTargets.removeLoot(/minecraft:gold_nugget/);
removeTargets.removeLoot(/minecraft:iron_nugget/);
removeTargets.removeLoot(/minecraft:chicken/);
removeTargets.removeLoot(/minecraft:arrow/);
removeTargets.removeLoot(/minecraft:leather/);
removeTargets.removeLoot(/minecraft:coal/);
removeTargets.removeLoot(/minecraft:baked_potato/);
removeTargets.removeLoot(/minecraft:emerald/);
removeTargets.removeLoot(/minecraft:gunpowder/);
removeTargets.removeLoot(/minecraft:experience_bottle/);
removeTargets.removeLoot(/minecraft:flint/);
removeTargets.removeLoot(/minecraft:bone/);
removeTargets.removeLoot(/minecraft:spyglass/);
removeTargets.removeLoot(/minecraft:ender_pearl/);
removeTargets.removeLoot(/minecraft:name_tag/);
removeTargets.removeLoot(/modern_structure:steelaxe/);
removeTargets.removeLoot(/modern_structure:bag/);
removeTargets.removeLoot(/outpostzero:steel_ingot/);
removeTargets.removeLoot(/outpostzero:steel_nugget/);
removeTargets.removeLoot(/outpostzero:steel_upgrade_template/);
removeTargets.removeLoot(/minecraft:book/);
removeTargets.removeLoot(/minecraft:lead/);
removeTargets.removeLoot(/minecraft:saddle/);
removeTargets.removeLoot(/minecraft:compass/);
removeTargets.removeLoot(/minecraft:golden_carrot/);
removeTargets.removeLoot(/minecraft:wild_armor_trim_smithing_template/);
removeTargets.removeLoot(/minecraft:clock/);
removeTargets.removeLoot(/minecraft:totem_of_undying/);
removeTargets.removeLoot(/minecraft:enchanted_golden_apple/);
removeTargets.removeLoot(/minecraft:crossbow/); 
removeTargets.removeLoot(/minecraft:golden_apple/);
removeTargets.removeLoot(/minecraft:cooked_chicken/);
removeTargets.removeLoot(/minecraft:cooked_beef/);
removeTargets.removeLoot(/spore:ice_canister/);
removeTargets.removeLoot(/spore:cdu/);
removeTargets.removeLoot(/outpostzero:cricket_bat/);
removeTargets.removeLoot(/minecraft:stone_pickaxe/);
 
    // 1. REGULAR AMMO (15% Chance, 5-15 count)
    const regularAmmo = [ "marbledsfirstaid:bandaid", "marbledsfirstaid:bandaid_box", "trydeas_meleez:food_knife", "modern_structure:knife", "modern_structure:crowbar", "trydeas_meleez:wood_spear", "trydeas_meleez:handsaw", "trydeas_meleez:wrench", "trydeas_meleez:kitchen_fork", "trydeas_meleez:golf_club", "trydeas_meleez:baseball_bat", "trydeas_meleez:tabla", "trydeas_meleez:hammer", "trydeas_meleez:hockey_stick", "trydeas_meleez:tabla_clavos", "trydeas_meleez:stone_spear", "trydeas_meleez:rolling_pin", "trydeas_meleez:metal_pipe", "trydeas_meleez:spike_baseball"
       
    ];

    // 2. HEAVY AMMO (8% Chance, 1-5 count)
    const heavyAmmo = [ "selfexpression:cloth", "marbledsfirstaid:cloth", "selfexpression:sniper_chestplate", "selfexpression:improved_chemical_protection_leggings", "selfexpression:stormtroopers_armor_leggings", "selfexpression:improved_chemical_protection_chestplate", "selfexpression:improved_chemical_protection_helmet", "selfexpression:stormtroopers_armor_boots", "selfexpression:sniper_leggings", "selfexpression:sniper_helmet", "selfexpression:improved_chemical_protection_boots", "selfexpression:stormtroopers_armor_chestplate", "selfexpression:year_jacket_chestplate", "selfexpression:stormtroopers_armor_helmet", "selfexpression:purple_hoodie_helmet", "selfexpression:battle_chestplate", "selfexpression:sir_romawka_leggings", "selfexpression:year_sweater_chestplate", "selfexpression:police_armor_chestplate", "selfexpression:red_soldier_chestplate", "selfexpression:police_2_chestplate", "selfexpression:beach_helmet", "selfexpression:police_2_leggings", "selfexpression:aremeh_helmet", "selfexpression:battle_leggings", "selfexpression:red_shirt_n_helmet", "selfexpression:battle_boots", "selfexpression:sir_romawka_chestplate", "selfexpression:red_soldier_leggings", "selfexpression:police_2_helmet", "selfexpression:police_armor_leggings", "selfexpression:police_armor_boots", "selfexpression:red_soldier_boots", "selfexpression:red_soldier_helmet", "selfexpression:police_2_boots", "selfexpression:battle_helmet", "selfexpression:tactical_chestplate", "selfexpression:red_shirt_n_leggings", "selfexpression:red_shirt_n_boots", "selfexpression:purple_hoodie_leggings", "selfexpression:purple_hoodie_chestplate", "selfexpression:prisoner_leggings", "selfexpression:prisoner_chestplate", "selfexpression:white_t_shirt_chestplate", "selfexpression:coolness_leggings", "selfexpression:coolness_chestplate", "selfexpression:scarecrow_boots", "selfexpression:scarecrow_helmet", "selfexpression:scarecrow_leggings", "selfexpression:scarecrow_chestplate", "selfexpression:soldier_leggings", "selfexpression:soldier_boots", "selfexpression:captain_boots", "selfexpression:chemical_protection_helmet", "selfexpression:chemical_protection_chestplate", "selfexpression:chemical_protection_leggings", "selfexpression:chemical_protection_boots", "selfexpression:armband_chestplate", "selfexpression:soldier_chestplate", "selfexpression:bandage_helmet", "selfexpression:soldier_helmet", "selfexpression:straw_hat_helmet", "selfexpression:simple_boots", "selfexpression:simple_leggings", "selfexpression:simple_chestplate", "selfexpression:light_boots", "selfexpression:light_chestplate", "selfexpression:light_leggings", "selfexpression:tropic_helmet", "selfexpression:hacker_helmet", "selfexpression:official_chestplate", "selfexpression:official_leggings", "selfexpression:courier_boots", "selfexpression:black_t_shirt_chestplate", "selfexpression:base_boots", "selfexpression:redynines_helmet", "selfexpression:base_leggings", "selfexpression:artem_andr_chestplate", "selfexpression:base_chestplate", "selfexpression:redynines_chestplate", "selfexpression:courier_helmet", "selfexpression:bodyarmor_chestplate", "selfexpression:base_helmet", "selfexpression:shooter_chestplate", "selfexpression:shooter_helmet", "selfexpression:artem_andr_leggings", "selfexpression:courier_leggings", "selfexpression:t_shirt_hfs_chestplate", "selfexpression:shooter_boots", "selfexpression:artem_andr_helmet", "selfexpression:redynines_leggings", "selfexpression:shooter_leggings", "selfexpression:artem_andr_boots", "selfexpression:official_boots", "selfexpression:redynines_boots", "selfexpression:tactical_helmet", "selfexpression:scientific_smock_chestplate", "selfexpression:scientific_smock_leggings", "selfexpression:police_chestplate", "selfexpression:thiefs_armor_chestplate", "selfexpression:police_leggings", "selfexpression:snow_soldier_helmet", "selfexpression:snow_soldier_chestplate", "selfexpression:doctor_leggings", "selfexpression:thiefs_armor_leggings", "selfexpression:doctor_chestplate", "selfexpression:doctor_helmet", "selfexpression:winter_chestplate", "selfexpression:taiga_hunter_chestplate", "selfexpression:desert_helmet", "selfexpression:desert_chestplate", "selfexpression:desert_leggings", "selfexpression:balaclava_helmet", "selfexpression:thiefs_armor_boots", "selfexpression:swat_helmet", "selfexpression:builder_helmet", "selfexpression:swat_chestplate", "selfexpression:officer_helmet", "selfexpression:winter_leggings", "selfexpression:officer_chestplate", "selfexpression:black_shirt_chestplate", "selfexpression:officer_leggings", "selfexpression:snow_soldier_leggings", "selfexpression:snow_soldier_boots", "selfexpression:swat_leggings", "selfexpression:notch_boots", "selfexpression:police_boots", "selfexpression:desert_boots", "selfexpression:doctor_boots", "selfexpression:swat_boots", "selfexpression:officer_boots"  
    ];

    // 3. EXPLOSIVES (5% Chance, 1-2 count)
    const explosives = [ "marbledsfirstaid:panacea_pills", "marbledsfirstaid:pain_pills", "modern_structure:bread", "modern_structure:pieceofbread", "trydeas_meleez:short_axe", "trydeas_meleez:knife", "trydeas_meleez:butcher_knife", "trydeas_meleez:wrench_f", "trydeas_meleez:bow_saw", "trydeas_meleez:scythe", "trydeas_meleez:farm_fork", "trydeas_meleez:crowbar", "trydeas_meleez:lumberjack_axe", "trydeas_meleez:macuahuitlb", "marbledsfirstaid:medical_bag", "marbledsfirstaid:stimpack"
   
    ];

    // 4. THE GUNS (30%)
    const allGuns = [ "marbledsfirstaid:medkit", "marbledsfirstaid:first_aid_kit", "trydeas_meleez:steel_bat", "trydeas_meleez:firefighter_axe", "trydeas_meleez:stop_sign", "trydeas_meleez:machete", "trydeas_meleez:saw", "trydeas_meleez:sledge_hammer", "trydeas_meleez:katana", "marbledsfirstaid:bandages", "trydeas_meleez:improvised_halberd", "marbledsfirstaid:curative_pills", "marbledsfirstaid:morphine_syringe", "marbledsfirstaid:adrenaline_syringe"
               ];

    const targets = event.addTableModifier([
        "big_lost_city:chests/tier_1",
        "big_lost_city:chests/tier_2"
    ]);
            // AMMO & EXPLOSIVES: type dih very annoying
    regularAmmo.forEach(id => { targets.addLoot(LootEntry.of(id).limitCount(1, 2).when(c => c.randomChance(0.003))) });
    heavyAmmo.forEach(id => { targets.addLoot(LootEntry.of(id).limitCount(1, 2).when(c => c.randomChance(0.002))) });
    explosives.forEach(id => { targets.addLoot(LootEntry.of(id).limitCount(1, 2).when(c => c.randomChance(0.003))) });

           // GUNS
    allGuns.forEach(id => {
        targets.addLoot(
            LootEntry.of(id)
                .when(c => c.randomChance(0.002 / allGuns.length))
        );
    });
});



