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

Loot context parameter sets

Generated from the 26.2 decompile by tools/gen_reference.py. Do not edit by hand.

Every ContextKeySet registered in LootContextParamSets, with the keys its ContextKeySet.Builder declared. The set belongs to the caller, not to the loot table: ContextMap.Builder.create throws both on a required key that is absent and on a key the set does not declare at all, so this table is the contract each call site has to satisfy. A required key can be read with LootContext.getParameter, an optional one only with LootContext.getOptionalParameter. Twelve of these twenty-six sets never roll a LootTable at all — the engine is older and wider than the loot package. See Contexts and predicates.

26 parameter sets

setidrequiredoptional
LootContextParamSets.ADVANCEMENT_ENTITYadvancement_entityLootContextParams.THIS_ENTITY, LootContextParams.ORIGIN
LootContextParamSets.ADVANCEMENT_LOCATIONadvancement_locationLootContextParams.THIS_ENTITY, LootContextParams.ORIGIN, LootContextParams.TOOL, LootContextParams.BLOCK_STATE
LootContextParamSets.ADVANCEMENT_REWARDadvancement_rewardLootContextParams.THIS_ENTITY, LootContextParams.ORIGIN
LootContextParamSets.ARCHAEOLOGYarchaeologyLootContextParams.ORIGIN, LootContextParams.THIS_ENTITY, LootContextParams.TOOL
LootContextParamSets.PIGLIN_BARTERbarterLootContextParams.THIS_ENTITY
LootContextParamSets.BLOCKblockLootContextParams.BLOCK_STATE, LootContextParams.ORIGIN, LootContextParams.TOOLLootContextParams.THIS_ENTITY, LootContextParams.BLOCK_ENTITY, LootContextParams.EXPLOSION_RADIUS
LootContextParamSets.BLOCK_INTERACTblock_interactLootContextParams.BLOCK_STATELootContextParams.BLOCK_ENTITY, LootContextParams.INTERACTING_ENTITY, LootContextParams.TOOL
LootContextParamSets.BLOCK_USEblock_useLootContextParams.THIS_ENTITY, LootContextParams.ORIGIN, LootContextParams.BLOCK_STATE
LootContextParamSets.CHESTchestLootContextParams.ORIGINLootContextParams.THIS_ENTITY
LootContextParamSets.COMMANDcommandLootContextParams.ORIGINLootContextParams.THIS_ENTITY
LootContextParamSets.EMPTYempty
LootContextParamSets.ENCHANTED_DAMAGEenchanted_damageLootContextParams.THIS_ENTITY, LootContextParams.ENCHANTMENT_LEVEL, LootContextParams.ORIGIN, LootContextParams.DAMAGE_SOURCELootContextParams.DIRECT_ATTACKING_ENTITY, LootContextParams.ATTACKING_ENTITY
LootContextParamSets.ENCHANTED_ENTITYenchanted_entityLootContextParams.THIS_ENTITY, LootContextParams.ENCHANTMENT_LEVEL, LootContextParams.ORIGIN
LootContextParamSets.ENCHANTED_ITEMenchanted_itemLootContextParams.TOOL, LootContextParams.ENCHANTMENT_LEVEL
LootContextParamSets.ENCHANTED_LOCATIONenchanted_locationLootContextParams.THIS_ENTITY, LootContextParams.ENCHANTMENT_LEVEL, LootContextParams.ORIGIN, LootContextParams.ENCHANTMENT_ACTIVE
LootContextParamSets.ENTITYentityLootContextParams.THIS_ENTITY, LootContextParams.ORIGIN, LootContextParams.DAMAGE_SOURCELootContextParams.ATTACKING_ENTITY, LootContextParams.DIRECT_ATTACKING_ENTITY, LootContextParams.LAST_DAMAGE_PLAYER
LootContextParamSets.ENTITY_INTERACTentity_interactLootContextParams.TARGET_ENTITY, LootContextParams.TOOLLootContextParams.INTERACTING_ENTITY
LootContextParamSets.EQUIPMENTequipmentLootContextParams.ORIGIN, LootContextParams.THIS_ENTITY
LootContextParamSets.FISHINGfishingLootContextParams.ORIGIN, LootContextParams.TOOLLootContextParams.THIS_ENTITY
LootContextParamSets.ALL_PARAMSgenericLootContextParams.THIS_ENTITY, LootContextParams.LAST_DAMAGE_PLAYER, LootContextParams.DAMAGE_SOURCE, LootContextParams.ATTACKING_ENTITY, LootContextParams.DIRECT_ATTACKING_ENTITY, LootContextParams.ORIGIN, LootContextParams.BLOCK_STATE, LootContextParams.BLOCK_ENTITY, LootContextParams.TOOL, LootContextParams.EXPLOSION_RADIUS, LootContextParams.ADDITIONAL_COST_COMPONENT_ALLOWED
LootContextParamSets.GIFTgiftLootContextParams.ORIGIN, LootContextParams.THIS_ENTITY
LootContextParamSets.HIT_BLOCKhit_blockLootContextParams.THIS_ENTITY, LootContextParams.ENCHANTMENT_LEVEL, LootContextParams.ORIGIN, LootContextParams.BLOCK_STATE
LootContextParamSets.SELECTORselectorLootContextParams.ORIGIN, LootContextParams.THIS_ENTITY
LootContextParamSets.SHEARINGshearingLootContextParams.ORIGIN, LootContextParams.THIS_ENTITY, LootContextParams.TOOL
LootContextParamSets.VAULTvaultLootContextParams.ORIGINLootContextParams.THIS_ENTITY, LootContextParams.TOOL
LootContextParamSets.VILLAGER_TRADEvillager_tradeLootContextParams.ORIGIN, LootContextParams.THIS_ENTITY, LootContextParams.ADDITIONAL_COST_COMPONENT_ALLOWED