Loot table

Loot tables are technical 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 experience, or dropped non-item entities such as slimes from larger slimes or silverfish from infested blocks.

Usage
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.

For chests, trapped chests, hoppers, storage minecarts, minecarts with hoppers, dispensers, droppers, shulker boxes and barrels: These tags are removed once the items have been interacted with (by opening the container, breaking the container, etc.), and only then are items put in the container.
 * : Loot table to be used to fill the container when it is next opened, or the items are otherwise interacted with. When the container is a chest that is part of a double chest, only the half corresponding to the tagged single-chest is affected.
 * : Seed for generating the loot table. Works similarly to the seeds for worlds. 0 or omitted uses a random seed.
 * : Seed for generating the loot table. Works similarly to the seeds for worlds. 0 or omitted uses a random seed.

For mobs:


 * The root tag.
 * : Loot table to be used for the items that drop when the entity is killed.
 * : Seed for generating the loot table. Works similarly to the seeds for worlds. 0 or omitted uses a random seed.

The loot tables of mobs and containers can be altered with and. The player could also grant a loot table to an entity or drop it in the world with.

Tags
Loot tables are defined using the JSON format. Below are a list of tags used.


 * : Optional, specifies the context in which the loot table should be invoked by. All loot functions and conditions are then validated to ensure the context type specified here will cover all requirements of the functions and conditions, and prints a warning message in the output log if any function or condition requires a context parameter that is not covered. Valid loot context types are described below.
 * : Invokes item functions, in order, upon all item stacks produced by this table.
 * A loot function. The JSON structure of this object is described on the Item modifiers page.
 * : A list of all pools for this loot table. Each pool used generates items from its list of items based on the number of rolls. Pools are applied in order.
 * A pool. The JSON structure of this object is described below.
 * A pool. The JSON structure of this object is described below.

Pool

 * Root
 * : A list of predicates that must all pass for this pool to be used.
 * A loot condition. The JSON structure of this object is described on the Predicates page.
 * : Invokes item functions, in order, to all item stacks produced by this pool.
 * A loot function. The JSON structure of this object is described on the Item modifiers page.
 * : A Number Provider. Specifies the number of rolls on the pool.
 * : A Number Provider. Specifies the number of bonus rolls on the pool per point of luck. Rounded down after multiplying. Defaults to exactly 0.0.
 * : A list of all things that to produce entries for this pool. One entry is chosen per roll as a weighted random selection from all entries added into the pool.
 * The JSON structure of this object is described below.

Entry

 * Root
 * : A list of predicates that must all pass for the produced entry/ies to be added into the loot pool.
 * A loot condition. The JSON structure of this object is described on the Predicates page.
 * : Resource location of the type of entry producer. Set to one of the following values.

The possible values for and associated extra contents:


 * item&mdash;Adds an entry that drops a single item stack into the loot pool.
 * : Invokes item functions to the item stack(s).
 * A loot function. The JSON structure of this object is described on the Item modifiers page.
 * : Determines how often an entry is chosen out of all the 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 of all considered entries' weights].
 * : Modifies the entry's based on the luck attribute of the  (for loot tables of type ) or the  entity for all other loot table types. Formula is.
 * : The resource location of the item to be produced, e.g. . The default, if not changed by loot functions, is a stack of 1 of the default instance of the item.


 * tag&mdash;Adds all item as an entry or as multiple entries from an item tag into the loot pool.
 * : Invokes item functions to the item stack(s).
 * A loot function. The JSON structure of this object is described on the Item modifiers page.
 * : Determines how often an entry is chosen out of all the 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 of all considered entries' weights].
 * : Modifies the entry's based on the luck attribute of the  (for loot tables of type ) or the  entity for all other loot table types. Formula is.
 * : The resource location of the item tag to query, e.g..
 * : If set to, adds all items as multiple entries into the loot pool, each with the specified weight and quality. If , addes an entry that generates one of every listing in the tag. Required when type is.


 * loot_table&mdash;Adds another loot table as an entry into the loot pool.
 * : Invokes item functions to the item stack(s).
 * A loot function. The JSON structure of this object is described on the Item modifiers page.
 * : Determines how often an entry is chosen out of all the 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 of all considered entries' weights].
 * : Modifies the entry's based on the luck attribute of the  (for loot tables of type ) or the  entity for all other loot table types. Formula is.
 * : The resource location of the loot table to be used, e.g..


 * dynamic&mdash;For loot tables of type only, adds an entry that generates block-specific drops.
 * : Invokes item functions to the item stack(s).
 * A loot function. The JSON structure of this object is described on the Item modifiers page.
 * : Determines how often an entry is chosen out of all the 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 of all considered entries' weights].
 * : Modifies the entry's based on the luck attribute of the  (for loot tables of type ) or the  entity for all other loot table types. Formula is.
 * : Can be  to drop block entity contents.


 * empty&mdash;Adds an entry that generates nothing into the loot pool.
 * : Invokes item functions to the item stack(s).
 * A loot function. The JSON structure of this object is described on the Item modifiers page.
 * : Determines how often an entry is chosen out of all the 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 of all considered entries' weights].
 * : Modifies the entry's based on the luck attribute of the  (for loot tables of type ) or the  entity for all other loot table types. Formula is.


 * group&mdash;All entry producers in the children list is applyed into the loot pool. Can be used for convenience, e.g. if one condition applies for multiple entries.
 * : The list of child entry producers.
 * An entry producer.


 * alternatives&mdash;Only the first successful (conditions are met) entry producer in order is applyed into the loot pool.
 * : The list of child entry producers.
 * An entry producer.


 * sequence&mdash;The child entry producers are applyed into the loot pool in sequential order, continuing until an entry producer's conditions do not met, then applying no more entry producers from the children.
 * : The list of child entry producers.
 * An entry producer.

Predicate
Loot conditions are JSON structures that are used within loot tables to add requirements to a drop, pool, or function. They can also be used in standalone files called predicate, where they can be called upon from multiple different contexts.

The specific structure of a loot condition is shown on the Predicates page.

Item function
Loot functions are used within loot tables to apply modifications to the item stack being produced, such as adjusting the stack size or adding enchantments. They can also be used in standalone files called Item modifiers, where they can be called upon to modify items in an already existing item slot within a block or entity's inventory.

The specific structure of a loot function is shown on the Item modifiers page.

Number Providers
Loot tables use number providers in some places that accept an int or float. They can either be defined as a constant value or as an object.


 * Root
 * : Constant number provider.
 * : The root tag.
 * : The number provider type.

The possible values for and associated extra contents:


 * constant&mdash;A constant value.
 * : The exact value.


 * uniform&mdash;A random number following a uniform distribution between two values (inclusive).
 * : Number provider. The minimum value.
 * : Number provider. The maximum value.


 * binomial&mdash;A random number following a binomial distribution
 * : Number provider. The amount of trials.
 * : Number provider. The probability of success on an individual trial.


 * score&mdash;To query and use a scoreboard value.
 * : To choose which player name or entity UUID to query.
 * : Set to to manually specify a player name or UUID. Set to  to use an entity from loot context.
 * : Included only if is set to . Specifies the name of the player, or the entity's UUID (in hypenated hexadecimal format) whose score to query.
 * : Included only if is set to . Specifies an entity from loot context to query the score of. Use  for the invoking entity,  for the entity that killed the invoking entity,  for the entity that directy killed the invoking entity, or  to select the killer only if they are a player.
 * : The scoreboard objective to query on the selected player name or UUID.
 * : Optional. Scale to multiply the score before returning it.

Loot context types
Loot tables, loot conditions, and loot functions all receive context parameters upon being invoked. Depending on the method of invocation, different parameters may be supplied to them. Below is a list of all possible methods of invocation for a loot table/condition/function, and the parameter:

List of vanilla loot tables
Below is a list of all loot tables that exist by default. More tables can be added in the world save for use with custom maps. Note that 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 that certain drops, namely head drops from charged creepers and the wither's nether star, are currently not covered by loot tables.

Data packs
Custom data packs use loot tables to change what loot can spawn in containers or drop by mobs. They can either change existing loot tables or create new ones. This is the file structure:


 * world save folder
 * datapacks
 * data pack
 * data
 * minecraft
 * loot_tables
 * See
 * custom_namespace
 * loot_tables
 * loot table name.json

The JSON files go in this folder. Vanilla loot tables are grouped into 4 categories: gameplay (fishing), entities, blocks, and chests, with some tables being in subfolders of those. For example, the file for zombies would go in. This makes every zombie in that world use the datapack's loot table rather than the default zombie loot table.

Loot tables use resource locations. To create a custom loot table, first create a new folder for the custom namespace, and then create loot tables within following a similar structure. Then, summon the mob with the data tag DeathLootTable set to the name of the directory and file (without the .json extension), such as.