Skip to main content

Entity events, filters and triggers

This page carries the lists of MS Learn (MicrosoftDocs/minecraft-creator a9fd1c0, CC BY 4.0). Relative links of the original are removed. Components and AI goals are in the index.

Built-in event list​

(Source: ms-learn, creator/Reference/Content/EntityReference/Examples/EventList.md)

Below is a list of all available Built-in Events within Minecraft: Bedrock Edition for use with Entity JSON files.

Built-in EventDescription
minecraft:entity_bornminecraft:entity_born triggers an event call on an entity when the entity is born via breeding.
minecraft:entity_spawnedminecraft:entity_spawned triggers an event call on an entity when the entity is spawned in the world.
minecraft:entity_transformedminecraft:entity_transformed triggers an event call on an entity when transformed into another entity.
minecraft:on_primeminecraft:on_prime triggers an event call on an entity when the entity is set to explode.

Filter list​

(Source: ms-learn, creator/Reference/Content/EntityReference/Examples/FilterList.md)

Entity Filter TypesDescription
actor_has_item_with_enchantment_in_slotTests that an actor has an item equipped with a given enchantment.
actor_healthTests the health of the subject.
all_slots_emptyReturns true when the designated equipment location for the subject entity is completely empty.
any_slot_emptyReturns true when the designated equipment location for the subject entity has any empty slot.
bool_propertyReturns true when the bool actor property matches the value provided.
clock_timeCompares the current time with a float value in the range (0.0, 1.0). 0.0= Noon 0.25= Sunset 0.5= Midnight 0.75= Sunrise
distance_to_nearest_playerCompares the distance to the nearest Player with a float value.
enum_propertyReturns true when the actor property matches the value provided.
float_propertyReturns true when the float actor property matches the value provided.
has_abilityReturns true when the subject entity has the named ability.
has_biome_tagTests whether the biome the subject is in has the specified tag.
has_componentReturns true when the subject entity contains the named component.
has_container_openReturns true when the subject Player entity has opened a container.
has_damageReturns true when the subject entity receives the named damage type.
has_damaged_equipmentTests for the presence of a damaged named item in the designated slot of the subject entity.
has_equipmentTests for the presence of a named item in the designated slot of the subject entity.
has_equipment_block_tagTests for the presence of a block item with the specified block tag in the specified slot of the entity.
has_equipment_tagTests for the presence of an item with the named tag in the designated slot of the subject entity.
has_item_with_componentReturns true when the subject entity is holding a item with the specified component.
has_mob_effectTests whether the Subject has the specified mob effect.
has_nametagTests if the subject has been given a custom name.
has_propertyTests for the presence of a property of the subject entity.
has_ranged_weaponReturns true when the subject entity is holding a ranged weapon like a bow or crossbow.
has_same_equipment_in_slot_asReturns whether the subject entity has the same item equipped in the specified slot as calling entity.
has_silk_touchTests if the subject is holding an item with silk touch.
has_tagReturns true if the subject entity has the tag provided.
has_targetReturns true if the subject entity has a valid target.
has_trade_supplyTests whether the target has any trade supply left.
home_distanceTests the distance between the subject and its home.
horizontal_speedTests the subject entity's horizontal speed in meters per second.
hourly_clock_timeCompares the current 24 hour time with an int value in the range[0, 24000]
inactivity_timerTests if the specified duration in seconds of inactivity for despawning has been reached.
int_propertyReturns true when the int actor property matches the value provided.
in_blockReturns true when the subject entity is inside a specified Block type.
in_caravanReturns true if the subject entity is in a caravan.
in_cloudsReturns true when the subject entity is in the clouds.
in_contact_with_waterReturns true when the subject entity in contact with any water: water, rain, splash water bottle.
in_lavaReturns true when the subject entity is in lava.
in_netherReturns true when the subject entity is in Nether.
in_overworldReturns true when the subject entity is in Overworld.
in_waterReturns true when the subject entity is in water.
in_water_or_rainReturns true when the subject entity is in water or rain.
is_altitudeTests the current altitude against a provided value.
is_avoiding_mobsReturns true if the subject entity is fleeing from other mobs.
is_babyReturns true when the subject entity is a baby.
is_biomeTests whether the Subject is currently in the named biome.
is_blockReturns true when the block has the given name.
is_bound_to_creaking_heartTests that the Creaking Heart that spawned the subject Creaking still exists.
is_brightnessTests the current brightness against a provided value in the range (0.0f, 1.0f).
is_climbingReturns true if the subject entity is climbing.
is_colorReturns true if the subject entity is the named color.
is_controlling_passenger_familyReturns true when the subject entity's controlling passenger is a member of the named family.
is_daytimeReturns true during the daylight hours.
is_difficultyTests the current difficulty level of the game.
is_familyReturns true when the subject entity is a member of the named family.
is_game_ruleTests whether a named game rule is active.
is_humidTests whether the Subject is in an area with humidity
is_immobileReturns true if the subject entity is immobile.
is_in_same_vehicleReturns whether the subject entity is in the same vehicle as the calling entity.
is_in_villageTests whether the Subject is inside the bounds of a village.
is_leashedReturns true if the subject entity is leashed.
is_leashed_toReturns true if the subject entity leashed to the calling entity.
is_mark_variantReturns true if the subject entity is the mark variant number provided.
is_missing_healthTests if the subject is not at full health.
is_movingReturns true if the subject entity is moving.
is_navigatingTests if the subject is currently pathfinding.
is_ownerReturns true if the subject entity is the owner of the calling entity.
is_panickingTests if the subject is panicking.
is_persistentTests if the subject's persistence matches the bool value passed in.
is_raiderTests if the subject is a raider.
is_ridingReturns true if the subject entity is riding on another entity.
is_riding_selfReturns true if the subject entity is riding the calling entity.
is_sittingTests if the subject is sitting.
is_skin_idReturns true if the subject entity is the skin id number provided.
is_sleepingTests whether the Subject is sleeping.
is_sneakingReturns true if the subject entity is sneaking.
is_sneak_heldReturns true if the subject entity has the sneak input held.
is_snow_coveredTests whether the Subject is in an area with snow cover
is_sprintingTests if the subject is sprinting.
is_tamedTests whether the Subject is tamed.
is_targetReturns true if the subject entity is the target of the calling entity.
is_temperature_typeTests whether the current temperature is a given type.
is_temperature_valueTests the current temperature against a provided value in the range (0.0, 1.0) where 0.0f is the coldest temp and 1.0f is the hottest.
is_undergroundReturns true when the subject entity is underground.
is_underwaterReturns true when the subject entity is under water.
is_variantReturns true if the subject entity is the variant number provided.
is_vehicle_familyReturns true when the subject entity's vehicle is a member of the named family.
is_visibleReturns true if the subject entity is visible.
is_waterloggedTests if the subject block is submerged in water.
is_weatherDEPRECATED
light_levelTests is the mob is outside of the specified light level range (0, 16).
moon_intensityCompares the current moon intensity with a float value in the range (0.0, 1.0)
moon_phaseCompares the current moon phase with an integer value in the range (0, 7).
on_fireTests if the subject is on fire.
on_groundReturns true when the subject entity is on ground.
on_hot_blockTests if the subject is on a hot block.
on_ladderReturns true when the subject entity is on a ladder.
owner_distanceTests the distance between the subject and its owner.
random_chanceReturns true if the random chance rolls 0 out of a specified max range.
redstone_strength_at_positionTests the redstone strength at the subject's position.
rider_countReturns the number of riders on this entity.
speedTests the subject entity's speed in meters per second.
surface_mobTests if the subject is a surface mob.
taking_fire_damageTests if the subject is taking fire damage.
target_distanceTests the distance between the calling entity and its target.
trustsReturns true if the subject is trusted by entity.
vertical_speedTests the subject entity's signed vertical speed in meters per second.
was_last_hurt_byTests if the subject is the last player who attacked the entity in the last 400 seconds, or the last mob to do so in the last 60 seconds.
weatherTests the current weather in the dimension against a provided weather value.
weather_at_positionTests the current weather, at the actor's position, against a provided weather value.
y_rotationReturns the Y rotation of this entity.

Trigger list​

(Source: ms-learn, creator/Reference/Content/EntityReference/Examples/TriggerList.md)

Entity TriggersDescription
minecraft:on_deathAdds a trigger to call on this entity's death.
minecraft:on_equipment_changedAllows to specify events to execute when equipment is set in the entity's default equipment slots.
minecraft:on_friendly_angerAdds a trigger that will run when a nearby entity of the same type as this entity becomes Angry.
minecraft:on_hurtAdds a trigger to call when this entity takes damage.
minecraft:on_hurt_by_playerAdds a trigger to call when this entity is attacked by the player.
minecraft:on_igniteAdds a trigger to call when this entity is set on fire.
minecraft:on_start_landingOnly usable by the Ender Dragon.
minecraft:on_start_takeoffOnly usable by the Ender Dragon.
minecraft:on_target_acquiredAdds a trigger to call when this entity finds a target.
minecraft:on_target_escapeAdds a trigger to call when this entity loses the target it currently has.
minecraft:on_wake_with_ownerA trigger when a mob's tamed onwer wakes up.

Event action list​

(Source: ms-learn, creator/Reference/Content/EntityReference/Examples/EventActions.md)

Event ActionsDescription
add_component_groupAdds component groups to the current entity.
emit_particleEmits a particle specified via the particle attribute.
emit_vibrationAllows the entity to emit a vibration having the entity itself as its source.
play_soundPlays a sound as part of an entity event response.
queue_commandWill queue a slash command or a series of slash commands set in an array to trigger at the end of the tick.
randomize_nodeThe 'randomize' node is an array node that will pick one entry to execute, based on a weight. If no weight is specified, a node will have a weight of 1.0. If you add a weight of 4.0 in one node, and 8.0 in another, then those nodes will have a 33.33% (4 / (4 + 8)) and 66.66% (8 / (4 + 8)) chance of executing, respectively.
remove_component_groupRemoves component groups from the current entity.
reset_targetResets the entities' target (the focus of its gaze, attacking behavior, etc.).
sequence_nodeExecutes actions in sequence.
Set Entity PropertySets the value of an entity property.
set_propertySets the value of an entity property.
triggerTriggers additional entity events when hit.
Sources
idSourceLicenseCommitAccessed
ms-learnMinecraft Creator documentation (Microsoft Learn)CC BY 4.0 (documentation), MIT (code)a9fd1c02026-11-13