Skip to content
MC Command Generator

Loot Table Generator

Beta

Add items to a pool, set their weights and counts, and press Roll to watch a chest fill the way the game would. You get the loot table JSON for your Java version, a ready-made data pack and the /loot command to test it.

Describe it — AI writes the command

Type what you want in plain words. The AI fills the form below, so you can see it and change anything. It follows the edition and version you picked.

Checking the AI…

Pool 1each roll picks one entry by weight
Count, enchantments, name, conditions· ×1–3
Count, enchantments, name, conditions· ×1–2
Count, enchantments, name, conditions· enchanted
Count, enchantments, name, conditions· ×2–6
Count, enchantments, name, conditions· named · 50% chance

Rolls nothing: raise its weight to make the chest emptier.

Chest
43
  • Diamond ×3
  • Emerald ×4
Pool 1 · 2–4 rolls
  • diamond10%
  • golden_apple20%
  • iron_sword16%
  • emerald31%
  • Lucky Carrot1.0%
  • Nothing20%
Press Roll to fill the chest the way the game would (no Luck). Odds are per roll of each pool.

Your command · Java 26.3

98 characters
/loot give @p loot my_pack:treasure
/setblock ~ ~1 ~ minecraft:chest{LootTable:"my_pack:treasure"}
data/my_pack/loot_table/treasure.json
{
  "type": "minecraft:chest",
  "pools": [
    {
      "rolls": {
        "type": "minecraft:uniform",
        "min": 2,
        "max": 4
      },
      "entries": [
        {
          "type": "minecraft:item",
          "name": "minecraft:diamond",
          "weight": 5,
          "modifier": {
            "type": "minecraft:set_count",
            "count": {
              "type": "minecraft:uniform",
              "min": 1,
              "max": 3
            }
          }
        },
        {
          "type": "minecraft:item",
          "name": "minecraft:golden_apple",
          "weight": 10,
          "modifier": {
            "type": "minecraft:set_count",
            "count": {
              "type": "minecraft:uniform",
              "min": 1,
              "max": 2
            }
          }
        },
        {
          "type": "minecraft:item",
          "name": "minecraft:iron_sword",
          "weight": 8,
          "modifier": {
            "type": "minecraft:enchant_with_levels",
            "levels": {
              "type": "minecraft:uniform",
              "min": 20,
              "max": 39
            },
            "options": "#minecraft:on_random_loot"
          }
        },
        {
          "type": "minecraft:item",
          "name": "minecraft:emerald",
          "weight": 15,
          "modifier": {
            "type": "minecraft:set_count",
            "count": {
              "type": "minecraft:uniform",
              "min": 2,
              "max": 6
            }
          }
        },
        {
          "type": "minecraft:item",
          "name": "minecraft:golden_carrot",
          "condition": {
            "type": "minecraft:random_chance",
            "chance": 0.5
          },
          "modifier": {
            "type": "minecraft:set_name",
            "name": {
              "text": "Lucky Carrot",
              "color": "gold",
              "italic": false
            }
          }
        },
        {
          "type": "minecraft:empty",
          "weight": 10
        }
      ]
    }
  ]
}
  • Test it: /loot gives you one roll of the table; the setblock line places a chest that fills when someone opens it.
  • Put the file in your data pack (or press Download data pack), drop the pack in your world's datapacks folder, then run /reload.

Raw editor

Read only — this generator writes files, edit them with the form.

How it works

A loot table is a list of pools. Each pool rolls a number of times, and every roll picks one entry by weight: an entry with weight 10 is picked twice as often as one with weight 5. An “empty” entry picks nothing, which is how you make a chest emptier. The percentages next to each entry are its chance per roll.

Java 1.14 to 1.20.6

The file goes in data/<namespace>/loot_tables/. Ranges are number providers, and items get functions such as set_count:

{"type": "minecraft:item", "name": "minecraft:diamond", "weight": 5,
 "functions": [{"function": "minecraft:set_count",
   "count": {"type": "minecraft:uniform", "min": 1, "max": 3}}]}

Java 1.21 to 26.2

The folder became loot_table (singular). enchant_randomly takes options instead of enchantments, andenchant_with_levels lost treasure: the generator writes "options": "#minecraft:on_random_loot", the same list the game’s own chests use. Since 1.20.5 an entry that rolls another table uses value instead of name.

Java 26.3

26.3 renamed the entry fields: functions is now modifier, conditions is a single condition, and each function and condition names its kind with type:

{"type": "minecraft:item", "name": "minecraft:diamond", "weight": 5,
 "modifier": {"type": "minecraft:set_count",
   "count": {"type": "minecraft:uniform", "min": 1, "max": 3}}}

Testing it

Load the pack with /reload, then run /loot give @p loot my_pack:treasure (Java 1.14+) to get one roll. For chest tables the generator also gives you /setblock ~ ~1 ~ minecraft:chest{LootTable:"my_pack:treasure"}, a chest that fills the first time someone opens it. Java 1.13 has no /loot, so the chest is the way to test there. Bedrock has no data-pack loot tables, so this generator is Java only.

FAQ

How do I make an item rarer in a loot table?

Lower its weight compared with the other entries in the same pool, or add an empty entry with a high weight. You can also give the entry a drop chance (random_chance), which applies after it has been picked.

Why does my loot table not load?

Usually it is in the wrong folder for your version: loot_tables before Java 1.21, loot_table from 1.21. In 26.3 the old functions and conditions fields stop working too. Pick your version in the generator and download the pack again.

How do I put my loot table in a chest?

Place a chest with the LootTable tag: /setblock ~ ~1 ~ minecraft:chest{LootTable:"my_pack:treasure"}. It fills the first time a player opens it, so you can place many chests and each one gets its own roll.

Can I change what a mob drops?

Yes: name your table like the mob's own table (namespace minecraft, file entities/zombie) and choose Mob drops. Your pack then replaces the zombie's drops. The “only when killed by a player” condition only works in mob tables.

What are bonus rolls and quality?

Both depend on Luck. Bonus rolls add extra rolls per level of Luck, and quality changes an entry's weight per level of Luck. Without the Luck effect or a Luck of the Sea rod they do nothing.