LootJS.modifiers((event) => {

const removeTargets = event.addTableModifier([
    "minecraft:chests/ancient_city",
    "minecraft:chests/simple_dungeon",
    "minecraft:chests/stronghold_library",
    "minecraft:chests/stronghold_corridor",
    "minecraft:chests/desert_pyramid",
    "minecraft:chests/jungle_temple",
    "minecraft:chests/abandoned_mineshaft",
    "minecraft:chests/buried_treasure",
    "minecraft:chests/shipwreck_treasure",
    "minecraft:chests/ruined_portal"
]);

removeTargets.removeLoot(/superbwarfare:.*_ammo_box/);
removeTargets.removeLoot(/superbwarfare:.*_blueprint/);

    // 1. REGULAR AMMO (15% Chance, 5-15 count)
    const regularAmmo = [
        "pointblank:ammo9mm", "superbwarfare:sniper_ammo", "superbwarfare:rifle_ammo", "superbwarfare:heavy_ammo", "pointblank:ammo45acp", "pointblank:ammo46", 
        "pointblank:ammo357", "pointblank:ammo57", "pointblank:ammo545", 
        "pointblank:ammo556", "pointblank:ammo68", "pointblank:ammo762", 
        "pointblank:ammo762x51", "pointblank:ammo12gauge", "superbwarfare:handgun_ammo", "superbwarfare:shotgun_ammo"
    ];

    // 2. HEAVY AMMO (8% Chance, 1-5 count)
    const heavyAmmo = [
        "pointblank:ammo50ae", "pointblank:ammo338lapua", 
        "pointblank:ammo50bmg", "pointblank:ammolasercharge", "superbwarfare:small_shell"
    ];

    // 3. EXPLOSIVES (5% Chance, 1-2 count)
    const explosives = [
        "pointblank:grenade", "pointblank:grenade40mm", "mts:mtsofficialpack.explosives", "pointblank:grenade20mm", 
        "pointblank:smaw_rocket", "pointblank:at4_rocket", "superbwarfare:grenade_40mm", "pointblank:m1helmet", "pointblank:stahlhelm", "superbwarfare:tm_62", "superbwarfare:claymore_mine", "superbwarfare:m18_smoke_grenade",    "superbwarfare:taser_electrode",  "superbwarfare:c4_bomb", "superbwarfare:mortar_shell", "superbwarfare:medium_aerial_bomb", "pointblank:us_army_dress", "superbwarfare:ge_helmet_m_35", "superbwarfare:rgo_grenade", "superbwarfare:hand_grenade", "superbwarfare:ptkm_1r",  "superbwarfare:javelin_missile", "superbwarfare:large_anti_ground_missile", "superbwarfare:he_5_inches", "superbwarfare:ap_5_inches", "superbwarfare:cm_5_inches", "superbwarfare:gs_5_inches",  "mts:mtsofficialpack.bulletflare_red"
    ];

    // 4. THE GUNS (30%)
    const allGuns = [
       "superbwarfare:hunting_rifle", "superbwarfare:mp_5", "superbwarfare:vector", "pointblank:m1911a1", "pointblank:tti_viper", "pointblank:p30l", "pointblank:mk23", 
        "pointblank:glock17", "pointblank:glock18", "superbwarfare:rpk",  "superbwarfare:sks", "superbwarfare:glock_18", "superbwarfare:mp_443", "superbwarfare:m_1911", "superbwarfare:homemade_shotgun", "pointblank:m9", "pointblank:deserteagle", 
        "pointblank:rhino", "superbwarfare:ak_47", "superbwarfare:trachelium", "superbwarfare:hk_416", "pointblank:m4a1", "pointblank:m4a1mod1", "pointblank:ar57", 
        "pointblank:ro635", "pointblank:star15", "pointblank:m4sopmodii", "pointblank:m16a1", 
        "pointblank:hk416", "pointblank:scarl", "pointblank:xm7", "pointblank:xm29", "pointblank:g36c", "pointblank:g36k", "pointblank:sl8", "pointblank:mk14ebr", 
        "pointblank:uar10", "pointblank:ak47", "pointblank:ak74", "pointblank:ak12", 
        "pointblank:an94", "pointblank:aug", "superbwarfare:qbz_191", "superbwarfare:mk_14", "superbwarfare:svd", "pointblank:aughbar", "pointblank:mp5", 
        "pointblank:mp7", "pointblank:ump45", "pointblank:p90", 
        "pointblank:tmp", "pointblank:m950", "pointblank:g41", "pointblank:g3", 
        "pointblank:wa2000", "pointblank:xm3", "pointblank:c14", "pointblank:l96a1", 
        "pointblank:ballista", "pointblank:gm6lynx", "pointblank:m590", "pointblank:m870", 
        "pointblank:spas12", "pointblank:m1014", "pointblank:aa12", "pointblank:citoricxs", 
        "pointblank:hs12", "pointblank:lamg", "pointblank:mk48", "pointblank:m249", 
        "pointblank:m32mgl", "pointblank:smaw", "superbwarfare:rpg", "pointblank:at4", "mts:mtsofficialpack.gunflaregun", "superbwarfare:m_79", "superbwarfare:mosin_nagant",  "pointblank:ksg12", "superbwarfare:taser", "superbwarfare:javelin", "superbwarfare:bocek", "superbwarfare:marlin", "superbwarfare:k_98"           ];

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

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



