LootJS.modifiers((event) => {
    // Add Sea Coins to ore blocks
    event.addBlockLootModifier('minecraft:iron_ore').pool(p => {
            p.not(n => n.matchMainHand(ItemFilter.hasEnchantment('minecraft:silk_touch')));
            p.randomChance(0.20).addLoot('society:iron_sea_coin');
        });
    event.addBlockLootModifier('minecraft:deepslate_iron_ore').pool(p => {
        p.not(n => n.matchMainHand(ItemFilter.hasEnchantment('minecraft:silk_touch')));
        p.randomChance(0.20).addLoot('society:iron_sea_coin');
    });
    event.addBlockLootModifier('minecraft:gold_ore').pool(p => {
        p.not(n => n.matchMainHand(ItemFilter.hasEnchantment('minecraft:silk_touch')));
        p.randomChance(0.1).addLoot('society:gold_sea_coin');
    });
    event.addBlockLootModifier('minecraft:deepslate_gold_ore').pool(p => {
        p.not(n => n.matchMainHand(ItemFilter.hasEnchantment('minecraft:silk_touch')));
        p.randomChance(0.1).addLoot('society:gold_sea_coin');
    });

    // Chest Loot tables
    event.addLootTableModifier('minecraft:chests/simple_dungeon').randomChance(0.3).addLoot("society:iron_sea_coin").limitCount([1, 4], [5, 9]);
    
    event.addLootTableModifier('minecraft:chests/abandoned_mineshaft').randomChance(0.2).addLoot("society:iron_sea_coin").limitCount([1, 4], [5, 9]);
   
    event.addLootTableModifier('minecraft:chests/buried_treasure').randomChance(0.9).addLoot("society:gold_sea_coin").limitCount([1, 4], [5, 9]);
    event.addLootTableModifier('minecraft:chests/buried_treasure').randomChance(1).addLoot("society:neptunium_sea_coin").limitCount([1, 2]);

    event.addLootTableModifier('minecraft:chests/underwater_ruin_small').randomChance(0.5).addLoot("society:iron_sea_coin").limitCount([1, 4], [5, 9]);
    event.addLootTableModifier('minecraft:chests/underwater_ruin_small').randomChance(0.2).addLoot("society:gold_sea_coin").limitCount([1, 2]);
    event.addLootTableModifier('minecraft:chests/underwater_ruin_big').randomChance(0.6).addLoot("society:iron_sea_coin").limitCount([1, 4], [5, 9]);
    event.addLootTableModifier('minecraft:chests/underwater_ruin_big').randomChance(0.3).addLoot("society:gold_sea_coin").limitCount([1, 2]);

    event.addLootTableModifier('minecraft:chests/shipwreck_supply').randomChance(0.5).addLoot("society:iron_sea_coin").limitCount([1, 4], [5, 9]);
    event.addLootTableModifier('minecraft:chests/shipwreck_supply').randomChance(0.1).addLoot("society:gold_sea_coin").limitCount([1, 2]);
    event.addLootTableModifier('minecraft:chests/shipwreck_treasure').randomChance(0.9).addLoot("society:iron_sea_coin").limitCount([1, 4], [5, 9]);
    event.addLootTableModifier('minecraft:chests/shipwreck_treasure').randomChance(0.4).addLoot("society:gold_sea_coin").limitCount([1, 2]);
    
    event.addLootTableModifier('minecraft:chests/woodland_mansion').randomChance(0.2).addLoot("society:gold_sea_coin").limitCount([1, 2]);

    event.addLootTableModifier('minecraft:chests/jungle_temple').randomChance(0.3).addLoot("society:iron_sea_coin").limitCount([1, 4], [5, 9]);
    event.addLootTableModifier('minecraft:chests/jungle_temple').randomChance(0.1).addLoot("society:gold_sea_coin").limitCount([1, 2]);

    event.addLootTableModifier('minecraft:chests/desert_pyramid').randomChance(0.3).addLoot("society:iron_sea_coin").limitCount([1, 4], [5, 9]);
    event.addLootTableModifier('minecraft:chests/desert_pyramid').randomChance(0.1).addLoot("society:gold_sea_coin").limitCount([1, 2]);

    event.addLootTableModifier('minecraft:chests/pillager_outpost').randomChance(0.3).addLoot("society:gold_sea_coin").limitCount([1, 4], [5, 9]);

    event.addLootTableModifier('minecraft:chests/ancient_city').randomChance(0.6).addLoot("society:gold_sea_coin").limitCount([1, 4], [5, 9]);
    event.addLootTableModifier('minecraft:chests/ancient_city').randomChance(0.3).addLoot("society:neptunium_sea_coin").limitCount([1, 2]);

    event.addLootTableModifier('minecraft:chests/ruined_portal').randomChance(0.7).addLoot("society:gold_sea_coin").limitCount([1, 2]);

    event.addLootTableModifier('minecraft:chests/nether_bridge').randomChance(0.3).addLoot("society:gold_sea_coin").limitCount([1, 4], [5, 9]);

    event.addLootTableModifier('minecraft:chests/bastion_bridge').randomChance(0.9).addLoot("society:gold_sea_coin").limitCount([1, 4], [5, 9]);
    event.addLootTableModifier('minecraft:chests/bastion_hoglin_stable').randomChance(0.3).addLoot("society:gold_sea_coin").limitCount([1, 4], [5, 9]);
    event.addLootTableModifier('minecraft:chests/bastion_other').randomChance(0.5).addLoot("society:gold_sea_coin").limitCount([1, 4], [5, 9]);
    event.addLootTableModifier('minecraft:chests/bastion_treasure').randomChance(0.6).addLoot("society:gold_sea_coin").limitCount([1, 4], [5, 9]);


    event.addLootTableModifier('minecraft:chests/stronghold_corridor').randomChance(0.9).addLoot("society:iron_sea_coin").limitCount([1, 4], [5, 9]);
    event.addLootTableModifier('minecraft:chests/stronghold_corridor').randomChance(0.4).addLoot("society:gold_sea_coin").limitCount([1, 2]);
    event.addLootTableModifier('minecraft:chests/stronghold_crossing').randomChance(0.9).addLoot("society:iron_sea_coin").limitCount([1, 4], [5, 9]);
    event.addLootTableModifier('minecraft:chests/stronghold_crossing').randomChance(0.4).addLoot("society:gold_sea_coin").limitCount([1, 2]);

    event.addLootTableModifier('minecraft:chests/end_city_treasure').randomChance(0.7).addLoot("society:gold_sea_coin").limitCount([1, 4], [5, 9]);
    event.addLootTableModifier('minecraft:chests/end_city_treasure').randomChance(0.4).addLoot("society:neptunium_sea_coin").limitCount([1, 1]);

});
