Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Loot table

From SAS Gaming Wiki
Revision as of 11:10, 1 June 2026 by SyncBot (talk | contribs) (Sync: updated from Minecraft)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Template:Exclusive Loot tables are technical Minecraft:JSON files that are used to dictate what items should generate in various situations, such as what items should be in naturally generated containers, what items should drop when breaking a block or killing a mob, what items can be fished, and more. It does not affect dropped Minecraft:experience, or dropped non-item entities such as Minecraft:slimes from larger slimes or Minecraft:silverfish from infested blocks. In the Template:Cmd command, a loot table can be specified in Minecraft:SNBT format.

Definition

Loot tables are part of the data pack directory structure, highlighted below:

Template:Data pack directory

All loot tables are defined in data packs (vanilla data packs or custom data packs).

In the Template:Cmd command, a loot table can be specified in Minecraft:SNBT format.

Usage

Custom data packs use loot tables to change what loot can spawn in containers or drop by mobs. They can either modify existing loot tables or create new ones.

Vanilla usages

Vanilla loot tables are grouped into categories with some tables being in subfolders of those.

For example, the file for zombies would go in Template:File. Editing this file in a datapack would make every zombie in a Minecraft world use the modified datapack's loot table rather than the default zombie loot table.

To edit the loot tables of other entities, one would edit the entity's corresponding JSON file under the Template:File directory, which is typically said entity's name in the singular form (e.g. Template:File rather than Template:File).

The various subfolders and files include:

Some blocks, such as bedrock, end portals, and other blocks unbreakable in survival, do not have loot tables, some blocks share loot tables (namely wall and floor variants of blocks) and some drops, such as the Minecraft:wither's Minecraft:nether star, are not covered by loot tables.<ref>Template:Bug</ref>

NBT data

The loot tables are structured as a String tag that determines the table to use, and a Long tag determining the seed. Containers or mobs with the same seed and table drop the same items. Loot tables do not determine the container's slot to be used; that is randomly determined based on the seed. Once there is an interaction with the container (e.g. opening or destroying), the two tags are removed, and loots appear in the container.

For Minecraft:barrel, Minecraft:chest, Minecraft:trapped chest, Minecraft:hopper, Minecraft:minecart with chest, Minecraft:boat with chest, Minecraft:minecart with hopper, Minecraft:dispenser, Minecraft:dropper, Minecraft:shulker box, dyed shulker box, and Minecraft:decorated pot:

For Minecraft:mobs:

Minecraft:Vaults use loot tables in their config to determine the items to eject when unlocking the vault, and items to display in the vault.

Minecraft:Trial spawners use loot tables in their vault configs to determine the items to give as reward, and the items used by ominous item spawners spawned during the active phase when ominous.

Minecraft:Monster spawners and trial spawners use loot tables to determine what equipment the spawned mobs have.

Others

Loot tables can be invoked directly by the Template:Cmd command.

Loot tables can also be invoked in advancement rewards.

Format

Loot tables are defined using Minecraft:JSON files stored within a Minecraft:data pack in the path Template:Cd.

In the Template:Cmd command, a loot table can be specified in Minecraft:SNBT format.

  • Template:Nbt The root.
    • Template:Nbt: (Optional. Defaults to generic) Specifies the Minecraft:loot context in which the loot table should be invoked. All item modifiers, predicates and number providers are then validated to ensure the parameters of the context type specified here cover all requirements, and prints a warning message in the output log if any modifier or predicate requires a context parameter that is not covered.
    • Template:Nbt: (Optional) Applies item modifiers in order, onto all item stacks dropped by this table.
    • Template:Nbt: (Optional) A list of all pools for this loot table. Pools are applied in order.
    • Template:Nbt: (Optional) A Minecraft:resource location specifying the name of the random sequence that is used to generate loot from this loot table. If only one loot table uses a specific random sequence, the order of the randomized sets of items generated is the same for every world using the same world seed. If multiple loot tables use the same random sequence, the loot generated from any one of them changes depending on how many times and in what order any of the other loot tables were invoked.

Pool

There are several entries in a pool. The number of rolls of a pool is specified by Template:Nbt and Template:NbtTemplate:Nbt). In each roll of a pool, the pool draws one entry from all its entries. Each roll of a pool is independent.

Entry

There are two types of loot entry: Singleton Entry and Composite Entry.

A singleton entry defines an item generating behavior that may generate zero, one or more item stacks. Every singleton entry has a weight. Each roll selects a weighted singleton entry from the pool.

Composite entries are not weighted entries to be rolled. Instead, they are expanded/flattened before rolling, i.e., some children entries in it are extracted out. If an extracted children entry is also a composite entry, it is further expanded until there are only singleton entries. Then, these singleton entries are added into the pool.

Once all composite entries have been expanded, there're only singleton entries in the pool. Then, singleton entries that do not meet their conditions (Template:Nbt field) are removed from the pool. After that, in the pool are only singleton entries that meet their conditions. Each singleton entry has a weight (defined by the Template:Nbt and Template:Nbt fields). The game randomly selects one weighted singleton entry from the pool as the result of a roll.

The tag entry is a special entry. Whether it is a singleton or composite entry is determined by the Template:Nbt field. If Template:Nbt is Template:Cd, it is a composite entry that expands into multiple singleton entries like item but do not apply item modifiers due to a bug<ref name="MC212671">Template:Bug</ref>.

The format of an entry is:

The possible values for Template:Nbt and associated extra fields are listed below.

Singleton entry

Fields common to all singleton entries:

    • Template:Nbt: (Optional) A list of predicates that must all pass for this singleton entry to be included into the pool. If any predicate is not satisfied, the singleton entry is removed from the pool before rolling.
    • Template:Nbt: (Optional) Applies item modifiers in order, onto all item stacks dropped by this singleton entry.
    • Template:Nbt: (Optional. Defaults to 1) Determines how often this singleton entry is chosen out of all the singleton entries in the pool. Entries with higher weights are used more often. The chance of an entry being chosen is [this entry's weight ÷ total weight of all entries in the pool].
    • Template:Nbt: (Optional. Defaults to 0) Modifies this singleton entry's Template:Cd based on the level of luck (including luck attribute and fishing_luck_bonus on fishing tool). Formula is Template:Cd. Due to known bugs, this does not work in some contexts<ref name="luck"/>.
    • Even more extra fields of the entry, described below.

Possible singleton entries:

  • loot_table — Drops the loot from another loot table.
  • empty — Drops nothing.

Tag entry

If Template:Nbt is Template:Cd, it is a singleton entry:

  • When selected in a roll, generates item stacks for all items in the specified item Minecraft:tag. The default, if not changed by item modifiers, each item stack is 1 item with its default Minecraft:data components.

If Template:Nbt is Template:Cd, it is a composite entry:

  • Expands into multiple singleton entries with the specified weight and conditions, for each item in the item Minecraft:tag. The item count of each item stack is 1, and each item is generated with its default Minecraft:data components. Item modifiers do not work<ref name="MC212671"/>.

Composite entry

Fields common to all composite entries:

    • Template:Nbt: (Optional) A list of predicates that must all pass for this composite entry to expand and its children to be added into the pool. If any predicate is not satisfied, the composite entry is ignored, so, no entry is added into the pool.
    • Template:Nbt: (Optional) The list of entries. Both singleton and composite entry are allowed.

Possible composite entries:

  • group — All entries in the Template:Nbt are extracted. Can be used for convenience, e.g. if one condition applies for multiple entries.
  • alternatives — Extracts only the first successful (conditions are met) entry. Conditions are checked in order.
  • sequence — Extracts the child entries in sequential order, continuing until an entry's conditions fail, then no more children are extracted.

Number provider

Loot tables use number providers in some places that accept an Template:Nbt or Template:Nbt. They can either be defined as a constant value or as an object.

Or:

Or:

The possible values for Template:Nbt and associated extra contents:

  • sum — The sum of multiple value providers

Loot context types

Template:Main The Template:Nbt field is used when loading the data pack to check whether the context parameters used by this loot table match the specified context type. The field makes it possible to check for errors in the loot table files without applying them in-game. If the loot table is used for a specific context, specifying the type field allows the game to check whether the loot table file uses parameters that are not provided in that context.

History

Template:HistoryTable

Issues

Template:Issue list

External links

References

Template:Reflist

Navigation

Template:Navbox Java Edition technical

Minecraft:de:Beutetabellen Minecraft:es:Tabla de botín Minecraft:fr:Table de butin Minecraft:ja:ルートテーブル Minecraft:ko:노획물 목록 Minecraft:nl:Buittabel Minecraft:pl:Tabela łupów Minecraft:pt:Tabela de itens Minecraft:ru:Таблицы добычи Minecraft:zh:战利品表