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.3 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 a roll is checked against belongs to the caller: ContextMap.Builder.buildAndValidate 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 loot table names a set of its own, its type, but that one is checked only when the table loads. A loot element reads a key with LootContext.getOptional, which answers null for a key that is not there, or asks only whether it is there, with LootContext.hasParameter. Seventeen of these thirty-one sets never roll a LootTable at all — the engine is wider than the loot package. See Contexts and predicates.

31 parameter sets

setidrequiredoptional
LootContextParamSets.ADVANCEMENT_ENTITYadvancement_entityLootContextParams.THIS_ENTITY, LootContextParams.ORIGIN—
LootContextParamSets.ADVANCEMENT_LOCATIONadvancement_locationLootContextParams.THIS_ENTITY, LootContextParams.ORIGIN, LootContextParams.TOOL, LootContextParams.BLOCK_STATELootContextParams.BLOCK_ENTITY
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_STATE, LootContextParams.ORIGINLootContextParams.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.COMMAND_COMPUTE_DEFAULTcommand_compute_defaultLootContextParams.ORIGINLootContextParams.THIS_ENTITY
LootContextParamSets.COMMAND_COMPUTE_ENTITYcommand_compute_entityLootContextParams.ORIGIN, LootContextParams.TARGET_ENTITYLootContextParams.THIS_ENTITY
LootContextParamSets.COMMAND_COMPUTE_POSITIONcommand_compute_positionLootContextParams.ORIGIN, LootContextParams.BLOCK_STATELootContextParams.THIS_ENTITY, LootContextParams.BLOCK_ENTITY
LootContextParamSets.COMMAND_SLOT_SOURCEcommand_slot_sourceLootContextParams.ORIGIN, LootContextParams.CONTAINERLootContextParams.THIS_ENTITY
LootContextParamSets.CONTAINER_PROCESScontainer_processLootContextParams.BLOCK_ENTITY, LootContextParams.BLOCK_STATE, LootContextParams.CONTAINER, LootContextParams.ORIGIN—
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, LootContextParams.CONTAINER, LootContextParams.INTERACTING_ENTITY, LootContextParams.TARGET_ENTITY, LootContextParams.ENCHANTMENT_ACTIVE, LootContextParams.ENCHANTMENT_LEVEL—
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—