Entity Requirement
An entity requirement is a set of criteria that an entity must meet in order to be considered a match. They currently support checking:
Entity IDs and tags
Entity location:
x/y/z
x/y/z offset
biome at entity's position
structure at entity's position
dimension at entity's position
light level at entity's position
block at entity's position
fluid at entity's position
Block entity is standing on (same as "Entity location", but 1 block below)
Potion effects
NBT
Entity flags:
On fire
Sneaking
Sprinting
Swimming
Invisible
Glowing
Baby
Equipment (head, chest, legs, feet, main hand, offhand)
Each of these is an item requirement
Entity-specific data:
Players:
Game mode (survival, creative, adventure, spectator)
Stats (blocks mined, distance walked, etc)
Unlocked recipes
Advancements
Entity the player is looking at
Entities with variants (cats, horses, etc.)
Variant name
Fishing bobber:
If the bobber is in an open lake
Lightning bolt:
Entities struck by the lightning
Blocks set on fire
Entity is wearing piglin-pacifying armor
Village raiders:
Is the raid captain
Part of an active raid
Active raid info
Slime:
Size of the slime
Vehicle (entity that this entity is riding)
Passenger (entity riding this entity)
Target (entity being targeted by this entity, if it is a hostile mob)
Temperature traits (thermal resistance, insulation, etc.)
These are modeled after Vanilla's entity predicates, and are structured like so:
Format
Type-Specific Data
The type_data
field is used to check entity-specific data, such as player info or variant name. The format of this field varies depending on the type of entity.
Entities with Variants
Checks the variant of the given entity, such as the color of a cat, or the personality of a panda.
Fishing Bobber
Checks if the fishing bobber is in an open body of water. This is probably used by the fishing loot tables to nerf loot from AFK farms.
Lightning Bolt
Checks some specific conditions when lighning strikes a location.
Piglin-Neutral Armor
Checks if the player is wearing any armor that pacifies piglins (i.e. gold boots).
Players
For players, the type_data
field should be an object with several fields:
game_mode
: The player's game mode (survival, creative, adventure, spectator).stats
: A list of checks to perform on the player's stats.recipes
: A map of recipes that the player has unlocked. The keys of the map are the recipe IDs, and the values of the map are boolean values indicating whether they are unlocked.advancements
: A map of advancements that the player must have completed overall, or have met certain criteria.looking_at
: An entity requirement that is checked against the entity the player is looking at.
Raider
For village raiders, such as pillagers, evokers, and witches:
has_raid
: Whether the raider is part of an active raid.is_captain
: Whether the raider is the raid captain.raid
: Data about the raider's active raid:is_over
: Whether the raid is over.is_between_waves
:Whether the raid is between waves.is_first_wave_spawned
: Whether the first wave has spawned.is_victory
: If the raid is declared as a victory.is_loss
: If the raid is declared as a loss.is_started
: The raid has begun.is_stopped
: The raid has stopped.total_health
: A decimal-number range which requires he health of all active raid mobs combined to fall withinmin
andmax
.bad_omen_level
: An integer range betweenmin
andmax
which checks the level of bad omen used to start the raid.current_wave
: An integer range which requires the current wave number to fall betweenmin
andmax
.
Slime
For slimes, the type_data
field should be an object with a single field named size
, which should be an object with min
and max
fields, which should be integers indicating the minimum and maximum size of the slime.
Snow Boots
Last updated