onEvent('server.datapack.high_priority', (event) => {
    let loot_table = {
        type: 'minecraft:chest',
        pools: [
            {
                rolls: {
                    min: 1.0,
                    max: 2.0,
                    type: 'minecraft:uniform'
                },
                entries: [
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        name: 'minecraft:saddle'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 8,
                        name: 'minecraft:golden_horse_armor'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'minecraft:iron_horse_armor'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 3,
                        name: 'minecraft:diamond_horse_armor'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'minecraft:golden_sword'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'minecraft:golden_chestplate'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'eidolon:pewter_inlay'
                    }
                ]
            },
            {
                rolls: {
                    min: 2.0,
                    max: 4.0,
                    type: 'minecraft:uniform'
                },
                entries: [
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 3.0,
                                    max: 6.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'emendatusenigmatica:cast_iron_nugget'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 3.0,
                                    max: 6.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'emendatusenigmatica:cobalt_nugget'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 15,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 4.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:gold_ingot'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 3.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:diamond'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 3.0,
                                    max: 7.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:nether_wart'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 2.0,
                                    max: 6.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'emendatusenigmatica:sulfur_gem'
                    }
                ]
            },
            {
                rolls: {
                    min: 0.0,
                    max: 1.0,
                    type: 'minecraft:uniform'
                },
                entries: [
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        name: 'eidolon:basic_ring'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        name: 'eidolon:basic_amulet'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:plastic_drinking_hat'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:novelty_drinking_hat'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:night_vision_goggles'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:cross_necklace'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:pocket_piston'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:running_shoes'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'darkutils:charm_portal'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'darkutils:charm_experience'
                    }
                ]
            }
        ]
    };

    event.addJson('minecraft:loot_tables/chests/nether_bridge.json', loot_table);
});

