LootJS.modifiers(event => {
    event.addLootTableModifier(/^minecraft:chests\/.*/)
        .removeLoot("@endrem");
    event.addLootTableModifier(/^minecraft:chests\/.*/)
        .removeLoot("@touhou_little_maid");
    // Модифицируем сундук endlessbiomes:chests/resistive_bulwark_loot
    event.addLootTableModifier(/^endlessbiomes:chests\/resistive_bulwark_loot/)
        .randomChance(0.5)
        .addLoot('@endersdelight')
        .randomChance(0.2)
        .addLoot('@endersdelight')
        .randomChance(0.2)
        .addLoot('@endersdelight')
        .randomChance(0.2)
        .addLoot('enigmaticlegacy:corrupted_tome')
        .randomChance(0.2)
        .addLoot('enigmaticlegacy:astral_dust')
        .randomChance(0.2)
        .addLoot('enigmaticlegacy:etherium_ore')
        .randomChance(0.2)
        .addLoot('simplyswords:runic_tablet');

    // Массив с названиями сундуков для добавления лута netherdel
    const netherdelLootTables = [
        'minecraft:chests/nether_bridge',
        'idas:chests/ancient_portal/ancient_portal_nether',
        'minecraft:chests/bastion_other',
        'minecraft:chests/ruined_portal',
        'incendium:lab/treasure',
        'incendium:lab/piglin_loot',
        'incendium:lab/rare',
        'incendium:lab/basalt',
        'incendium:reactor/office',
        'incendium:reactor/junk',
        'incendium:reactor/waste',
        'incendium:reactor/treasure'
    ];
    netherdelLootTables.forEach(table => {
        event.addLootTableModifier(new RegExp(`^${table}$`))
            .randomChance(0.5)
            .addLoot('#custom:netherdel')
            .randomChance(0.2)
            .addLoot('#custom:netherdel')
            .randomChance(0.2)
            .addLoot('#custom:netherdel');
    });
    event.addLootTableModifier(/^minecraft:chests\/village\/village_savanna_house/)
        .randomChance(0.5)
        .addLoot('#custom:pineapple')
        .randomChance(0.3)
        .addLoot('#custom:pineapple')
        .randomChance(0.1)
        .addLoot('#custom:pineapple');
    event.addLootTableModifier(/^minecraft:chests\/end_city_treasure/)
        .randomChance(0.5)
        .addLoot('@endersdelight')
        .randomChance(0.2)
        .addLoot('@endersdelight')
        .randomChance(0.2)
        .addLoot('@endersdelight');
    event.addLootTableModifier(/^minecraft:chests\/.*/)
        .randomChance(0.01)
        .addLoot("enicreo:basesword");
    const aquadelLootTables = [
        'minecraft:chests/shipwreck',
        'minecraft:chests/underwater_ruin',
        'minecraft:chests/shipwreck_supply',
        'minecraft:chests/shipwreck_map',
        'betterarcheology:archeology/chest_underwater',
        'aquamirae:chests/frozen_chest',
        'minecraft:chests/underwater_ruin_small',
        'idas:chests/sunken_ship/sunken_ship_supply',
        'idas:chests/sunken_ship/sunken_ship_treasure',
        'betteroceanmonuments:chests/upper_side_chamber',
        'minecraft:chests/underwater_ruin_big',
        'minecraft:chests/shipwreck_treasure',
        'aquamirae:chests/ship_1',
        'aquamirae:chests/ship_2',
        'aquamirae:chests/maze_camp_chest'
    ];

    aquadelLootTables.forEach(table => {
        event.addLootTableModifier(new RegExp(`^${table}$`))
            .randomChance(0.25)
            .addLoot('#custom:aquadel');
    
        event.addLootTableModifier(new RegExp(`^${table}$`))
            .randomChance(0.15)
            .addLoot('#custom:aquadel');
    
        event.addLootTableModifier(new RegExp(`^${table}$`))
            .randomChance(0.05)
            .addLoot('#custom:aquadel');
    });
    const waterlLootTables = [
        'aquamirae:chests/frozen_chest',
        'aquamirae:chests/ship_1',
        'aquamirae:chests/ship_2',
        'aquamirae:chests/maze_camp_chest'
    ];
    
    waterlLootTables.forEach(table => {
        event.addLootTableModifier(new RegExp(`^${table}$`))
            .randomChance(0.02)
            .addLoot('irons_spellbooks:permafrost_shard');
    
        event.addLootTableModifier(new RegExp(`^${table}$`))
            .randomChance(0.01)
            .addLoot('irons_spellbooks:permafrost_shard');
    
        event.addLootTableModifier(new RegExp(`^${table}$`))
            .randomChance(0.005)
            .addLoot('irons_spellbooks:permafrost_shard');
    
        event.addLootTableModifier(new RegExp(`^${table}$`))
            .randomChance(0.05)
            .addLoot('aquamirae:abyssal_amethyst');
    
        event.addLootTableModifier(new RegExp(`^${table}$`))
            .randomChance(0.02)
            .addLoot('aquamirae:abyssal_amethyst');
    
        event.addLootTableModifier(new RegExp(`^${table}$`))
            .randomChance(0.005)
            .addLoot('aquamirae:abyssal_amethyst');
    
        event.addLootTableModifier(new RegExp(`^${table}$`))
            .randomChance(0.15)
            .addLoot('aquamirae:ship_graveyard_echo');
    
        event.addLootTableModifier(new RegExp(`^${table}$`))
            .randomChance(0.02)
            .addLoot('aquamirae:ship_graveyard_echo');
    
        event.addLootTableModifier(new RegExp(`^${table}$`))
            .randomChance(0.005)
            .addLoot('aquamirae:ship_graveyard_echo');
    });
});
