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,
                        functions: [
                            {
                                function: 'minecraft:set_damage',
                                damage: {
                                    min: 0.8,
                                    max: 1.0
                                }
                            },
                            {
                                function: 'minecraft:enchant_with_levels',
                                levels: {
                                    min: 30,
                                    max: 60
                                },
                                treasure: true
                            }
                        ],
                        name: 'minecraft:iron_sword'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        functions: [
                            {
                                function: 'minecraft:set_damage',
                                damage: {
                                    min: 0.8,
                                    max: 1.0
                                }
                            },
                            {
                                function: 'minecraft:enchant_with_levels',
                                levels: {
                                    min: 30.0,
                                    max: 60.0
                                },
                                treasure: true
                            }
                        ],
                        name: 'minecraft:iron_chestplate'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        functions: [
                            {
                                function: 'minecraft:set_damage',
                                damage: {
                                    min: 0.8,
                                    max: 1.0
                                }
                            },
                            {
                                function: 'minecraft:enchant_with_levels',
                                levels: {
                                    min: 30.0,
                                    max: 60.0
                                },
                                treasure: true
                            }
                        ],
                        name: 'minecraft:iron_helmet'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        functions: [
                            {
                                function: 'minecraft:set_damage',
                                damage: {
                                    min: 0.8,
                                    max: 1.0
                                }
                            },
                            {
                                function: 'minecraft:enchant_with_levels',
                                levels: {
                                    min: 30.0,
                                    max: 60.0
                                },
                                treasure: true
                            }
                        ],
                        name: 'minecraft:iron_leggings'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        functions: [
                            {
                                function: 'minecraft:set_damage',
                                damage: {
                                    min: 0.8,
                                    max: 1.0
                                }
                            },
                            {
                                function: 'minecraft:enchant_with_levels',
                                levels: {
                                    min: 30.0,
                                    max: 60.0
                                },
                                treasure: true
                            }
                        ],
                        name: 'minecraft:iron_boots'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        functions: [
                            {
                                function: 'minecraft:set_damage',
                                damage: {
                                    min: 0.6,
                                    max: 1.0
                                }
                            }
                        ],
                        name: 'minecraft:diamond_sword'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        functions: [
                            {
                                function: 'minecraft:set_damage',
                                damage: {
                                    min: 0.6,
                                    max: 1.0
                                }
                            }
                        ],
                        name: 'minecraft:diamond_chestplate'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        functions: [
                            {
                                function: 'minecraft:set_damage',
                                damage: {
                                    min: 0.6,
                                    max: 1.0
                                }
                            }
                        ],
                        name: 'minecraft:diamond_helmet'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        functions: [
                            {
                                function: 'minecraft:set_damage',
                                damage: {
                                    min: 0.6,
                                    max: 1.0
                                }
                            }
                        ],
                        name: 'minecraft:diamond_leggings'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        functions: [
                            {
                                function: 'minecraft:set_damage',
                                damage: {
                                    min: 0.6,
                                    max: 1.0
                                }
                            }
                        ],
                        name: 'minecraft:diamond_boots'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 3.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'tconstruct:cobalt_reinforcement'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 2,
                        name: 'minecraft:enchanted_golden_apple'
                    }
                ]
            },
            {
                rolls: 2,
                entries: [
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 2.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:ancient_debris'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'minecraft:netherite_scrap'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 4.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'emendatusenigmatica:cast_iron_ingot'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 4.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'emendatusenigmatica:cobalt_ingot'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 15,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 2.0,
                                    max: 6.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:gold_ingot'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 3.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:gold_block'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 3.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:iron_block'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 8.0,
                                    max: 23.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:quartz'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 2.0,
                                    max: 6.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: 'emendatusenigmatica:sulfur_block'
                    }
                ]
            },
            {
                rolls: {
                    min: 1.0,
                    max: 2.0,
                    type: 'minecraft:uniform'
                },
                entries: [
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 3.0,
                                    max: 5.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:crying_obsidian'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 5.0,
                                    max: 15.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:gilded_blackstone'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 12.0,
                                    max: 25.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:spectral_arrow'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 10,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 3.0,
                                    max: 8.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'minecraft:magma_cream'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        functions: [
                            {
                                function: 'minecraft:set_count',
                                count: {
                                    min: 1.0,
                                    max: 3.0,
                                    type: 'minecraft:uniform'
                                }
                            }
                        ],
                        name: 'eidolon:crimson_essence'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'eidolon:warped_sprouts'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'alexsmobs:mosquito_proboscis'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'alexsmobs:bone_serpent_tooth'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        functions: [
                            {
                                function: 'minecraft:set_nbt',
                                tag: '{entity:\"alexsmobs:warped_toad\"}'
                            }
                        ],
                        name: 'shrink:mob_bottle'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        functions: [
                            {
                                function: 'minecraft:set_nbt',
                                tag: '{entity:\"alexsmobs:soul_vulture\"}'
                            }
                        ],
                        name: 'shrink:mob_bottle'
                    }
                ]
            },
            {
                rolls: 1,
                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:everlasting_beef'
                    },
                    {
                        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:snorkel'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:night_vision_goggles'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:villager_hat'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:lucky_scarf'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:scarf_of_invisibility'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:cross_necklace'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:panic_necklace'
                    },
                    {
                        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:charm_of_sinking'
                    },
                    {
                        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:antidote_vessel'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:universal_attractor'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:crystal_heart'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:helium_flamingo'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:digging_claws'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:feral_claws'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:power_glove'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:fire_gauntlet'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:pocket_piston'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:running_shoes'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:vampiric_glove'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:golden_hook'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:aqua_dashers'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:bunny_hoppers'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:kitty_slippers'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:steadfast_spikes'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:steadfast_spikes'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'artifacts:whoopee_cushion'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'darkutils:charm_portal'
                    },
                    {
                        type: 'minecraft:item',
                        weight: 5,
                        name: 'darkutils:charm_experience'
                    }
                ]
            }
        ]
    };

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

