Skip to content
WikilyWIKILY
All games23 Wikis · pick your game
CalculatorsLoot tables

Switch game

23 Wikis · pick your game
Loot Table Builder

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.

  1. Add items to a pool
  2. Set counts, weights and chances
  3. Copy the loot table

Loot table

The file goes into your data pack at data/example/loot_table/chests/treasure.json.

Pool 1

diamond diamond
Name (optional)
Colour
iron_ingot iron_ingot
Name (optional)
Colour
diamond_sword diamond_sword
Name (optional)
Colour

What a player gets

ItemChance to get itOn average
diamond32.6%0.75
iron_ingot92.9%7.5
diamond_sword56.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/treasure

42 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"}

Item modifiers the builder writes

set_countHow many: a number or from-to
enchant_randomlyOne random enchantment the item can take
enchant_with_levelsEnchants like an enchanting table at these levels
set_enchantmentsThese enchantments at these levels
set_damageDurability left, 0 to 1
set_nameA name for the item

How the game works it out

FileA 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.3An entry's functions are written as modifier, one object or a list, and conditions as condition with a type
RollsEach roll keeps the entries whose conditions pass and picks one of them by weight; from-to rolls are a whole number drawn evenly
ChanceA 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 gameEvery table the builder can write was loaded in a data pack and dropped in the game
Join the creator communityThe people who build the Minecraft Java Edition wiki are on our Discord. Ask questions or suggest pages.Join Discord (opens Discord in a new tab)