Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Appendix F — Loot Table Conditions and Functions Reference

A loot table is built from two kinds of building block you will reach for over and over: conditions that decide whether something happens, and functions that decide what the resulting item looks like. This appendix is a flat, scannable list of every condition type and every function type the current Java Edition documents, with a one-line summary of each. Use it as a lookup table once you already understand the ideas; the teaching versions live in Chapter 16 (your first loot table), Chapter 17 (functions and conditions in loot tables), and Chapter 37 (advanced loot tables).

A note on names. In a loot table the JSON key for a condition is "condition" and the key for a function is "function"; both take a resource location (the minecraft: namespace is omitted throughout this appendix). Two names changed in modern Minecraft and you will still see the old ones in older tutorials: the looting-drop function is now enchanted_count_increase (it was once called looting_enchant), and the NBT-copying function is now copy_custom_data (it was once called copy_nbt). The names in this appendix are the current ones the game actually accepts.


Conditions

In a loot table, conditions are predicates: the same “if this, then that” checks used in predicate files, target selectors, and execute if predicate. A pool, an entry, or a whole table can carry a conditions list; every predicate in that list must pass. The condition types below are every value the predicate condition field accepts.

Condition typeWhat it checks
all_ofPasses if all of a list of sub-predicates pass. Invokable from any context.
any_ofPasses if any one of a list of sub-predicates passes. Invokable from any context.
block_state_propertyChecks the mined block and its block states. Requires a block state from loot context; fails if not provided.
damage_source_propertiesChecks properties of the damage source. Requires an origin and a damage source from loot context; fails if not provided.
enchantment_active_checkChecks whether an enchantment is currently active. Requires enchantment-active status from loot context; usable only from the enchanted_location context.
entity_propertiesChecks properties of an entity (uses the same predicate structure as advancements). Invokable from any context.
entity_scoresChecks an entity’s scoreboard scores; all listed scores must pass. Requires the specified entity from loot context; fails if not provided.
invertedInverts (negates) another condition. Invokable from any context.
killed_by_playerPasses if an attacking_player entity is provided by loot context; fails if not provided.
location_checkChecks the current location (with optional X/Y/Z offsets) against location criteria. Requires an origin from loot context; fails if not provided.
match_toolChecks the tool used to mine the block (same item-predicate structure as advancements). Requires a tool from loot context; fails if not provided.
random_chanceGenerates a random number 0.0–1.0 and passes if it is below the given chance. Invokable from any context.
random_chance_with_enchanted_bonusLike random_chance, but the success rate scales with the level of a given enchantment on the attacker. Treats a missing enchantment as level 0.
referenceInvokes a separate predicate file and returns its result. Invokable from any context; cannot be used in enchantment definitions.
survives_explosionPasses with probability 1 ÷ explosion radius. Requires an explosion radius from loot context; always passes if not provided.
table_bonusPasses with a probability picked from a list indexed by enchantment power. Requires a tool from loot context; treats a missing tool as level 0.
time_checkCompares the current day time against a value or range, with an optional period modulo. Invokable from any context.
value_checkCompares a number (from a number provider) against another number or range. Invokable from any context.
weather_checkChecks the current weather (raining and/or thundering). Invokable from any context.

19 condition types.


Functions

Functions (also called item functions or loot functions) modify the item stacks a table produces: changing the count, adding components, enchanting, copying data, and so on. A function carries a function field naming its type, an optional conditions list, and its own type-specific parameters. The same function types are what an item modifier file contains, so this list doubles as the item-modifier reference. The types below are every value the function field accepts.

Function typeWhat it does
apply_bonusApplies a predefined bonus formula (binomial_with_bonus_count, uniform_bonus_count, or ore_drops) to the stack count, based on an enchantment level.
copy_componentsCopies components from a loot-context source (block entity, attacker, tool, etc.) onto the item, with optional include/exclude lists.
copy_custom_dataCopies NBT from an entity, block entity, or command storage into the item’s custom_data component. (Modern name; replaces legacy copy_nbt.)
copy_nameCopies an entity or block entity’s name tag into the item’s custom_name component.
copy_stateCopies block-state properties from loot context into the item’s block_state component.
discardRemoves the item stack.
enchant_randomlyEnchants the item with one randomly chosen enchantment (a book becomes an enchanted book).
enchant_with_levelsEnchants the item at a specified enchantment level, like an enchanting table at that level (a book becomes an enchanted book).
enchanted_count_increaseAdjusts the stack size based on an enchantment level on the killer entity. (Modern name; replaces legacy looting_enchant.)
exploration_mapConverts an empty map into an explorer map pointing at a nearby generated structure. Requires an origin from loot context.
explosion_decayRemoves some items from the stack when an explosion radius is provided (each item has a 1/radius chance to be lost).
fill_player_headAdds the required tags to make a player head for a player from loot context.
filteredApplies an item predicate, then runs on_pass/on_fail modifiers depending on the result.
furnace_smeltSmelts the item as a furnace would, without changing its count.
limit_countClamps the count of every item stack to an exact limit or a min/max range.
modify_contentsApplies a function to every item inside an inventory component (bundle_contents, charged_projectiles, or container).
referenceCalls a separate item-modifier file (sub-functions) by name.
sequenceApplies a list of functions in order; does not check conditions (all listed functions always run).
set_attributesAdds attribute modifiers to the item.
set_banner_patternAdds or replaces a banner’s patterns.
set_book_coverSets the cover details (author, generation, title) of the written_book_content component.
set_componentsSets (or, with a ! prefix, removes) data components on the item.
set_contentsFills a container-style component with item stacks from a list of loot entries.
set_countSets the stack size (absolute, or relative with add).
set_custom_dataSets the item’s custom_data component by merging in supplied NBT.
set_custom_model_dataSets the custom_model_data component (floats, flags, strings, and colors).
set_damageSets the item’s damage/durability fraction (absolute, or relative with add).
set_enchantmentsModifies the item’s enchantments by level (a book becomes an enchanted book).
set_fireworksSets the fireworks component (explosions and flight duration).
set_firework_explosionSets the firework_explosion component (shape, colors, trail, twinkle).
set_instrumentSets the instrument tags to a random value from an instrument tag.
set_itemReplaces the item type without changing count or components.
set_loot_tableSets the loot table (and optional seed) a placed container block will use when opened.
set_loreAdds or changes the item’s lore lines, with append/insert/replace modes.
set_nameSets the item’s custom_name (or item_name) to a JSON text component.
set_ominous_bottle_amplifierSets the ominous_bottle_amplifier component from a number provider.
set_potionSets the potion_contents component to a given potion ID.
set_random_dyesSets the dyed_color component by selecting random dyes.
set_random_potionSets the potion_contents component to a randomly chosen potion.
set_stew_effectSets the status effects of a suspicious stew (fails on any other item).
set_writable_book_pagesManipulates the pages of the writable_book_content component.
set_written_book_pagesManipulates the pages of the written_book_content component.
toggle_tooltipsToggles which item tooltips are visible (attribute modifiers, enchantments, trim, etc.).

43 function types.


See also

  • Chapter 16 — your first loot table: pools, rolls, entries, and weight.
  • Chapter 17 — using functions and conditions inside a loot table.
  • Chapter 37 — advanced loot tables: composite entries, item modifiers, loot context, and reuse via reference.
  • Chapter 18 — predicate condition reference (the same condition types, in their predicate-file role).

Scope: current Java Edition. Every type and description above comes from Java Edition’s Item modifier and Predicate definitions, the same ones the Loot table format uses. If a type you expect is missing here, check the wiki’s Item modifier and Predicate pages for the latest additions.