Skip to main content

Entity component reference (6/23)

This page carries the component pages of MS Learn (MicrosoftDocs/minecraft-creator a9fd1c0, CC BY 4.0). IDs, property names, types, default values and JSON are as in the original. The full list is in the index.

minecraft:entity_sensor​

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

A component that owns multiple subsensors, each one firing an event when a set of conditions are met by other entities within the defined range.

Entity Sensor Properties​

NameDefault ValueTypeDescriptionExample Values
find_players_onlyfalseBoolean true/falseLimits the search to Players only for all subsensors.
relative_rangetrueBoolean true/falseIf true the subsensors' range is additive on top of the entity's size.
subsensorsnot setArray of Subsensors itemsThe list of subsensors which sense for entities and emit events when all their conditions are met.Parrot: [{"event":"minecraft:on_riding_player","event_filters":{"all_of":[{"test":"is_riding","operator":"equals","subject":"self","value":true},{"test":"has_component","operator":"equals","subject":"self","value":"minecraft:behavior.look_at_player"}]},"range":[2,2]}], [{"event":"minecraft:on_not_riding_player","event_filters":{"all_of":[{"test":"is_riding","operator":"equals","subject":"self","value":false},{"test":"has_component","operator":"not","subject":"self","value":"minecraft:behavior.look_at_player"}]},"range":[2,2]}]

Subsensors​

The list of subsensors which sense for entities and emit events when all their conditions are met.

Subsensors Properties​

JSON path: subsensors

NameDefault ValueTypeDescription
cooldown-1Decimal numberHow many seconds should elapse before the subsensor can once again sense for entities.
eventnot setMinecraft Event TriggerEvent to fire when the conditions are met.
event_filtersnot setMinecraft filterThe set of conditions that must be satisfied to fire the event.
maximum_count-1Integer numberThe maximum number of entities that must pass the filter conditions for the event to send.
minimum_count1Integer numberThe minimum number of entities that must pass the filter conditions for the event to send.
range[10, 10]a, b coordinate arrayThe maximum horizontal and vertical distance another entity can be from this and have the filters checked against it.
require_allfalseBoolean true/falseIf true requires all nearby entities to pass the filter conditions for the events to send.
y_offset0Decimal numberVertical offset applied to the entity's position when computing the distance from other entities.
cooldown​

How many seconds should elapse before the subsensor can once again sense for entities. The cooldown is applied on top of the base 1 tick (0.05 seconds) delay. Negative values will result in no cooldown being used.

Samples​

Parrot​

At /minecraft:entity/component_groups/minecraft:parrot_not_riding_player/minecraft:entity_sensor/:

"minecraft:entity_sensor": {
"relative_range": false,
"subsensors": [
{
"event": "minecraft:on_riding_player",
"event_filters": {
"all_of": [
{
"test": "is_riding",
"operator": "equals",
"subject": "self",
"value": true
},
{
"test": "has_component",
"operator": "equals",
"subject": "self",
"value": "minecraft:behavior.look_at_player"
}
]
},
"range": [
2,
2
]
}
]
}

At /minecraft:entity/component_groups/minecraft:parrot_riding_player/minecraft:entity_sensor/:

"minecraft:entity_sensor": {
"relative_range": false,
"subsensors": [
{
"event": "minecraft:on_not_riding_player",
"event_filters": {
"all_of": [
{
"test": "is_riding",
"operator": "equals",
"subject": "self",
"value": false
},
{
"test": "has_component",
"operator": "not",
"subject": "self",
"value": "minecraft:behavior.look_at_player"
}
]
},
"range": [
2,
2
]
}
]
}

minecraft:environment_sensor​

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

Creates a trigger based on environment conditions.

Environment Sensor Properties​

NameDefault ValueTypeDescriptionExample Values
triggersnot setArray of objectsThe list of triggers that fire when the environment conditions match the given filter criteria. Can be an array of trigger objects or a single trigger object.Breeze: [{"event":"minecraft:stop_playing_idle_ground_sound","filters":{"all_of":[{"subject":"self","test":"on_ground","value":true},{"subject":"self","test":"has_target","value":true},{"domain":"minecraft:is_playing_idle_ground_sound","operator":"==","test":"bool_property"}]}},{"event":"minecraft:start_playing_idle_ground_sound","filters":{"all_of":[{"domain":"minecraft:is_playing_idle_ground_sound","operator":"!=","test":"bool_property"},{"any_of":[{"subject":"self","test":"on_ground","value":false},{"subject":"self","test":"has_target","value":false}]}]}}], Cave Spider: {"event":"minecraft:become_neutral","filters":{"operator":">","test":"is_brightness","value":0.49}}, {"event":"minecraft:become_hostile","filters":{"operator":"<","test":"is_brightness","value":0.49}}
triggers (as Object)not setObject

Samples​

Breeze​
"minecraft:environment_sensor": {
"triggers": [
{
"event": "minecraft:stop_playing_idle_ground_sound",
"filters": {
"all_of": [
{
"subject": "self",
"test": "on_ground",
"value": true
},
{
"subject": "self",
"test": "has_target",
"value": true
},
{
"domain": "minecraft:is_playing_idle_ground_sound",
"operator": "==",
"test": "bool_property"
}
]
}
},
{
"event": "minecraft:start_playing_idle_ground_sound",
"filters": {
"all_of": [
{
"domain": "minecraft:is_playing_idle_ground_sound",
"operator": "!=",
"test": "bool_property"
},
{
"any_of": [
{
"subject": "self",
"test": "on_ground",
"value": false
},
{
"subject": "self",
"test": "has_target",
"value": false
}
]
}
]
}
}
]
}
Cave Spider​

At /minecraft:entity/component_groups/minecraft:spider_hostile/minecraft:environment_sensor/:

"minecraft:environment_sensor": {
"triggers": {
"event": "minecraft:become_neutral",
"filters": {
"operator": ">",
"test": "is_brightness",
"value": 0.49
}
}
}

At /minecraft:entity/component_groups/minecraft:spider_neutral/minecraft:environment_sensor/:

"minecraft:environment_sensor": {
"triggers": {
"event": "minecraft:become_hostile",
"filters": {
"operator": "<",
"test": "is_brightness",
"value": 0.49
}
}
}
Dolphin​

At /minecraft:entity/component_groups/dolphin_swimming_navigation/minecraft:environment_sensor/:

"minecraft:environment_sensor": {
"triggers": [
{
"filters": {
"all_of": [
{
"test": "on_ground",
"operator": "==",
"value": true
},
{
"test": "in_water",
"operator": "!=",
"value": true
}
]
},
"event": "navigation_on_land"
}
]
}

At /minecraft:entity/component_groups/dolphin_on_land_in_rain/minecraft:environment_sensor/:

"minecraft:environment_sensor": {
"triggers": [
{
"filters": {
"test": "in_water",
"operator": "==",
"value": true
},
"event": "navigation_off_land"
},
{
"filters": {
"test": "in_water_or_rain",
"operator": "!=",
"value": true
},
"event": "start_dryingout"
}
]
}
Drowned​

At /minecraft:entity/component_groups/minecraft:look_to_start_transformations/minecraft:environment_sensor/:

"minecraft:environment_sensor": {
"triggers": [
{
"event": "minecraft:start_transforming_into_zombie",
"filters": {
"all_of": [
{
"test": "in_block",
"value": "minecraft:powder_snow"
},
{
"test": "has_equipment_tag",
"domain": "armor",
"operator": "not",
"value": "minecraft:leather_tier"
}
]
}
}
]
}

At /minecraft:entity/component_groups/minecraft:start_zombie_transformation/minecraft:environment_sensor/:

"minecraft:environment_sensor": {
"triggers": [
{
"event": "minecraft:stop_transforming",
"filters": {
"any_of": [
{
"test": "in_block",
"operator": "not",
"value": "minecraft:powder_snow"
},
{
"test": "has_equipment_tag",
"domain": "armor",
"value": "minecraft:leather_tier"
}
]
}
}
]
}
Player​
"minecraft:environment_sensor": {
"triggers": {
"event": "minecraft:gain_raid_omen",
"filters": {
"all_of": [
{
"subject": "self",
"test": "has_mob_effect",
"value": "bad_omen"
},
{
"subject": "self",
"test": "is_in_village",
"value": true
}
]
}
}
}

minecraft:equip_item​

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

The entity puts on the desired equipment.

Equip Item Properties​

NameDefault ValueTypeDescriptionExample Values
can_wear_armorfalseBoolean true/falseIf true, the entity can pick up and wear armor items from the ground.
excluded_itemsnot setArray of Excluded Items itemsList of items that the entity should not equip.Bogged: [{"item":"minecraft:banner:15"},{"item":"minecraft:wolf_armor"},{"tags":"q.any_tag('minecraft:horse_armor', 'minecraft:nautilus_armor')"}]

Excluded Items​

Excluded Item Properties​

JSON path: excluded_items

NameDefault ValueTypeDescription
itemnot setString

Samples​

Bogged​
"minecraft:equip_item": {
"excluded_items": [
{
"item": "minecraft:banner:15"
},
{
"item": "minecraft:wolf_armor"
},
{
"tags": "q.any_tag('minecraft:horse_armor', 'minecraft:nautilus_armor')"
}
]
}

minecraft:equipment​

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

Sets the Equipment table to use for this Entity.

Equipment Properties​

NameDefault ValueTypeDescription
slot_drop_chancenot setArray of stringsA list of slots with the chance to drop an equipped item from that slot. Can be an array of slot name strings or an array of objects with slot and drop_chance properties.
slot_drop_chance (Slot Drop Chance Item)not setArray of Slot Drop Chance (Slot Drop Chance Item) items
tablenot setStringThe file path to the equipment table, relative to the behavior pack's root.

Slot Drop Chance (Slot Drop Chance Item)​

Slot Drop Chance Item Properties​

JSON path: slot_drop_chance

NameDefault ValueTypeDescription
drop_chancenot setDecimal numberThe chance to drop the equipped item (0.0 to 1.0).
slotnot setStringThe equipment slot name.

Samples​

minecraft:equippable​

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

Defines an entity's behavior for having items equipped to it.

[!Note] In 1.26.0, on_equip and on_unequip events on each slot no longer fire on world load; they now run only as a result of an in-game equip or unequip interaction.

Equippable Properties​

NameDefault ValueTypeDescriptionExample Values
slotsnot setArray of Slots itemsList of slots and the item that can be equipped.Llama: [{"slot":1,"item":"carpet","accepted_items":["carpet"]}]

Slots​

List of slots and the item that can be equipped.

Slots Properties​

JSON path: slots

NameDefault ValueTypeDescription
accepted_itemsnot setArray of stringsThe list of items that can go in this slot.
interact_textnot setStringText to be displayed when the entity can be equipped with this item when playing with Touch-screen controls.
itemnot setStringIdentifier of the item that can be equipped for this slot.
on_equipnot setMinecraft Event TriggerEvent to trigger when this entity is equipped with this item.
on_unequipnot setMinecraft Event TriggerEvent to trigger when this item is removed from this entity.
slot0Integer numberThe slot number of this slot.

Samples​

Llama​
"minecraft:equippable": {
"slots": [
{
"slot": 1,
"item": "carpet",
"accepted_items": [
"carpet"
]
}
]
}

minecraft:exhaustion_values​

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

Defines how much exhaustion each player action should take.

Entity Exhaustion Values Properties​

NameDefault ValueTypeDescriptionExample Values
attack0.10000000149011612Decimal numberAmount of exhaustion applied when attacking.Player: 0.1
damage0.10000000149011612Decimal numberAmount of exhaustion applied when taking damage.Player: 0.1
heal6Decimal numberAmount of exhaustion applied when healed through food regeneration.Player: 6
jump0.05000000074505806Decimal numberAmount of exhaustion applied when jumping.Player: 0.05
lunge4Decimal numberAmount of exhaustion applied when triggering the Lunge enchantment, multiplied by the enchantment level. This item requires a format version of at least 1.21.130.Player: 4
mine0.004999999888241291Decimal numberAmount of exhaustion applied when mining.Player: 0.005
sprint0.009999999776482582Decimal numberAmount of exhaustion applied when sprinting.Player: 0.1
sprint_jump0.20000000298023224Decimal numberAmount of exhaustion applied when sprint jumping.Player: 0.2
swim0.009999999776482582Decimal numberAmount of exhaustion applied when swimming.Player: 0.01
walk0Decimal numberAmount of exhaustion applied when walking.

Samples​

Player​
"minecraft:exhaustion_values": {
"sprint": 0.1,
"jump": 0.05,
"attack": 0.1,
"damage": 0.1,
"heal": 6,
"lunge": 4,
"sprint_jump": 0.2,
"mine": 0.005,
"swim": 0.01,
"walk": 0
}
Sources
idSourceLicenseCommitAccessed
ms-learnMinecraft Creator documentation (Microsoft Learn)CC BY 4.0 (documentation), MIT (code)a9fd1c02026-11-13