Zum Inhalt springen

Minecraft Loot Table: Chest and Mob Drop Examples

Write a minecraft loot table in a data pack for chests and mob drops, with working 26.3 JSON, then test it with /loot and /give.

Aktualisiert am 5. Nov. 2026Geschrieben für Minecraft 26.32 Min. Lesezeit

Written for Minecraft 26.3.

A minecraft loot table is a JSON file in a data pack that decides what items drop from chests, mobs and blocks. You list pools, each pool rolls some entries, and conditions and modifiers tune the result.

Before you start

  • Minecraft Java Edition 26.3, data pack format 121.0.

  • A data pack with a valid pack.mcmeta. See pack basics.

  • Operator rights, to run /loot.

26.3 renamed keys. Since 26.3 snapshot 4, conditions is condition, functions on entries is modifier, and a function's function key is type. Old tutorials break on this.

Where the file goes

Save loot tables at data/<namespace>/loot_table/<name>.json. The folder is loot_table, singular, since 1.21 (it was loot_tables before). A file at data/example/loot_table/chests/starter.json has the ID example:chests/starter.

A chest loot table

  1. Create the file above.

  2. Set type to the loot context. Chests use minecraft:chest.

  3. Add a pool with rolls and a list of entries. Each entry has a weight (default 1).

{
  "type": "minecraft:chest",
  "pools": [
    {
      "rolls": 3,
      "entries": [
        {
          "type": "minecraft:item",
          "name": "minecraft:bread",
          "weight": 5,
          "modifier": [
            { "type": "minecraft:set_count", "count": 4 }
          ]
        },
        {
          "type": "minecraft:item",
          "name": "minecraft:diamond",
          "weight": 1
        }
      ]
    }
  ]
}

Each roll picks one entry by weight. Here bread is five times as likely as a diamond.

A mob drop with conditions

A condition is a predicate with a type. Put it in the pool or an entry. This drop needs a player kill and a 25 percent chance:

{
  "type": "minecraft:entity",
  "pools": [
    {
      "rolls": 1,
      "condition": [
        { "type": "minecraft:killed_by_player" },
        { "type": "minecraft:random_chance", "chance": 0.25 }
      ],
      "entries": [
        {
          "type": "minecraft:item",
          "name": "minecraft:emerald",
          "modifier": [
            {
              "type": "minecraft:set_name",
              "name": { "text": "Lucky Emerald" },
              "target": "item_name"
            }
          ]
        }
      ]
    }
  ]
}

More entry types exist: loot_table (nest another table), alternatives (first child that passes) and empty (drop nothing).

Test it with /loot and /give

  1. Reload the data pack or restart, then check /datapack list.

  2. Run /loot give @s loot example:chests/starter to get the items in your inventory.

  3. Run /loot spawn ~ ~1 ~ loot example:chests/starter to drop them as item entities.

  4. Use the give command builder to check a modifier's item components before you copy them in.

The mob table uses the entity context. Test it with /loot give @s loot example:entities/lucky (the player-kill condition will fail there), or kill a real mob once it is attached.

Check it worked

  • Console shows no loot table errors at startup.

  • Run /loot give ten times: weights should show in the mix.

Common problems

The table does not load

Check for the old folder name loot_tables or a trailing comma.

Modifiers are ignored

You used functions or function. Use modifier and type.

The condition always fails

Conditions need a context. killed_by_player needs a player attacker, so it fails in a plain /loot give.

Wrong ID

The ID is the path after loot_table/ without .json. See also debugging a pack.

Tritt unserem Discord bei

Hol dir Hilfe zu deinen Käufen, sieh, woran wir als Nächstes arbeiten, und tausche dich mit anderen Serverbetreibern aus.