Minecraft:Loot table: Difference between revisions
More actions
Sync: updated from Minecraft |
Sync: updated from Minecraft |
||
| (5 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{Exclusive|java|customtext=This article describes only the loot table {{in|je}}.<br>See [https://learn.microsoft.com/en-us/minecraft/creator/documents/introductiontoloottables?view=minecraft-bedrock-stable the official documentation] for the loot table {{in|be}}.}} | {{Exclusive|java|customtext=This article describes only the loot table {{in|je}}.<br>See [https://learn.microsoft.com/en-us/minecraft/creator/documents/introductiontoloottables?view=minecraft-bedrock-stable the official documentation] for the loot table {{in|be}}.}} | ||
'''Loot tables''' are technical [[Minecraft:JSON]] files that are used to dictate what items should generate in various situations, such as what [[Minecraft:Chest loot|items should be in naturally generated containers]], what [[Minecraft:Drops|items should drop when breaking a block]] or [[Minecraft:Drops|killing a mob]], [[Minecraft:Fishing|what items can be fished]], and more. It does not affect dropped [[Minecraft:experience]], or dropped non-item entities such as [[Minecraft:slime]]s from larger slimes or [[Minecraft:silverfish]] from infested blocks. In the {{cmd|loot}} command, a loot table can be specified in [[Minecraft:SNBT]] format. | '''Loot tables''' are technical [[Minecraft:JSON]] files that are used to dictate what items should generate in various situations, such as what [[Minecraft:Chest loot|items should be in naturally generated containers]], what [[Minecraft:Drops|items should drop when breaking a block]] or [[Minecraft:Drops|killing a mob]], [[Minecraft:Fishing|what items can be fished]], and more. It does not affect dropped [[Minecraft:experience]], or dropped non-item entities such as [[Minecraft:slime]]s from larger slimes or [[Minecraft:silverfish]] from infested blocks. In the {{cmd|loot}} command, a loot table can be specified in [[Minecraft:SNBT]] format. | ||
| Line 199: | Line 200: | ||
== Number provider == | == Number provider == | ||
Loot tables use '''number providers''' in some places that accept an {{nbt|int}} or {{nbt|float}}. | {{main|Number provider}} | ||
Loot tables use '''number providers''' in some places that accept an {{nbt|int}} or {{nbt|float}}. | |||
== Loot context types == | == Loot context types == | ||
| Line 269: | Line 208: | ||
== History == | == History == | ||
=== Individual tables === | |||
{{HistoryTable | |||
|{{HistoryLine|java}} | |||
|{{HistoryLine||1.9|dev=15w43a|{{info needed|List all of the initially implemented loot tables here, perhaps in collapsible form}}}} | |||
|{{HistoryLine|||dev=15w43c|Renamed "villager_golem.json" to "iron_golem.json" | |||
|Added [[Minecraft:fishing]] loot tables, [[Minecraft:sheep]] without [[Minecraft:wool]], and [[Minecraft:zombie horse|zombie]] and [[Minecraft:skeleton horse]]s.}} | |||
|{{HistoryLine||1.9.1|dev=pre1|Added default table <code>chests/jungle_temple_dispenser</code>.}} | |||
|{{HistoryLine||1.14|dev=18w43a|Block [[Minecraft:drops]] have been changed to use loot tables too.{{info needed|Cannwe get a full, collapsed list?}}}} | |||
|{{HistoryLine|||dev=18w44a|Added loot tables for [[Minecraft:cat]]s, cat_morning_gift, players and [[Minecraft:wither]]s. | |||
|Added loot tables for new blocks.}} | |||
|{{HistoryLine|||dev=18w46a|Added loot table for [[Minecraft:illusioner]]s.}} | |||
|{{HistoryLine|||dev=18w48a|Added {{tooltip|more loot tables|village_cartographer, village_desert_house, village_plains_house, village_savanna_house, village_snowy_house, village_taiga_house, village_tannery, village_weaponsmith}} for [[Minecraft:village]]s, some of which are currently unused. | |||
|Removed loot table: village_blacksmith.}} | |||
|{{HistoryLine|||dev=18w49a|village_savanna_house and village_snowy_house loot tables are now used. | |||
|Added {{tooltip|more loot tables|village_armorer, village_butcher, village_mason, village_shepherd}} for [[Minecraft:village]]s.}} | |||
|{{HistoryLine|||dev=18w50a|village_desert_house and village_taiga_house loot tables are now used, making all previously unused loot tables no longer unused.}} | |||
|{{HistoryLine|||dev=?|Empty loot table is now hardcoded.}} | |||
|{{HistoryLine||1.16|dev=?|Fire and soul fire now have defined empty loot tables, rather than being hardcoded to drop nothing.}} | |||
|{{HistoryLine|||dev=?|Nether portal blocks now have defined empty loot tables, rather than being hardcoded to drop nothing.}} | |||
|{{HistoryLine||1.20|dev=23w17a|Added the loot table {{cd|sniffer_digging}}.}} | |||
|{{HistoryLine||1.20.5|dev=24w07a|Added <code>gameplay/panda_sneeze</code> loot table for drops when [[Minecraft:panda]]s sneeze.}} | |||
|{{HistoryLine||1.21.2|dev=24w33a|Sheep shearing is now controlled by loot tables found as <code>shearing/sheep/{{ph|color}}</code>. | |||
|Mooshroom shearing is now controlled by loot tables found as <code>shearing/mooshroom/{{ph|variant}}</code>. | |||
|Snow golem shearing is now controlled by a loot table found as <code>shearing/snow_golem</code>.}} | |||
|{{HistoryLine|||dev=24w35a|Special loot table empty has been removed and is no longer defined in vanilla data pack. | |||
|Sheep now always uses a single loot table <code>entities/sheep</code>. | |||
|Wool drops are still defined in sub-tables in <code>entities/sheep/{{ph|color}}</code>, but they are now just dispatched from the main table. | |||
|Sheep shearing is now controlled by loot table found as <code>shearing/sheep</code>. | |||
|Mooshroom shearing is now controlled by loot table found as <code>shearing/mooshroom</code>.}} | |||
|{{HistoryLine|||dev=24w37a|Chickens laying eggs is now controlled by a loot table found at <code>gameplay/chicken_lay</code>. | |||
|Armadillos randomly dropping scutes is now controlled by a loot table found at <code>gameplay/armadillo_shed</code>. | |||
|The loot given by Villagers is now controlled by two additional loot tables: <code>gameplay/hero_of_the_village/unemployed_gift</code> and <code>gameplay/hero_of_the_village/baby_gift</code>.}} | |||
|{{HistoryLine||1.21.9|dev=25w31a|Added {{cd|charged_creeper/root}}, {{cd|brush/armadillo}}, {{cd|gameplay/turtle_grow}}, {{cd|harvest/beehive}}, {{cd|harvest/cave_vine}}, and {{cd|carve/pumpkin}} loot tables.}} | |||
|{{HistoryLine|||dev=25w32a|Added {{cd|harvest/sweet_berry_bush}} loot table.}} | |||
|{{HistoryLine|upcoming java}} | |||
|{{HistoryLine||26.3|dev=snap2|Added {{cd|till/rooted_dirt}} loot table for drops when [[Minecraft:rooted dirt]] is tilled with a hoe.}} | |||
|{{HistoryLine|||dev=snap3|Multiple block loot tables now reference predicates for checking if a tool has [[Minecraft:Silk Touch]] and is [[Minecraft:shears]] instead of inlining a copy of those checks.}} | |||
}} | |||
=== Relevant data === | |||
=== Unsorted === | |||
{{HistoryTable | {{HistoryTable | ||
|{{HistoryLine|java}} | |{{HistoryLine|java}} | ||
| Line 274: | Line 256: | ||
|{{HistoryLine|||dev=15w43a|Added loot tables.}} | |{{HistoryLine|||dev=15w43a|Added loot tables.}} | ||
|{{HistoryLine|||dev=15w43b|Added condition '''entity_scores'''.}} | |{{HistoryLine|||dev=15w43b|Added condition '''entity_scores'''.}} | ||
|{{HistoryLine|||dev=15w43c | |{{HistoryLine|||dev=15w43c|Renamed the tag {{nbt|string|item}}: to {{nbt|string|name}}:, and the tag {{nbt|compound|items}}: to {{nbt|compound|entries}}: | ||
|Renamed the tag {{nbt|string|item}}: to {{nbt|string|name}}:, and the tag {{nbt|compound|items}}: to {{nbt|compound|entries}}: | |||
|Added the tag {{nbt|string|type}}: and support to load a loot table instead of an [[Minecraft:item]]. | |Added the tag {{nbt|string|type}}: and support to load a loot table instead of an [[Minecraft:item]]. | ||
|Added the tag {{nbt|int|luck}}: to default files, though it currently does nothing in the code. | |Added the tag {{nbt|int|luck}}: to default files, though it currently does nothing in the code. | ||
| Line 285: | Line 265: | ||
|Added the {{nbt|compound|bonus_rolls}} tag.}} | |Added the {{nbt|compound|bonus_rolls}} tag.}} | ||
|{{HistoryLine|||dev=15w51a|A [[Minecraft:player]] in [[Minecraft:spectator]] mode no longer triggers a container to use its loot table to generate loot.}} | |{{HistoryLine|||dev=15w51a|A [[Minecraft:player]] in [[Minecraft:spectator]] mode no longer triggers a container to use its loot table to generate loot.}} | ||
|{{HistoryLine||1.9.1|dev=pre1|Loot tables now work with [[Minecraft:dispenser]]s and [[Minecraft:dropper]]s | |{{HistoryLine||1.9.1|dev=pre1|Loot tables now work with [[Minecraft:dispenser]]s and [[Minecraft:dropper]]s.}} | ||
|{{HistoryLine||1.11|dev=16w32a|[[Minecraft:Donkey]]s, [[Minecraft:mule]]s, [[Minecraft:husk]]s and [[Minecraft:zombie villager]]s now each draw from their own loot tables, rather than drawing from the [[Minecraft:horse]] and [[Minecraft:zombie]] loot tables, respectively}} | |{{HistoryLine||1.11|dev=16w32a|[[Minecraft:Donkey]]s, [[Minecraft:mule]]s, [[Minecraft:husk]]s and [[Minecraft:zombie villager]]s now each draw from their own loot tables, rather than drawing from the [[Minecraft:horse]] and [[Minecraft:zombie]] loot tables, respectively}} | ||
|{{HistoryLine|||dev=16w43a|[[Minecraft:Villager]]s, [[Minecraft:vex]]es and [[Minecraft:ender dragon]]s are now able to draw from their own loot tables.}} | |{{HistoryLine|||dev=16w43a|[[Minecraft:Villager]]s, [[Minecraft:vex]]es and [[Minecraft:ender dragon]]s are now able to draw from their own loot tables.}} | ||
|{{HistoryLine||1.13|dev=17w43a|Custom loot tables have been moved into [[Minecraft:data pack]]s.}} | |{{HistoryLine||1.13|dev=17w43a|Custom loot tables have been moved into [[Minecraft:data pack]]s.}} | ||
|{{HistoryLine|| | |{{HistoryLine|||dev=18w01a|Added the function '''set_name'''.}} | ||
|{{HistoryLine||1.14|dev=18w43a | |{{HistoryLine||1.14|dev=18w43a|Loot tables received a bunch of new options.{{info needed|What options?}} | ||
|Loot tables received a bunch of new options. | |||
|Setting [[Minecraft:entity]] to "this" now refers to the [[Minecraft:player]] in [[Minecraft:chest]] and [[Minecraft:block]] loot tables.}} | |Setting [[Minecraft:entity]] to "this" now refers to the [[Minecraft:player]] in [[Minecraft:chest]] and [[Minecraft:block]] loot tables.}} | ||
|{{HistoryLine|||dev=18w44a | |{{HistoryLine|||dev=18w44a|Added the function '''set_lore'''.}} | ||
|{{HistoryLine||1.15|dev=19w34a|Added the function '''copy_state'''.}} | |{{HistoryLine||1.15|dev=19w34a|Added the function '''copy_state'''.}} | ||
|{{HistoryLine||1.16|dev=20w12a|Added fishing_hook sub-predicate to check properties of the fishing hook.}} | |{{HistoryLine||1.16|dev=20w12a|Added fishing_hook sub-predicate to check properties of the fishing hook.}} | ||
| Line 308: | Line 278: | ||
|{{HistoryLine|||dev=23w14a|Added the function <code>reference</code>.}} | |{{HistoryLine|||dev=23w14a|Added the function <code>reference</code>.}} | ||
|{{HistoryLine|||dev=23w17a|Renamed the <code>shards</code> dynamic drop to <code>sherds</code>.}} | |{{HistoryLine|||dev=23w17a|Renamed the <code>shards</code> dynamic drop to <code>sherds</code>.}} | ||
|{{HistoryLine|||dev=pre1|Made random sequences for loot tables deterministic. | |{{HistoryLine|||dev=pre1|Made random sequences for loot tables deterministic. | ||
|Added <code>random_sequence</code> field.}} | |Added <code>random_sequence</code> field.}} | ||
|{{HistoryLine|||dev=pre6|The ID of the random sequence is now an optional field.}} | |{{HistoryLine|||dev=pre6|The ID of the random sequence is now an optional field.}} | ||
|{{HistoryLine||1.20.2|dev=23w32a|Added <code>sequence</code> loot function.|<code>all_of</code> predicates in loot tables can now be declared implicitly as an inline array without a type.}} | |{{HistoryLine||1.20.2|dev=23w32a|Added <code>sequence</code> loot function. | ||
|{{HistoryLine||1.20.5 | |<code>all_of</code> predicates in loot tables can now be declared implicitly as an inline array without a type.}} | ||
|{{HistoryLine||1.20.5|dev=24w09a|The <code>name</code> field for entry type <code>loot_table</code> has been renamed to <code>value</code> and now also accepts inline loot tables.}} | |||
|{{HistoryLine|||dev=24w12a|Added <code>storage</code> loot number provider to access values from command storage.}} | |{{HistoryLine|||dev=24w12a|Added <code>storage</code> loot number provider to access values from command storage.}} | ||
|{{HistoryLine||1.21|dev=24w18a | |{{HistoryLine||1.21|dev=24w18a|Score context target entities <code>killer</code>, <code>direct_killer</code>, <code>killer_player</code> were renamed to <code>attacker</code>, <code>direct_attacker</code>, <code>attacking_player</code> | ||
|Score context target entities <code>killer</code>, <code>direct_killer</code>, <code>killer_player</code> were renamed to <code>attacker</code>, <code>direct_attacker</code>, <code>attacking_player</code> | |||
|Added {{cd|enchantment_level}} number provider}} | |Added {{cd|enchantment_level}} number provider}} | ||
|{{HistoryLine|||dev=24w21a|Moved loot tables from {{file|directory|loot_tables}} to {{file|directory|loot_table}}}} | |{{HistoryLine|||dev=24w21a|Moved loot tables from {{file|directory|loot_tables}} to {{file|directory|loot_table}}}} | ||
|{{HistoryLine||1.21.2 | |{{HistoryLine||1.21.2|dev=24w37a|The tool value (used for functions like <code>match_tool</code>) is now available for some additional loot table types.}} | ||
|{{HistoryLine||1.21.9|dev=25w31a|Added {{cd|minecraft:entity_interact}} and {{cd|minecraft:block_interact}} loot table types. | |||
|Fields that specify a target entity in a loot table, such as {{cd|entity_properties.entity}}, can additionally target the {{cd|target_entity}} and {{cd|interacting_entity}} parameter types.}} | |||
|{{HistoryLine||1.21.9|dev=25w31a|Added {{cd|minecraft:entity_interact}} and {{cd|minecraft:block_interact}} loot table types.|Fields that specify a target entity in a loot table, such as {{cd|entity_properties.entity}}, can additionally target the {{cd|target_entity}} and {{cd|interacting_entity}} parameter types | |{{HistoryLine||1.21.11|dev=25w44a|Added new {{cd|minecraft:slots}} loot pool entry. | ||
|Removed {{cd|contents}} as a supported value for the {{cd|dynamic}} loot entry type.}} | |||
|{{HistoryLine||1.21.11|dev=25w44a|Added new {{cd|minecraft:slots}} loot pool entry.|Removed {{cd|contents}} as a supported value for the {{cd|dynamic}} loot entry type.}} | |||
|{{HistoryLine|||dev=25w46a|Reverted removal of {{cd|contents}} as a supported value for the {{cd|minecraft:dynamic}} loot pool entry.}} | |{{HistoryLine|||dev=25w46a|Reverted removal of {{cd|contents}} as a supported value for the {{cd|minecraft:dynamic}} loot pool entry.}} | ||
|{{HistoryLine||26.1|dev=snap1|Added {{cd|minecraft:sum}} number provider.}} | |{{HistoryLine||26.1|dev=snap1|Added {{cd|minecraft:sum}} number provider.}} | ||
|{{HistoryLine|||dev=pre1|Added {{cd|minecraft:environment_attribute}} number provider.}} | |{{HistoryLine|||dev=pre1|Added {{cd|minecraft:environment_attribute}} number provider.}} | ||
|{{HistoryLine|upcoming java}} | |||
|{{HistoryLine||26.3|dev=snap3|Added {{cd|minecraft:number_dispatcher}}, {{cd|minecraft:conditional_value}}, {{cd|minecraft:weighted_list}} number providers.}} | |||
|{{HistoryLine|||dev=snap4|The {{cd|rolls}} and {{cd|bonus_rolls}} fields now accept an inline value or a namespaced ID of a {{cd|minecraft:number_provider}} type.|Loot table types that have a dedicated registry now support registry element and tag references.}} | |||
}} | }} | ||
Latest revision as of 11:10, 19 July 2026
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:
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:
- Template:File: The items from brushing Minecraft:suspicious sand or Minecraft:suspicious gravel.
- Template:File: The items dropped when mining blocks.
- Template:File: Loot in various structures in chests or barrels.
- Template:File: The items inside dispensers in Minecraft:trial chambers.
- Template:File: The loot dropped by mobs when killed.
- Template:File: The equipment of mobs spawned by Minecraft:trial spawners in trial chambers.
- Template:File: Gameplay mechanics such as:
- Template:File: Items obtained via Minecraft:fishing.
- Template:File: Items gifted by Minecraft:cats after sleeping.
- Template:File: Items obtained via Minecraft:bartering with Minecraft:piglins.
- Template:File: Items dropped when a Minecraft:chicken periodically lays an egg.
- Template:File: Items dropped when an Minecraft:armadillo sheds, either periodically or when Minecraft:brushed.
- Template:File: Loot tables that may be chosen from when Minecraft:fishing.
- Template:File: Valuable items that may be dropped when Minecraft:fishing.
- Template:File: Junk items that may be dropped when Minecraft:fishing.
- Template:File: Fish that may be caught when Minecraft:fishing.
- Template:File: Items gifted by Minecraft:villagers to a player with the Minecraft:Hero of the Village effect.
- Template:File: Gifts given by unemployed villagers.
- Template:File: Gifts given by Minecraft:baby villagers.
- Template:File: The loot inside decorated pots in trial chambers.
- Template:File: The items dropped when shearing Minecraft:sheep, Minecraft:mooshrooms, Minecraft:snow golems, or Minecraft:bogged.
- Template:File: The reward after defeating trial spawners.
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:
- Template:Nbt The root object.
For Minecraft:mobs:
- Template:Nbt The root object.
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 A pool (see below).
- 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.
- Template:Nbt: (Optional. Defaults to
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.
- Template:Nbt The root.
- Template:Nbt: (Optional) A list of predicates, that must all pass for this pool to be used.
- Template:Nbt: (Optional) Applies item modifiers in order, onto all item stacks dropped by this pool.
- Template:NbtTemplate:Nbt: A number provider. Specifies the number of rolls on the pool.
- Template:NbtTemplate:Nbt: (Optional. Defaults to 0.0) A number provider. Specifies the number of bonus rolls on the pool per level of luck (including luck attribute and fishing_luck_bonus on fishing tool). Rounded down after multiplying. Fishing_luck_bonus applies only to fishing. In vanilla games, luck attribute is from the Minecraft:Luck status effect, and fishing_luck_bonus is from the Minecraft:Luck of the Sea enchantment. This does not work in some context, due to bugs<ref name="luck">Template:Bug
Template:Bug
Template:Bug
Template:Bug</ref>. - Template:Nbt: Defines the entries in this pool. One loot entry is chosen per roll as a weighted random selection from all loot entries in the pool. Each roll is independent (Sampling with replacement), so an entry can be chosen multiple times in multiple rolls. It is not the elements in this array that are rolled. Instead, composite entries first expand their children, and then singleton entries that do not meet their conditions are removed from the pool, then entries are rolled afterward.
- Template:Nbt: An entry (see below).
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:
- Template:Nbt The root.
- Template:Nbt: Type of the entry as a Minecraft:resource location.
- Extra fields of the entry, described below.
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:
- item — Drops a single item stack. The default, if not changed by item modifiers, is a stack of 1 of the item with its default Minecraft:data components.
- Template:Nbt: The Minecraft:resource location of the item, e.g. Template:Cd.
- loot_table — Drops the loot from another loot table.
- Template:Nbt: Template:Json ref The loot table to be used. Cannot be the ID of the current loot table file. Recursive calling is not allowed.
- dynamic — Drops block-specific loot.
- Template:Nbt: Can be Template:Cd which drops the items in a Minecraft:shulker box, or Template:Cd which drops the sherds of a Minecraft:decorated pot. Does not work for other blocks.
- 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"/>.
- tag
- Template:Nbt: The Minecraft:resource location of the item tag to query, e.g. Template:Cd.
- Template:Nbt: If Template:Cd, provides one singleton entry per item in the tag with the same weight and conditions. If Template:Cd, it is a singleton entry that drops all items in the tag.
- 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. This does not work in some context, due to bugs<ref name="luck"/>.
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.
- Template:Nbt An entry.
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
Template:Main Loot tables use number providers in some places that accept an Template:Nbt or Template:Nbt.
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
Individual tables
Relevant data
Unsorted
Issues
External links
References
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:战利品表