onEvent('server.datapack.high_priority', (event) => {
    let loot_table = {
        type: 'minecraft:chest',
        pools: [
            {
                rolls: 1,
                entries: [
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        name: 'minecraft:golden_apple'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        name: 'minecraft:golden_carrot'
                    },
                    {
                        type: 'minecraft:item',
                        name: 'minecraft:enchanted_golden_apple'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 20,
                        name: 'minecraft:name_tag'
                    },
                    {
                        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: 5,
                        functions: [
                            {
                                function: 'minecraft:enchant_with_levels',
                                levels: {
                                    min: 10.0,
                                    max: 30.0
                                }
                            }
                        ],
                        name: 'minecraft:iron_pickaxe'
                    },
                    {
                        type: 'minecraft:empty',
                        weight: 10
                    }
                ]
            },
            {
                rolls: {
                    min: 1.0,
                    max: 2.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:silver_ingot'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 4.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'emendatusenigmatica:lead_ingot'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 4.0,
                                    max: 9.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:redstone'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 4.0,
                                    max: 9.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:lapis_lazuli'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 3.0,
                                    max: 8.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:coal'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 3,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 2.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:diamond'
                    }
                ]
            },
            {
                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: 15,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 3.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:bread'
                    }
                ]
            },
            {
                rolls: 3,
                entries: [
                    {
                        type: 'minecraft:item',
                        weight: 20,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 4.0,
                                    max: 8.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:rail'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 8.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:powered_rail'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 4.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:detector_rail'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 4.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:activator_rail'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 15,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 16.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:torch'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 3,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 2.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'create:controller_rail'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 3,
                        name: 'naturesaura:dimension_rail_overworld'
                    }
                ]
            },
            {
                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:superstitious_hat'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:panic_necklace'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:cloud_in_a_bottle'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:obsidian_skull'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:golden_hook'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:kitty_slippers'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'darkutils:charm_sleep'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'darkutils:charm_gluttony'
                    }
                ]
            }
        ]
    };

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

