//REMOVED ITEMS
global.removedItems = [
    "minecraft:torch",
    "tacz:attachment",
    "tacz:target_minecart",
    "tacz:statue",
    "tacz:target",
    "tacz:ammo_workbench",
    "tacz:attachment_workbench",
    "tacz:gun_smith_table",
    "decorative_blocks:brazier",
    "decorative_blocks:chandelier",
    "decorative_blocks:soul_brazier",
    "decorative_blocks:soul_chandelier",
    "snowyspirit:candy_cane",
    "snowyspirit:candy_cane_block",
    "snowyspirit:gingerbread_cookie",
    "snowyspirit:music_disc_winter",
    "snowpig:music_disc_frosty_snig",
    "hamster:attachments/loading_pipe",
    "hamster:gun/mosin91",
    "hamster:attachments/sks_bayonet",
    "hamster:gun/martinihenry",
    "hamster:gun/lugerp08",
    "hamster:gun/coltm1892pair",
    "hamster:gun/nagantm1895",
    "hamster:gun/gew98",
    "hamster:gun/flaregun",
    "hamster:attachments/aperture_sight",
    "hamster:gun/one_barrel",
    "hamster:attachments/puscope",
    "hamster:gun/mg1417",
    "hamster:gun/nagantcarbine",
    "hamster:attachments/trench_mag",
    "hamster:gun/makarov",
    "hamster:gun/m1903",
    "hamster:gun/krag",
    "hamster:gun/sw_mk2",
    "hamster:gun/luger1906",
    "hamster:gun/smle_mk3",
    "hamster:gun/m1879revolver",
    "hamster:attachments/m9130_bayonet",
    "hamster:gun/win1873",
    "hamster:gun/auto5",
    "hamster:attachments/speedloader",
    "hamster:attachments/deadeye_scope",
    "hamster:attachments/unertl_scope",
    "hamster:gun/berthier",
    "hamster:ammo/flares_ammo",
    "hamster:gun/webley",
    "hamster:gun/madsen",
    "hamster:gun/mosin9130",
    "hamster:ammo/12g",
    "hamster:gun/coltm1851",
    "hamster:gun/sharps",
    "hamster:ammo/long_ammo",
    "hamster:gun/lebel1886",
    "hamster:attachments/whip",
    "hamster:gun/type99",
    "hamster:gun/m1garand",
    "hamster:gun/gras1874",
    "hamster:gun/mp18",
    "hamster:ammo/compact_ammo",
    "hamster:gun/coltm1892",
    "hamster:gun/sks",
    "hamster:gun/m1887",
    "hamster:gun/colt1873",
    "tacz:gun/timeless50",
    "tacz:gun/deagle",
    "tacz:gun/m249",
    "tacz:gun/minigun",
    "tacz:gun/rpk",
    "tacz:gun/m1911",
    "tacz:gun/uzi",
    "tacz:gun/m320",
    "tacz:gun/rpg7",
    "tacz:gun/ump45",
    "tacz:gun/hk_mp5a5",
    "tacz:gun/vector",
    "tacz:gun/p90",
    "tacz:gun/glock_17",
    "tacz:gun/cz75",
    "tacz:gun/p320",
    "tacz:gun/b93r",
    "tacz:gun/db_short",
    "tacz:gun/db_long",
    "tacz:gun/m870",
    "tacz:gun/aa12",
    "tacz:gun/m700",
    "tacz:gun/m107",
    "tacz:gun/springfield1873",
    "tacz:gun/m95",
    "tacz:gun/ai_awp",
    "tacz:gun/sks_tactical",
    "tacz:gun/ak47",
    "tacz:gun/type_81",
    "tacz:gun/qbz_95",
    "tacz:gun/hk416d",
    "tacz:gun/m4a1",
    "tacz:gun/m16a1",
    "tacz:gun/hk_g3",
    "tacz:gun/m16a4",
    "tacz:gun/spr15hb",
    "tacz:gun/mk14",
    "tacz:gun/scar_l",
    "tacz:gun/scar_h",
    "tacz:gun/aug",
    "tacz:gun/g36k",
    "tacz:ammo/68x51fury",
    "tacz:ammo/9mm",
    "tacz:ammo/338",
    "tacz:ammo/308",
    "tacz:ammo/357mag",
    "tacz:ammo/46x30",
    "tacz:ammo/57x28",
    "tacz:ammo/45acp",
    "tacz:ammo/50bmg",
    "tacz:ammo/40mm",
    "tacz:ammo/12g",
    "tacz:ammo/30_06",
    "tacz:ammo/50ae",
    "tacz:ammo/45_70",
    "tacz:ammo/rpg_rocket",
    "tacz:ammo/762x25",
    "tacz:ammo/556x45",
    "tacz:ammo/58x42",
    "tacz:ammo/762x39",
    "tacz:attachments/sight_fastfire_pistol",
    "tacz:attachments/sight_acro_pistol",
    "tacz:attachments/sight_deltapoint_pistol",
    "tacz:attachments/sight_sro_dot",
    "tacz:attachments/sight_srs_02",
    "tacz:attachments/sight_pk60_pistol",
    "tacz:attachments/sight_rmr_dot",
    "tacz:attachments/sight_pk6_rifle",
    "tacz:attachments/sight_deltapoint_rifle",
    "tacz:attachments/sight_552",
    "tacz:attachments/sight_t1",
    "tacz:attachments/sight_t2",
    "tacz:attachments/sight_okp7",
    "tacz:attachments/sight_acro_rifle",
    "tacz:attachments/sight_fastfire_rifle",
    "tacz:attachments/scope_hamr",
    "tacz:attachments/sight_exp3",
    "tacz:attachments/sight_uh1",
    "tacz:attachments/sight_coyote",
    "tacz:attachments/scope_acog_ta31",
    "tacz:attachments/scope_lpvo_1_6",
    "tacz:attachments/scope_eclan_4x",
    "tacz:attachments/scope_mk6hd",
    "tacz:attachments/scope_vudu",
    "tacz:attachments/scope_standard_8x",
    "tacz:attachments/scope_retro_2x",
    "tacz:attachments/scope_contender",
    "tacz:attachments/scope_1873_6x",
    "tacz:attachments/muzzle_silencer_phantom_s1",
    "tacz:attachments/muzzle_silencer_ptilopsis",
    "tacz:attachments/bayonet_m9",
    "tacz:attachments/muzzle_brake_cthulhu",
    "tacz:attachments/muzzle_brake_timeless50",
    "tacz:attachments/muzzle_brake_pioneer",
    "tacz:attachments/muzzle_brake_cyclone_d2",
    "tacz:attachments/muzzle_brake_trex",
    "tacz:attachments/muzzle_silencer_mirage",
    "tacz:attachments/bayonet_6h3",
    "tacz:attachments/muzzle_compensator_trident",
    "tacz:attachments/muzzle_silencer_vulture",
    "tacz:attachments/muzzle_silencer_knight_qd",
    "tacz:attachments/deagle_golden_long_barrel",
    "tacz:attachments/muzzle_silencer_ursus",
    "tacz:attachments/oem_stock_tactical",
    "tacz:attachments/oem_stock_light",
    "tacz:attachments/oem_stock_heavy",
    "tacz:attachments/stock_ak12",
    "tacz:attachments/stock_carbon_bone_c5",
    "tacz:attachments/stock_moe",
    "tacz:attachments/stock_sba3",
    "tacz:attachments/stock_tactical_ar",
    "tacz:attachments/stock_hk_slim_line",
    "tacz:attachments/stock_militech_b6",
    "tacz:attachments/stock_m4ss",
    "tacz:attachments/stock_ripstock",
    "tacz:attachments/laser_nightstick",
    "tacz:attachments/laser_compact",
    "tacz:attachments/laser_lopro",
    "tacz:attachments/grip_cobra",
    "tacz:attachments/grip_rk6",
    "tacz:attachments/grip_magpul_afg_2",
    "tacz:attachments/grip_rk0",
    "tacz:attachments/grip_osovets_black",
    "tacz:attachments/grip_vertical_talon",
    "tacz:attachments/grip_vertical_military",
    "tacz:attachments/grip_vertical_ranger",
    "tacz:attachments/grip_rk1_b25u",
    "tacz:attachments/grip_se_5",
    "tacz:attachments/grip_td",
    "tacz:attachments/extended_mag_3",
    "tacz:attachments/extended_mag_2",
    "tacz:attachments/extended_mag_1",
    "tacz:attachments/light_extended_mag_3",
    "tacz:attachments/light_extended_mag_2",
    "tacz:attachments/light_extended_mag_1",
    "tacz:attachments/sniper_extended_mag_3",
    "tacz:attachments/sniper_extended_mag_2",
    "tacz:attachments/sniper_extended_mag_1",
    "tacz:attachments/ammo_mod_i",
    "tacz:attachments/ammo_mod_hp",
    "tacz:attachments/ammo_mod_he",
    "tacz:attachments/ammo_mod_fmj"
]

PlayerEvents.inventoryChanged(event => {
    global.removedItems.forEach(removedItem => {
        event.player.inventory.clear( removedItem )
    })
});

//LOOT REMOVALS
LootJS.modifiers(event => {
    global.removedItems.forEach(removedItem => {
        event.addLootTableModifier(/.*/).removeLoot( removedItem )
    })
});

//ITEM REMOVALS: Recipe Removal
ServerEvents.recipes(event => {
    global.removedItems.forEach(removedItem => {
        event.remove({ id: removedItem })
    })
});

//ITEM REMOVALS: Disable item pick up
/*ItemEvents.canPickUp('item', event => {
    global.removedItems.forEach(removedItem => {
        event.cancel( removedItem )
    })
});*/

//ITEM REMOVALS: Hidden in JEI
ServerEvents.tags('item', event => {
    global.removedItems.forEach(removedItem => {
        event.add('c:hidden_from_recipe_viewers', removedItem)
    })
});

//SIMPLE RECIPE REMOVALS
ServerEvents.recipes(event => {
    event.remove({ id: 'minecraft:campfire' })
    event.remove({ id: 'better_campfires:new_campfire_recipe' })
    event.remove({ id: 'better_campfires:new_soul_campfire_recipe' })
    event.remove({ id: 'decorative_blocks:torch_from_chandelier' })
    event.remove({ id: 'realistictorches:matchbox' })
    event.remove({ id: 'cold_sweat:thermometer' })
    event.remove({ id: 'cold_sweat:hearth' })
    event.remove({ id: 'minecraft:flint_and_steel' })
    event.remove({ id: 'tacz:iron_ammo_box' })
    event.remove({ id: 'tacz:gold_ammo_box' })
    event.remove({ id: 'tacz:diamond_ammo_box' })
    event.remove({ id: 'cold_sweat:goat_fur_boots' })
    event.remove({ id: 'cold_sweat:goat_fur_pants' })
    event.remove({ id: 'cold_sweat:goat_fur_parka' })
    event.remove({ id: 'cold_sweat:goat_fur_cap' })
    event.remove({ id: 'cold_sweat:minecart_insulation_goat' })

});

//ICE RESISTANCE ON RESPAWN
PlayerEvents.respawned(event => {
    let { player } = event;
    player.potionEffects.add("cold_sweat:grace", 2400, 0, false, true)
});

//ICE RESISTANCE ON LOGIN
PlayerEvents.loggedIn(event => {
  let { player } = event;
    player.potionEffects.add("cold_sweat:grace", 2400, 0, false, true)
})
