onEvent('generic.loot_tables', (event) => {

    const pools = [
        {
            rolls: { min: 1, max: 2 },
            entries: [
                {
                    item: 'alexsmobs:shark_tooth',
                    count: [1,2],
                    weight: 5
                },
                {
                    item: 'quark:crab_shell',
                    count: [1,2],
                    weight: 5
                },
                {
                    item: Item.of('shrink:mob_bottle', '{entity:"alexsmobs:alligator_snapping_turtle"}'),
                    weight: 5
                },
                {
                    item: 'eidolon:enchanted_ash',
                    count: [2,4],
                    weight: 10
                },
                {
                    item: 'eidolon:fungus_sprouts',
                    count: [1,3],
                    weight: 10
                },
                {
                    item: 'create:diving_helmet',
                    weight: 5
                },
                {
                    item: 'create:diving_boots',
                    weight: 5
                }
            ]
        }
    ];
    
    event.modify('minecraft:chests/underwater_ruin_big', (table) => {
        pools.forEach((pool) => {
            table.addPool((newPool) => {
                newPool.setUniformRolls(pool.rolls.min, pool.rolls.max);
                pool.entries.forEach((entry) => {
                    let count = entry.count ? entry.count : 1,
                        weight = entry.weight ? entry.weight : 1;
    
                    newPool.addItem(entry.item, weight, count);
                });
            });
        });
    });

});


