
Generator
Loot Table Builder
Make a data pack loot table with pools, weighted items, counts, enchanting, names and chances, and see the exact chance of each item.
- Add items to a pool
- Set counts, weights and chances
- Copy the loot table
Loot table
The file goes into your data pack at data/example/loot_table/chests/treasure.json.
Pool 1
Name (optional)
Name (optional)
What a player gets
| Item | Chance to get it | On average |
|---|---|---|
| diamond | 32.6% | 0.75 |
| iron_ingot | 92.9% | 7.5 |
| diamond_sword | 56.6% | 0.75 |
Data pack file
data/example/loot_table/chests/treasure.json
{
"type": "minecraft:chest",
"pools": [
{
"rolls": {
"type": "minecraft:uniform",
"min": 2,
"max": 4
},
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:diamond",
"modifier": {
"type": "minecraft:set_count",
"count": {
"type": "minecraft:uniform",
"min": 1,
"max": 3
}
}
},
{
"type": "minecraft:item",
"name": "minecraft:iron_ingot",
"weight": 5,
"modifier": {
"type": "minecraft:set_count",
"count": {
"type": "minecraft:uniform",
"min": 2,
"max": 6
}
}
},
{
"type": "minecraft:item",
"name": "minecraft:diamond_sword",
"weight": 2,
"modifier": {
"type": "minecraft:enchant_with_levels",
"levels": {
"type": "minecraft:uniform",
"min": 20,
"max": 39
},
"options": "#minecraft:on_random_loot"
}
}
]
}
]
}Command
/loot give @s loot example:chests/treasure42 characters
For Java Edition 26.3. Every form this tool writes was run through the game's own command parser.
Or a chest that fills itself when first opened: /setblock ~ ~ ~ chest{LootTable:"example:chests/treasure"}
| set_count | How many: a number or from-to |
| enchant_randomly | One random enchantment the item can take |
| enchant_with_levels | Enchants like an enchanting table at these levels |
| set_enchantments | These enchantments at these levels |
| set_damage | Durability left, 0 to 1 |
| set_name | A name for the item |
| File | A loot table goes into a data pack at data/<namespace>/loot_table/<path>.json and is called by its id, like example:chests/treasure |
| Format in 26.3 | An entry's functions are written as modifier, one object or a list, and conditions as condition with a type |
| Rolls | Each roll keeps the entries whose conditions pass and picks one of them by weight; from-to rolls are a whole number drawn evenly |
| Chance | A random_chance on an entry is drawn again for every roll; on a pool it decides whether the pool is rolled at all |
| Using it | /loot give @s loot <id> gives the items now; a chest with LootTable fills itself the first time it is opened |
| Checked in the game | Every table the builder can write was loaded in a data pack and dropped in the game |




