Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Advancement/Conditions/entity: Difference between revisions

From SAS Gaming Wiki
SyncBot (talk | contribs)
Sync: updated from Minecraft
SyncBot (talk | contribs)
Sync: updated from Minecraft
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<div class="treeview">
<div class="treeview">
<onlyinclude>
<onlyinclude>
** {{nbt|list}}{{nbt|string|type}}: {{json ref|entity type|Java_Edition_data_values#Entities|tag=1}} &mdash; Test this entity's type.
** {{nbt|list}}{{nbt|string|minecraft:entity_type}}: {{json ref|entity type|Java_Edition_data_values#Entities|tag=1}} &mdash; Test this entity's type.
** {{nbt|compound|components}}: Matches exact item component values. Each key in this object corresponds to a component to test, with its value as the desired data to compare. For example, can be used to avoid NBT serialisation when checking for mob variants or the exact text component match of a custom name.
** {{nbt|compound|minecraft:components}}: Matches exact item component values. Each key in this object corresponds to a component to test, with its value as the desired data to compare. For example, can be used to avoid NBT serialisation when checking for mob variants or the exact text component match of a custom name.
*** See [[Minecraft:data component format]].
*** See [[Minecraft:data component format]].
** {{nbt|compound|distance}}: To test the distance to the entity this predicate is invoked upon. Passes if the calculated distance is between the entered {{nbt|float|min}} and {{nbt|float|max}} values.
** {{nbt|compound|minecraft:distance}}: To test the distance to the entity this predicate is invoked upon. Passes if the calculated distance is between the entered {{nbt|float|min}} and {{nbt|float|max}} values.
*** {{nbt|float}}{{nbt|compound|absolute}}: Test the distance between the two points in 3D space.
*** {{nbt|float}}{{nbt|compound|absolute}}: Test the distance between the two points in 3D space.
*** {{nbt|float}}{{nbt|compound|horizontal}}: Test the distance between the two points, ignoring the Y value.
*** {{nbt|float}}{{nbt|compound|horizontal}}: Test the distance between the two points, ignoring the Y value.
Line 10: Line 10:
*** {{nbt|float}}{{nbt|compound|y}}: Test the absolute difference between the Y-coordinates of the two points.
*** {{nbt|float}}{{nbt|compound|y}}: Test the absolute difference between the Y-coordinates of the two points.
*** {{nbt|float}}{{nbt|compound|z}}: Test the absolute difference between the Z-coordinates of the two points.
*** {{nbt|float}}{{nbt|compound|z}}: Test the absolute difference between the Z-coordinates of the two points.
** {{nbt|compound|effects}}: For testing the active [[Minecraft:Effect|status effects]] on the entity. Hidden effects are ignored.
** {{nbt|compound|minecraft:effects}}: For testing the active [[Minecraft:Effect|status effects]] on the entity. Hidden effects are ignored.
*** {{nbt|compound|<minecraft:effect_name>}}: A status effect that must be present.
*** {{nbt|compound|<minecraft:effect_name>}}: A status effect that must be present.
**** {{nbt|int}}{{nbt|compound|amplifier}}: Test the effect's amplifier. Level I is represented by 0. Use an object with {{nbt|int|min}} and {{nbt|int|max}} to test for a range of values (inclusive).
**** {{nbt|int}}{{nbt|compound|amplifier}}: Test the effect's amplifier. Level I is represented by 0. Use an object with {{nbt|int|min}} and {{nbt|int|max}} to test for a range of values (inclusive).
Line 16: Line 16:
**** {{nbt|bool|ambient}}: Test whether the effect is from a beacon.
**** {{nbt|bool|ambient}}: Test whether the effect is from a beacon.
**** {{nbt|bool|visible}}: Test if the effect has visible particles.
**** {{nbt|bool|visible}}: Test if the effect has visible particles.
** {{nbt|compound|equipment}}: For testing the items that this entity holds in its equipment slots.
** {{nbt|compound|minecraft:equipment}}: For testing the items that this entity holds in its equipment slots.
*** {{nbt|compound|<equipment slot>}}: Test the item in the entity's equipment slot. Valid keys are {{cd|mainhand|offhand|head|chest|legs|feet|body|d=or}}.
*** {{nbt|compound|<equipment slot>}}: Test the item in the entity's equipment slot. Valid keys are {{cd|mainhand|offhand|head|chest|legs|feet|body|d=or}}.
**** {{nbt inherit/conditions/item}}
**** {{nbt inherit/conditions/item}}
** {{nbt|compound|flags}}: To test flags of the entity.
** {{nbt|compound|minecraft:flags}}: To test flags of the entity.
*** {{nbt|bool|is_baby}}: Test whether the entity is a baby variant (true) or an adult variant (false). Passes no matter what if this entity does not have baby and adult variants.
*** {{nbt|bool|is_baby}}: Test whether the entity is a baby variant (true) or an adult variant (false). Passes no matter what if this entity does not have baby and adult variants.
*** {{nbt|bool|is_on_fire}}: Test whether the entity has caught fire (true) or is not on fire (false). Does not pass if the entity has only been taking damage from a fire block for less than one second.
*** {{nbt|bool|is_on_fire}}: Test whether the entity has caught fire (true) or is not on fire (false). Does not pass if the entity has only been taking damage from a fire block for less than one second.
Line 28: Line 28:
*** {{nbt|bool|is_flying}}: Test whether the entity is either gliding with elytra or flying with creative mode (true) or is not (false).
*** {{nbt|bool|is_flying}}: Test whether the entity is either gliding with elytra or flying with creative mode (true) or is not (false).
*** {{nbt|bool|is_fall_flying}}: Test whether the entity is gliding with an elytra (true) or is not (false).
*** {{nbt|bool|is_fall_flying}}: Test whether the entity is gliding with an elytra (true) or is not (false).
** {{nbt|compound|location}}: Test properties of this entity's location.
** {{nbt|compound|minecraft:location}}: Test properties of this entity's location.
*** {{nbt inherit/conditions/location}}
*** {{nbt inherit/conditions/location}}
** {{nbt|string}}{{nbt|compound|nbt}}: Test for a partial NBT data match with this entity. This is always the last test to be performed by the predicate, as it is the slowest check. Can either be specified as an NBT (compound) object, or as a string containing the SNBT representation of the NBT compound, meaning the outer braces (<code>{ }</code>) must be included within the string. Additional care is required if the SNBT contains quotation marks (<code>" "</code>) as they must be escaped with a backslash before each (<code>\"</code>). If specified as an object rather than a string in a JSON file, the data type of any number value is implicitly checked for as the smallest data type that that number fits into, causing the test to fail for any other type and requiring the string format instead to specify the data type explicitly.
** {{nbt|string}}{{nbt|compound|minecraft:nbt}}: Test for a partial NBT data match with this entity. This is always the last test to be performed by the predicate, as it is the slowest check. Can either be specified as an NBT (compound) object, or as a string containing the SNBT representation of the NBT compound, meaning the outer braces (<code>{ }</code>) must be included within the string. Additional care is required if the SNBT contains quotation marks (<code>" "</code>) as they must be escaped with a backslash before each (<code>\"</code>). If specified as an object rather than a string in a JSON file, the data type of any number value is implicitly checked for as the smallest data type that that number fits into, causing the test to fail for any other type and requiring the string format instead to specify the data type explicitly.
** {{nbt|compound|passenger}}: Test the entities directly riding this entity. At least one passenger must pass this condition for the predicate to pass.
** {{nbt|compound|minecraft:passenger}}: Test the entities directly riding this entity. At least one passenger must pass this condition for the predicate to pass.
*** {{nbt inherit/conditions/entity}}
*** {{nbt inherit/conditions/entity}}
** {{nbt|compound|slots}}: Test for items in specific inventory [[Minecraft:slot]]s.
** {{nbt|compound|minecraft:slots}}: Test for items in specific inventory [[Minecraft:slot]]s.
*** {{nbt|compound|<slot range>}}: [[Minecraft:Slot]] or range of slots to test. At least one item matching the condition must exist in this range for the predicate to pass.
*** {{nbt|compound|<slot range>}}: [[Minecraft:Slot]] or range of slots to test. At least one item matching the condition must exist in this range for the predicate to pass.
**** {{nbt inherit/conditions/item}}
**** {{nbt inherit/conditions/item}}
** {{nbt|compound|stepping_on}}: Test properties of the block the entity is standing on, using a location predicate. The block may not be directly under the player's feet if they are crouching off of the side of the block.
** {{nbt|compound|minecraft:stepping_on}}: Test properties of the block the entity is standing on, using a location predicate. The block may not be directly under the player's feet if they are crouching off of the side of the block.
*** {{nbt inherit/conditions/location}}
*** {{nbt inherit/conditions/location}}
** {{nbt|compound|movement_affected_by}}: Test properties of the block {{cd|0.5}} blocks below the block the entity is standing on, using a location predicate.
** {{nbt|compound|minecraft:movement_affected_by}}: Test properties of the block {{cd|0.5}} blocks below the block the entity is standing on, using a location predicate.
*** {{nbt inherit/conditions/location}}
*** {{nbt inherit/conditions/location}}
** {{nbt|string|team}}: Passes if the [[Minecraft:Scoreboard#Teams|team]] of this entity matches this string.
** {{nbt|string|minecraft:team}}: Passes if the [[Minecraft:Scoreboard#Teams|team]] of this entity matches this string.
** {{nbt|compound|targeted_entity}}: Test properties of the entity which this mob's AI is targeting for attacks.
** {{nbt|compound|minecraft:targeted_entity}}: Test properties of the entity which this mob's AI is targeting for attacks.
*** {{nbt inherit/conditions/entity}}
*** {{nbt inherit/conditions/entity}}
** {{nbt|compound|vehicle}}: Test properties of the [[Minecraft:Riding#Behaviors|vehicle]] entity that this entity is mounted on.
** {{nbt|compound|minecraft:vehicle}}: Test properties of the [[Minecraft:Riding#Behaviors|vehicle]] entity that this entity is mounted on.
*** {{nbt inherit/conditions/entity}}
*** {{nbt inherit/conditions/entity}}
** {{nbt|compound|movement}}: Test the movement of the entity. For all fields, use an object with {{nbt|double|min}} and {{nbt|double|max}} to test for a range of values (inclusive).
** {{nbt|compound|minecraft:movement}}: Test the movement of the entity. For all fields, use an object with {{nbt|double|min}} and {{nbt|double|max}} to test for a range of values (inclusive).
*** {{nbt|double}}{{nbt|compound|x}}: Test the velocity along the x-axis in ''blocks per second''.
*** {{nbt|double}}{{nbt|compound|x}}: Test the velocity along the x-axis in ''blocks per second''.
*** {{nbt|double}}{{nbt|compound|y}}: Test the velocity along the y-axis in ''blocks per second''.
*** {{nbt|double}}{{nbt|compound|y}}: Test the velocity along the y-axis in ''blocks per second''.
Line 53: Line 53:
*** {{nbt|double}}{{nbt|compound|vertical_speed}}: Test the vertical movement speed in ''blocks per second''. This tests the absolute value of the {{code|y}} velocity.
*** {{nbt|double}}{{nbt|compound|vertical_speed}}: Test the vertical movement speed in ''blocks per second''. This tests the absolute value of the {{code|y}} velocity.
*** {{nbt|double}}{{nbt|compound|fall_distance}}: Test the fall distance of the entity in blocks.
*** {{nbt|double}}{{nbt|compound|fall_distance}}: Test the fall distance of the entity in blocks.
** {{nbt|int|periodic_tick}}: Tests that the age of the entity is divisible by the given positive integer. If the entity is loaded but not simulated, this check may be stuck as either passing or failing every tick until the entity gets close enough to a player again, so it should not be used for important delays.
** {{nbt|int|minecraft:periodic_tick}}: Tests that the age of the entity is divisible by the given positive integer. If the entity is loaded but not simulated, this check may be stuck as either passing or failing every tick until the entity gets close enough to a player again, so it should not be used for important delays.
** {{nbt|compound|predicates}}: Matches [[Minecraft:data component predicate]]s. For example, it can be used to check if an entity has any custom name, if a shulker has any color, or perform a partial check on the potion contents of an area effect cloud.
** {{nbt|compound|minecraft:predicates}}: Matches [[Minecraft:data component predicate]]s. For example, it can be used to check if an entity has any custom name, if a shulker has any color, or perform a partial check on the potion contents of an area effect cloud.
*** See [[Minecraft:data component predicate]].
*** See [[Minecraft:data component predicate]].
** {{nbt|compound|type_specific}}: To test entity properties that can only be applied to certain entity types or groups of entity types.
** {{nbt|compound|minecraft:type_specific}}: To test entity properties that can only be applied to certain entity types or groups of entity types.
*** {{nbt|string|type}}: Dictates which type-specific properties to test for.<p style="padding-block-end: 1em; margin: 0 0 0 0;">The possible values for {{nbt|string|type}} and associated extra contents:</p>
*** {{nbt|string|type}}: Dictates which type-specific properties to test for.<p style="padding-block-end: 1em; margin: 0 0 0 0;">The possible values for {{nbt|string|type}} and associated extra contents:</p>
*** '''minecraft:fishing_hook''': Test properties unique to [[Minecraft:fishing bobber]] entities. Fails if the entity is not a fishing bobber.
*** '''minecraft:fishing_hook''': Test properties unique to [[Minecraft:fishing bobber]] entities. Fails if the entity is not a fishing bobber.

Latest revision as of 11:44, 20 July 2026

Minecraft:fr:Progrès/Conditions/Entité Minecraft:ja:進捗/条件/entity Minecraft:ko:발전 과제/조건/개체 Minecraft:nl:Vooruitgangen/criteria/entiteit Minecraft:pt:Progressos/Condições/entidade Minecraft:ru:Достижение (Java Edition)/условия/сущность Minecraft:th:ความก้าวหน้า/Conditions/entity Minecraft:uk:Досягнення (Java Edition)/умова/сутність Minecraft:zh:编码格式/CritereonPredicate#实体谓词