let b_t1 = ['poke','citrine','verdant','azure','rosate','slate','premier','cherish']
let b_t2 = b_t1.concat(['friend','luxury','heal'])
let b_t3 = b_t2.concat(['great','safari','sport'])
let b_t4 = b_t3.concat(['ultra','lure','love','park'])
let b_t5 = b_t4.concat(['fast','level','heavy','moon','net','dive','nest','repeat','timer','dusk','quick','dream'])
let b_t6 = b_t5.concat(['beast','master'])

let c_t6 = ['end_city_treasure','iglo_chest']
let c_t5 = c_t6.concat(['bastion_treasure','buried_treasure','shipwreck_treasure'])
let c_t4 = c_t5.concat(['basion_bridge','bastion_hoglin_stable','bastion_other','desert_pyramid','jungle_temple','nether_bridge','ruined_portal','underwater_ruin_big'])
let c_t3 = c_t4.concat(['ancient_city','ancient_city_ice_box','stronghold_corridor','stronghold_crossing','stronghold_library','underwater_ruin_small'])
let c_t2 = c_t3.concat(['abandoned_mineshaft','pillager_outpost','woodland_mansion'])
let c_t1 = c_t2.concat(['simple_dungeon','village/village_desert_house','village/village_plains_house','village/village_savanna_house','village/village_snowy_house','village/village_taiga_house','village/village_temple'])

LootJS.modifiers(event =>{

    event.addLootTypeModifier(LootType.CHEST)
    .removeLoot('farmersdelight:rope')

    event.addBlockLootModifier('#forge:sand')
    .anyBiome('minecraft:beach','byg:rainbow_beach')
    .randomChance(0.01)
    .addLoot('cobblemon:soft_sand')

    c_t6.forEach(a=>{
        b_t6.forEach(b=>{
            event.addLootTableModifier('minecraft:chests/'+a)
            .randomChance(0.03)
            .addWeightedLoot([0,1],[Item.of('2x cobblemon:'+b+'_ball').withChance(50),Item.of('cobblemon:master_ball').withChance(25)])
        })
    })
    c_t5.forEach(a=>{
        b_t5.forEach(b=>{
            event.addLootTableModifier('minecraft:chests/'+a)
            .randomChance(0.03)
            .addWeightedLoot([0,1],[Item.of('cobblemon:'+b+'_ball').withChance(50)])
        })
    })
    c_t4.forEach(a=>{
        b_t4.forEach(b=>{
            event.addLootTableModifier('minecraft:chests/'+a)
            .randomChance(0.03)
            .addWeightedLoot([0,1],[Item.of('cobblemon:'+b+'_ball').withChance(25)])
        })
    })
    c_t3.forEach(a=>{
        b_t3.forEach(b=>{
            event.addLootTableModifier('minecraft:chests/'+a)
            .randomChance(0.03)
            .addWeightedLoot([0,1],[Item.of('cobblemon:'+b+'_ball').withChance(25)])
        })
    })
    c_t2.forEach(a=>{
        b_t2.forEach(b=>{
            event.addLootTableModifier('minecraft:chests/'+a)
            .randomChance(0.06)
            .addWeightedLoot([0,1],[Item.of('cobblemon:'+b+'_ball').withChance(25),Item.of('2x cobblemon:'+b+'_ball').withChance(10),Item.of('cobblemon:'+b+'_ball').withChance(5)])
        })
    })
    c_t1.forEach(a=>{
        b_t1.forEach(b=>{
            event.addLootTableModifier('minecraft:chests/'+a)
            .randomChance(0.1)
            .addWeightedLoot([0,1],[Item.of('cobblemon:'+b+'_ball').withChance(25),Item.of('2x cobblemon:'+b+'_ball').withChance(25)])
        })
    })

 //   b_t1.forEach(a=>{
 //   event.addLootTableModifier("minecraft:chests/abandoned_mineshaft")
 //   .randomChance(0.1)
 //   .addWeightedLoot([1,1],[Item.of('cobblemon:'+a+'_ball').withChance(50)])
 //   })
})