Loot Tables
Loot tables are JSON files that dictate what items should generate in various game situations. They control drops from mobs and blocks, contents of naturally generated containers (chests, barrels, dispensers), fishing rewards, archaeology brushing results, bartering exchanges, and more.
Overview
Loot tables have several key characteristics:
- Context-dependent: Different loot contexts provide different parameters (killer entity, tool, luck level, etc.)
- Randomized: Use number providers for rolls and weighted entries for varied results
- Conditional: Apply predicates to pools, entries, and functions
- Composable: Reference other loot tables as entries for modularity
- Transformable: Apply item modifier functions to modify generated items
File Structure
Loot tables are stored as JSON files in data packs at:
For complete JSON specification, see the Minecraft Wiki - Loot table.
Creating Loot Tables
Use the lootTable builder function to create loot tables in Kore:
This generates data/my_datapack/loot_table/custom_chest.json.
Table Structure
A loot table consists of:
| Property | Type | Description |
|---|---|---|
type |
LootTableType |
Optional context type for validation |
pools |
List<LootPool> |
One or more pools that generate items |
functions |
ItemModifier |
Optional global item functions applied to all drops |
randomSequence |
RandomSequenceArgument |
Optional deterministic random sequence |
Setting the Type
The type validates that the loot table uses appropriate context parameters:
Available types: ADVANCEMENT_ENTITY, ADVANCEMENT_LOCATION, ADVANCEMENT_REWARD, ARCHEOLOGY, BARTER, BLOCK, BLOCK_USE, CHEST, COMMAND, EMPTY, ENTITY, EQUIPMENT, FISHING, GIFT, GENERIC, SELECTOR, SHEARING, VAULT.
Global Functions
Apply item modifier functions to all items dropped by the table:
Pools
Each pool represents an independent set of rolls. A table can have multiple pools that all contribute to the final loot.
Pool Properties
| Property | Type | Description |
|---|---|---|
rolls |
NumberProvider |
How many times to select from entries |
bonusRolls |
NumberProvider |
Additional rolls per luck level |
conditions |
Predicate |
Conditions that must pass for pool to activate |
entries |
List<LootEntry> |
Possible entries to select from |
functions |
ItemModifier |
Functions applied to items from this pool |
Basic Pool
Conditional Pool
Pool with Functions
Number Providers
Number providers determine dynamic numeric values for rolls, counts, and other quantities.
| Provider | Description | Example |
|---|---|---|
constant(value) |
Fixed value | constant(5f) |
uniform(min, max) |
Random between min and max | uniform(1f, 5f) |
binomial(n, p) |
Binomial distribution | binomial(5, 0.5f) |
scoreNumber(...) |
Value from scoreboard | scoreNumber("kills", EntityType.THIS) |
enchantmentLevel(...) |
Based on enchantment level | enchantmentLevel(5) |
Entries
Entries define what can be selected during a pool roll. There are singleton entries (yield items) and composite entries (combine other entries).
Singleton Entries
Item Entry
Drops a specific item:
Loot Table Entry
References another loot table:
Tag Entry
Drops items from an item tag:
Dynamic Entry
For block-specific drops (shulker box contents, decorated pot sherds):
Empty Entry
A weighted entry that drops nothing (useful for rarity):
Composite Entries
Alternatives
Selects the first entry whose conditions pass:
Group
All children are added to the pool if conditions pass:
Sequence
Children are added until one fails its conditions:
Entry Properties
Singleton entries share these properties:
| Property | Type | Description |
|---|---|---|
weight |
Int |
Selection weight (higher = more likely) |
quality |
Int |
Modifies weight based on luck: weight + quality × luck |
conditions |
Predicate |
Entry only available if conditions pass |
functions |
ItemModifier |
Functions applied to this entry's items |
Conditions (Predicates)
Conditions control when pools, entries, or functions apply. They use the same Predicate system as advancements.
See Predicates for the complete list of available conditions.
Functions (Item Modifiers)
Functions transform the generated items. They can be applied at table, pool, or entry level.
Common Functions
See Item Modifiers for the complete list of available functions.
Full Example
Generated JSON
Using with Commands
Spawn loot from a table using the /loot command:
Overriding Vanilla Tables
To modify vanilla loot tables, create a file with the same path in your datapack:
Best Practices
- Use appropriate types - Set the
typefield to catch invalid context parameter usage early - Organize with multiple pools - Use separate pools for different drop categories (guaranteed, rare, conditional)
- Leverage composition - Reference other loot tables instead of duplicating entries
- Weight appropriately - Use meaningful weights (e.g., 1/5/10/50) for clear rarity tiers
- Apply conditions at the right level - Pool conditions for entire categories, entry conditions for specific items
See Also
- Predicates - Conditions used in loot table pools and entries
- Item Modifiers - Functions applied to loot table items
- Advancements - Rewards can reference loot tables
- Commands - Using the
/lootcommand - Tags - Use item tags for tag entries
External Resources
- Minecraft Wiki: Loot table - Official JSON format reference
- Minecraft Wiki: Loot context - Understanding loot contexts
