onEvent('server.datapack.high_priority', (event) => {
    let loot_table = {
        type: 'minecraft:chest',
        pools: [
            {
                rolls: {
                    min: 1.0,
                    max: 3.0,
                    type: 'minecraft:uniform'
                },
                entries: [
                    {
                        type: 'minecraft:item',
                        weight: 20,
                        name: 'minecraft:saddle'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        name: 'minecraft:golden_apple'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        name: 'minecraft:golden_carrot'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 2,
                        name: 'minecraft:enchanted_golden_apple'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 15,
                        name: 'minecraft:music_disc_13'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 15,
                        name: 'minecraft:music_disc_cat'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        name: 'minecraft:name_tag'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        name: 'minecraft:bucket'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        name: 'minecraft:golden_horse_armor'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 15,
                        name: 'minecraft:iron_horse_armor'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'minecraft:diamond_horse_armor'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        functions: [
                            {
                                function: 'minecraft:enchant_with_levels',
                                levels: {
                                    min: 10.0,
                                    max: 30.0
                                }
                            }
                        ],
                        name: 'minecraft:book'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        name: 'minecraft:bread'
                    }
                ]
            },
            {
                rolls: {
                    min: 1.0,
                    max: 4.0,
                    type: 'minecraft:uniform'
                },
                entries: [
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 4.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:iron_ingot'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        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: 4.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'emendatusenigmatica:copper_ingot'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 4.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'emendatusenigmatica:tin_ingot'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 4.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:redstone'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 4.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:coal'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 4.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'emendatusenigmatica:apatite_gem'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 4.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'emendatusenigmatica:potassium_nitrate_gem'
                    }
                ]
            },
            {
                rolls: {
                    min: 1.0,
                    max: 2.0,
                    type: 'minecraft:uniform'
                },
                entries: [
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 4.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:pumpkin_seeds'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 4.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:melon_seeds'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 4.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:beetroot_seeds'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 4.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'farmersdelight:cabbage_seeds'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 4.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'farmersdelight:tomato_seeds'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 4.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:wheat'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 4.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'farmersdelight:rice_panicle'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 4.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'supplementaries:flax'
                    }
                ]
            },
            {
                rolls: 3,
                entries: [
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 8.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:bone'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 8.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:gunpowder'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 8.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:rotten_flesh'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 8.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:string'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 4.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'alexsmobs:maggot'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 4.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'alexsmobs:cockroach_wing_fragment'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'alexsmobs:centipede_leg'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'alexsmobs:crocodile_scute'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'eidolon:zombie_heart'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'eidolon:wraith_heart'
                    },
                    {
                        type: 'minecraft:item',
                        name: 'quark:diamond_heart'
                    }
                ]
            }
        ]
    };

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

