onEvent('server.datapack.high_priority', (event) => {
    let loot_table = {
        type: 'minecraft:chest',
        pools: [
            {
                rolls: {
                    min: 2.0,
                    max: 4.0,
                    type: 'minecraft:uniform'
                },
                entries: [
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        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: 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,
                        name: 'quark:blank_rune'
                    },
                    {
                        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: 15,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 6.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:iron_ingot'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 15,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 6.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:gold_ingot'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 15,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 4.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'emendatusenigmatica:nickel_ingot'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 15,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 4.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'emendatusenigmatica:zinc_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: 1.0,
                                    max: 3.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:emerald'
                    },
                    {
                        type: 'minecraft:empty',
                        weight: 15
                    }
                ]
            },
            {
                rolls: 4,
                entries: [
                    {
                        type: 'minecraft:item',
                        weight: 15,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 8.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:bone'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 15,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 8.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:gunpowder'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 15,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 8.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:rotten_flesh'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 15,
                        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: 8.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:spider_eye'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 25,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 16.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:sand'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 4.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'alexsmobs:tarantula_hawk_wing_fragment'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'alexsmobs:emu_feather'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'alexsmobs:guster_eye'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'eidolon:zombie_heart'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'eidolon:wraith_heart'
                    }
                ]
            },
            {
                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:umbrella'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:night_vision_goggles'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:scarf_of_invisibility'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:shock_pendant'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:flame_pendant'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:thorn_pendant'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:universal_attractor'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:vampiric_glove'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:whoopee_cushion'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'darkutils:charm_sleep'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'darkutils:charm_gluttony'
                    }
                ]
            }
        ]
    };

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

