Loot table

Loot tables are technical JSON tables that represent what items should be in a naturally generated chest or what items should drop when killing a mob.

Usage
The loot tables are structured as a String tag which determines the table to use, and a Long tag determining the seed. Chests or mobs with the same seed will drop the same items. Loot tables do not determine which slot of a chest is used, that is randomly determined based on the seed.

For chests: These tags will be removed once the chest is opened and only then items will be put in the chest.
 * : Loot table to be used to fill the chest when it is next opened. When the chest is part of a double chest, only the half corresponding to the tagged single-chest will be affected.
 * : Seed for generating the loot table. 0 or omitted will use a random seed.
 * : Seed for generating the loot table. 0 or omitted will use a random seed.

For entities:


 * : Loot table to be used for the items that drop when the entity is killed.
 * : Seed for generating the loot table. 0 or omitted will use a random seed.
 * : Seed for generating the loot table. 0 or omitted will use a random seed.

The loot tables of entities and chests can be altered with and.

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


 * A list of all pools for this entity. Each pool will randomly choose something from its list of items based on the number of rolls
 * Determines conditions for this pool to be used.
 * Name of condition. Valid conditions are described below.
 * Determines the exact number of attempted rolls within the pool, as opposed to a range.
 * Determines the minimum and maximum time an item pool can be used.
 * Minimum number of times a pool will be used
 * Maximum number of times a pool will be used
 * A list of all items in this pool
 * Determines conditions for this item to be used.
 * Name of condition. Valid conditions are described below.
 * ID name of the item. For example,
 * Determines special actions to add to an item. If any function is unset, it will not be used.
 * Name of function to use. Valid functions are described below.
 * Determines conditions for this function to take place.
 * Name of condition. Valid conditions are described below.
 * Determines how often this item will be chosen. Items with higher weights will be used more often
 * Increases the item's  based on luck, formula is  . However, luck is currently always 0.
 * Name of function to use. Valid functions are described below.
 * Determines conditions for this function to take place.
 * Name of condition. Valid conditions are described below.
 * Determines how often this item will be chosen. Items with higher weights will be used more often
 * Increases the item's  based on luck, formula is  . However, luck is currently always 0.
 * Determines how often this item will be chosen. Items with higher weights will be used more often
 * Increases the item's  based on luck, formula is  . However, luck is currently always 0.

Functions
Loot tables use various functions which add special data to an item, such as stack size or enchantments. Below are a list of valid functions, and the tags used by them. The tags are placed in the same function object as.


 * enchant_with_levels - Determines the level of enchantment to apply to this item.
 * Determines whether treasure enchantments are allowed on this item.
 * Determines exact enchantment level to use, as opposed to a range.
 * Determines the minimum and maximum enchantment to apply, which is mostly equivalent to using an enchantment table with this level.
 * Minimum level to use.
 * Maximum level to use.
 * furnace_smelt - Smelts the item as it would be in a furnace. Used to cook food for animals on death.
 * looting_enchant - Determines the effects of Looting on this item. If unused, Looting will have no effect.
 * Determines exact number of additional items from looting, as opposed to a range.
 * Determines the minimum and maximum increase for this item per level of Looting.
 * Minimum increase.
 * Maximum increase.
 * set_count - Determines the minimum and maximum stack size. If unused, a stack size of 1 will be used.
 * Determines exact number of items provided, as opposed to a range.
 * Determines the minimum and maximum stack size for this item.
 * Minimum stack size.
 * Maximum stack size.
 * set_data - Determines the damage value of the item.
 * Exact damage value of the item, as opposed to a range.
 * Determines the minimum and maximum damage value for this item.
 * Minimum damage.
 * Maximum damage.
 * set_nbt - Adds NBT data to an item
 * Tag to add, similar to those used by commands. Note that the first bracket is required and quotation marks need to be escaped using a backslash

Conditions
Loot tables use various conditions which add requirements to a drop, pool, or function. Below are a list of valid conditions, and the tags used by them. The tags are placed in the same condition object as.


 * entity_properties - Determines required properties for this to be used
 * Determines the entity to check for the condition. Set to  to use the entity that died,   for the killer, or   for a killer that is a player.
 * Properties that must match for the condition.
 * The entity must be on fire
 * entity_scores - Checks for the scores of an entity for the drop to happen
 * Determines the entity to check for the condition. Set to  to use the entity that died,   for the killer, or   for a killer that is a player.
 * Scores to check
 * Key name is the objective while the value is the exact number to check, as opposed to a range. Note that this is broken as of 15w43b.
 * Name of a score to check for the minimum and maximum. Note that only the minimum score works as of 15w43b.
 * Minimum score
 * Maximum score
 * killed_by_player - Requires the entity to be killed by the player
 * Reverse the condition to only allow item drop if not killed by a player.
 * random_chance - Changes the chance of the pool.
 * Determines the base chance for this item to drop.
 * random_chance_with_looting - Changes the chance of the pool based on Looting
 * Determines the base chance for this item to drop
 * Determines the amount to increase the chance per level of Looting.

List of 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.


 * loot_tables
 * chests - Items from loot chests
 * abandoned_mineshaft - Minecarts with chests found in abandoned mine shafts
 * desert_pyramid - Chests found in the treasure room inside Desert Temples
 * end_city_treasure - Chests found in End Cities
 * igloo_chest - The chest that appears in the basements in igloos
 * jungle_temple - Chests found inside Jungle Temples
 * nether_bridge - Chests found in Nether Fortresses
 * simple_dungeon - Dungeon chests
 * spawn_bonus_chest - Bonus chests that appear in a new world when bonus chests are enabled
 * stronghold_corridor - Chests found on slab altars in corridors in strongholds
 * stronghold_crossing - The chest in the upper level of store rooms in strongholds
 * stronghold_library - Chests found in a library in strongholds
 * village_blacksmith - The chest found in the Blacksmith's house in a Village
 * entities - Items dropped from entities. May cause issues when applied to chests, due to some items spawning in stacks of 0
 * sheep
 * black
 * blue
 * brown
 * cyan
 * gray
 * green
 * light_blue
 * lime
 * magenta
 * orange
 * pink
 * purple
 * red
 * silver
 * white
 * yellow
 * bat
 * blaze
 * cave_spider
 * chicken
 * cow
 * creeper
 * elder_guardian
 * enderman
 * endermite
 * ghast
 * giant
 * guardian
 * horse
 * magma_cube
 * mushroom_cow
 * ocelot
 * pig
 * rabbit
 * shulker
 * silverfish
 * skeleton
 * slime
 * snowman - snow golems
 * spider
 * squid
 * villager_golem - iron golems
 * wolf
 * zombie
 * zombie_pigman
 * empty - contains no items