Minecraft Loot Table Generator

Decide what a chest holds, what a mob drops, or what a block gives. Set the odds yourself and see them worked out as you go.

What the table is for
What it gives
The loot table
{
  "type": "minecraft:chest",
  "pools": [
    {
      "rolls": 1,
      "entries": [
        {
          "type": "minecraft:item",
          "name": "minecraft:diamond",
          "weight": 1
        }
      ]
    }
  ]
}

Save it as data/mypack/loot_table/chests/my_dungeon.json inside your data pack.

Where the file goes
data/mypack/loot_table/chests/my_dungeon.json
Test it in game
/loot give @s loot mypack:chests/my_dungeon

Run this once the pack is loaded. It gives you exactly what the table would drop.

How it works

  • Say what the table is for. That decides which conditions the game can actually check, so the tool only offers you those.
  • Add the items. A weight is a share against the others in the same pool, and the percentages under each pool tell you where you have landed.
  • Add another pool when you want something guaranteed alongside something random. Each pool picks on its own.
  • Copy the file into your data pack at the path shown, reload, and try it with the test command. Names on items use the same codes as the color code list.

Java Edition. Counts and rolls are written in their long form on purpose, because the short one is being removed in a future version.

Questions

Where does this file go?
Inside a data pack, at the path the tool prints for you. The folder is loot_table, singular. It was loot_tables with an s until 1.21, and a pack using the old name loads with no error at all and simply does nothing, which is the commonest way one of these fails.
How do I make a data pack?
A folder in your world's datapacks folder, with a pack.mcmeta file at the top and your data folder beside it. Drop the loot table in at the path shown, then run /reload or open the world again.
What does weight actually mean?
It is a share, not a percentage. Each pick takes one entry, and an entry's chance is its weight divided by the total weight in that pool. So 3 against 1 is 75% and 25%, and adding a third item changes both. The tool works the percentages out under each pool so you can check them.
What is the difference between a pool and an entry?
A pool picks; an entry is something it can pick. One pool with three items gives you one of those three. Three pools with one item each give you all three every time. Use several pools when you want a guaranteed item plus a random extra.
Can I change what a vanilla mob drops?
Yes. Set the pack name to minecraft and the table name to entities/zombie, and your file replaces the game's own. Nothing is edited in the game itself, so removing the data pack puts it back.
Why is the count written as a type and two numbers?
Because the shorter way of writing it is being removed. A range used to be written as just a minimum and a maximum, and the current wiki marks that spelling as lasting only until 26.3. The longer form means the same thing and will still work afterwards.
What does 'player kills only' do?
It stops the pool giving anything unless a player landed the killing blow. It is how the game keeps mob farms from producing rare drops on their own, and it only makes sense on a mob table, so the tool hides it everywhere else.
Does Looting work on this?
On a mob table, yes. The extra you set is per level, so 1 gives one more item at Looting I and three more at Looting III. Set it to 0 to leave Looting out of it.
How do I test it without hunting for the mob?
Load the pack and run the /loot command the tool gives you. It hands you exactly what the table would drop, as many times as you like.