Skip to main content

Entity AI goal reference (28/41)

This page carries the AI goal (behavior) 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:behavior.pet_sleep_with_owner​

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

Allows the pet mob to move onto a bed with its owner while sleeping.

[!Note] Requires a player to be set as the tame owner via taming (or the tame command, or the tame API on EntityTameableComponent) in order to work properly.

Pet Sleep With Owner Behavior Properties​

NameDefault ValueTypeDescription
goal_radius0.5Decimal numberDistance in blocks within the mob considers it has reached the goal. This is the "wiggle room" to stop the AI from bouncing back and forth trying to reach a specific spot.
prioritynot setInteger numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.
search_height1Integer numberHeight in blocks from the owner the pet can be to sleep with owner.
search_range0Integer numberThe distance in blocks from the owner the pet can be to sleep with owner.
speed_multiplier1Decimal numberMovement speed multiplier of the mob when using this AI Goal

Samples​

minecraft:behavior.pickup_items​

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

Allows the mob to pick up items on the ground.

Entity Pickup Items Behavior Properties​

NameDefault ValueTypeDescriptionExample Values
can_pickup_any_itemfalseBoolean true/falseIf true, the mob can pick up any itemBogged: true
can_pickup_to_hand_or_equipmenttrueBoolean true/falseIf true, the mob can pick up items to its hand or armor slots
control_flags[]Control Flags choices
cooldown_after_being_attacked0Integer numberTime in seconds the mob cannot pickup items after being attacked
excluded_items[]StringList of items this mob will not pick upBogged: [{"tags":"q.all_tags('minecraft:is_spear')"}], Drowned: [{"name":"minecraft:glow_ink_sac"},{"tags":"q.all_tags('minecraft:is_spear')"}]
excluded_items (as Keyed set of strings)not setKeyed set of strings
goal_radius0.5Decimal numberDistance in blocks within the mob considers it has reached the goal. This is the "wiggle room" to stop the AI from bouncing back and forth trying to reach a specific spot.Allay: 2.2, Bogged: 2
max_dist1Integer numberMaximum distance this mob will look for items to pick upAllay: 32, Bogged: 3
on_pickup_item_end{"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"}Pickup Item End itemEvent to run when this mob either finishes or loses interest in picking up an item. This item requires a format version of at least 1.26.20.
on_pickup_item_start{"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"}Pickup Item Start itemEvent to run when this mob moves to pick up an item. This item requires a format version of at least 1.26.20.
pickup_based_on_chancefalseBoolean true/falseIf true, depending on the difficulty, there is a random chance that the mob may not be able to pickup itemsBogged: true
pickup_same_items_as_in_handfalseBoolean true/falseIf true, the mob will only pick up items that match what it is already holding.Allay: true
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.Allay: 2, Bogged: 5, Drowned: 6
search_height1Integer numberHeight in blocks the mob will search for itemsAllay: 32
speed_multiplier1Decimal numberMovement speed multiplier of the mob when using this AI GoalAllay: 6, Bogged: 1
stop_if_holding_itemfalseBoolean true/falseIf true, the mob will not begin a pickup goal while it is already holding an item. Useful for mobs that should only hold one item at a time. This item requires a format version of at least 1.26.30.
track_targetfalseBoolean true/falseIf true, this mob will chase after the target as long as it's a valid target

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Entity ActorDefinitionTrigger​

Triggers an entity event when specified conditions are met. Events activate component groups that change entity behavior—transforming villagers into zombie villagers, switching mobs to aggressive mode, or triggering growth stages. Combine with filters to create conditional state machines that respond to gameplay.

Entity ActorDefinitionTrigger Properties​

JSON path: on_pickup_item_end

NameDefault ValueTypeDescription
eventString
filters (Filters){"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null}Filters itemFilters allow data objects to specify test criteria which allows their use.
filters (Alternate 1)not setObject
targetselfTarget choices
filters​

Filters allow data objects to specify test criteria which allows their use. Filters can be defined by a single object of type (Filter Test), an array of tests, collection groups, or a combination of these objects.

Filters​
Filters Properties​

JSON path: on_pickup_item_end > filters

NameDefault ValueTypeDescription
domainnot setObjectThe domain the test should be performed in.
operatornot setObjectThe comparison to apply with 'value'.
subjectnot setObjectThe subject of this filter test.
testnot setStringThe name of the test to apply.
valuenot setObjectThe value being compared with the test.

Target choices​

ValueTitleDescription
babyBaby
blockBlock
damagerDamager
holderHolder
itemItem
otherOther
parentParent
playerPlayer
selfSelf
targetTarget

Samples​

Allay​
"minecraft:behavior.pickup_items": {
"can_pickup_any_item": false,
"search_height": 32,
"priority": 2,
"goal_radius": 2.2,
"can_pickup_to_hand_or_equipment": false,
"max_dist": 32,
"pickup_based_on_chance": false,
"pickup_same_items_as_in_hand": true,
"speed_multiplier": 6
}
Bogged​
"minecraft:behavior.pickup_items": {
"can_pickup_any_item": true,
"excluded_items": [
{
"tags": "q.all_tags('minecraft:is_spear')"
}
],
"pickup_based_on_chance": true,
"goal_radius": 2,
"priority": 5,
"max_dist": 3,
"speed_multiplier": 1
}
Drowned​
"minecraft:behavior.pickup_items": {
"can_pickup_any_item": true,
"excluded_items": [
{
"name": "minecraft:glow_ink_sac"
},
{
"tags": "q.all_tags('minecraft:is_spear')"
}
],
"pickup_based_on_chance": true,
"goal_radius": 2,
"priority": 6,
"max_dist": 3,
"speed_multiplier": 1
}
Parched​
"minecraft:behavior.pickup_items": {
"can_pickup_any_item": true,
"excluded_items": [
{
"tags": "q.all_tags('minecraft:is_spear')"
}
],
"pickup_based_on_chance": true,
"goal_radius": 2,
"priority": 6,
"max_dist": 3,
"speed_multiplier": 1
}

minecraft:behavior.place_block​

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

The original has no description. See the property table.

Contents​

  • Can Place
  • Entity ActorDefinitionTrigger
  • Placeable Carried Blocks
  • Entity PlaceBlockGoalWeightedBlockDescriptor
  • Block IntRange

AI goal that makes entities place blocks into the world, like Endermen placing their carried block or snow golems leaving snow trails. Configure which blocks can be placed, where they can be placed, and how often the entity attempts placement. Creates mobs that modify the environment.

[!Note] This item requires a format version of at least 1.21.100.

Entity Place Block Behavior Properties​

NameDefault ValueTypeDescription
affected_by_griefing_ruletrueBoolean true/falseIf true, whether the goal is affected by the mob griefing game rule.
can_place (Can Place){"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null}Can Place itemFilters for if the entity should try to place its block. Self and Target are set.
can_place (Alternate 1)not setObject
chance1Decimal numberChance each tick for the entity to try and place a block. Value must be <= 1.
control_flags[]Control Flags choices
on_place{"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"}Place itemTrigger ran if the entity does place its block. Self, Target, and Block are set.
placeable_carried_blocks (Placeable Carried Blocks)[]Array of Placeable Carried Blocks itemsBlock descriptors for which blocks are valid to be placed from the entity's carried item, if empty all blocks are valid.
placeable_carried_blocks (as String)not setString
placeable_carried_blocks (as Object)not setObject
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.
randomly_placeable_blocks[]Array of Randomly Placeable Blocks itemsWeighted block descriptors for which blocks should be randomly placed, if empty the entity will try to place its carried block from placeable_carried_blocks.
xz_range{"max":2,"min":-2}Xz Range itemXZ range from which the entity will try and place blocks in.
y_range{"max":3,"min":0}y Range itemY range from which the entity will try and place blocks in.

Can Place​

Can Place Properties​

JSON path: can_place

NameDefault ValueTypeDescription
domainnot setObjectThe domain the test should be performed in.
operatornot setObjectThe comparison to apply with 'value'.
subjectnot setObjectThe subject of this filter test.
testnot setStringThe name of the test to apply.
valuenot setObjectThe value being compared with the test.

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Entity ActorDefinitionTrigger​

Triggers an entity event when specified conditions are met. Events activate component groups that change entity behavior—transforming villagers into zombie villagers, switching mobs to aggressive mode, or triggering growth stages. Combine with filters to create conditional state machines that respond to gameplay.

Entity ActorDefinitionTrigger Properties​

JSON path: on_place

NameDefault ValueTypeDescription
eventString
filters (Filters){"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null}Filters itemFilters allow data objects to specify test criteria which allows their use.
filters (Alternate 1)not setObject
targetselfTarget choices
filters​

Filters allow data objects to specify test criteria which allows their use. Filters can be defined by a single object of type (Filter Test), an array of tests, collection groups, or a combination of these objects.

Filters​
Filters Properties​

JSON path: on_place > filters

NameDefault ValueTypeDescription
domainnot setObjectThe domain the test should be performed in.
operatornot setObjectThe comparison to apply with 'value'.
subjectnot setObjectThe subject of this filter test.
testnot setStringThe name of the test to apply.
valuenot setObjectThe value being compared with the test.

Target choices​

ValueTitleDescription
babyBaby
blockBlock
damagerDamager
holderHolder
itemItem
otherOther
parentParent
playerPlayer
selfSelf
targetTarget

Placeable Carried Blocks​

Placeable Carried Blocks Properties​

JSON path: placeable_carried_blocks

NameDefault ValueTypeDescription
nameString
states{}Integer number
states (as String)not setString
states (as Boolean true/false)not setBoolean true/false
tagsString

Entity PlaceBlockGoalWeightedBlockDescriptor​

Entity PlaceBlockGoalWeightedBlockDescriptor Properties​

JSON path: randomly_placeable_blocks

NameDefault ValueTypeDescription
block (Block){"name":"","states":{},"tags":""}Block itemBlock descriptor for this entry.
block (as String)not setString
block (Alternate 2)not setObject
filter (Filter){"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null}Filter itemFilter for if this entry should be randomly selected from. Self, Target, and Block are set.
filter (Alternate 1)not setObject
weight1Integer numberWeight for this entry.
Block​
Block Properties​

JSON path: randomly_placeable_blocks > block

NameDefault ValueTypeDescription
nameString
states{}Integer number
states (as String)not setString
states (as Boolean true/false)not setBoolean true/false
tagsString
Filter​
Filter Properties​

JSON path: randomly_placeable_blocks > filter

NameDefault ValueTypeDescription
domainnot setObjectThe domain the test should be performed in.
operatornot setObjectThe comparison to apply with 'value'.
subjectnot setObjectThe subject of this filter test.
testnot setStringThe name of the test to apply.
valuenot setObjectThe value being compared with the test.

Block IntRange​

Block IntRange Properties​

JSON path: xz_range

NameDefault ValueTypeDescription
max0Integer number
min0Integer number

Samples​

minecraft:behavior.play​

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

Allows the mob to offer a flower to another mob with the minecraft:take_flower behavior.

[!Note] Can only be used on the following type of entity:

  • Villager (minecraft:villager)

Entity Play Behavior Properties​

NameDefault ValueTypeDescription
chance_to_start0.0024999999441206455Decimal numberPercent chance that the mob will start this goal, from 0 to 1. Value must be <= 1.
control_flags[]Control Flags choices
follow_distance2Integer numberThe distance (in blocks) that the mob tries to be in range of the friend it's following.
friend_search_area[6, 3, 6]Array of numbersThe dimensions of the AABB used to search for a potential friend to play with.
friend_search_area (Friend Search Area)not setFriend Search Area (Friend Search Area) item
friend_types[]Array of objectsThe entity type(s) to consider when searching for a potential friend to play with.
friend_types (Friend Types)not setFriend Types (Friend Types) item
max_play_duration_seconds50Decimal numberThe max amount of seconds that the mob will play for before exiting the Goal.
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.
random_pos_search_height3Integer numberThe height (in blocks) that the mob will search within to find a random position position to move to. Must be at least 1. Value must be >= 1.
random_pos_search_range16Integer numberThe distance (in blocks) on ground that the mob will search within to find a random position to move to. Must be at least 1. Value must be >= 1.
speed_multiplier1Decimal numberMovement speed multiplier of the mob when using this AI Goal

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Friend Search Area (Friend Search Area)​

Friend Search Area Properties​

JSON path: friend_search_area

NameDefault ValueTypeDescription
x0Decimal number
y0Decimal number
z0Decimal number

Friend Types (Friend Types)​

Friend Types Properties​

JSON path: friend_types

NameDefault ValueTypeDescription
check_if_outnumberedfalseBoolean true/falseIf true, the mob will check if its outnumbered
cooldown0Integer numberThe amount of time in seconds that the mob has to wait before selecting a target of the same type again
filters (Filters){"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null}Filters itemConditions that make this entry in the list valid
filters (Alternate 1)not setObject
max_dist16Decimal numberMaximum distance this mob can be away to be a valid choice
max_flee10Decimal numberMaximum distance this mob can be from the target to stop fleeing
max_height-1Decimal numberMaximum height this mob can be away to be a valid choice
must_seenot setBoolean true/falseIf true, the mob has to be visible to be a valid choice
must_see_forget_duration3Integer numberDetermines the amount of time in seconds that this mob will look for a target before forgetting about it and looking for a new one when the target isn't visible any more
priority0Integer numberPriority for this mob type
reevaluate_descriptionfalseBoolean true/falseIf true, the mob will stop being targeted if it stops meeting any conditions.
sprint_speed_multiplier1Decimal numberMultiplier for the sprinting speed. A value of 1.0 means the speed is unchanged
walk_speed_multiplier1Decimal numberMultiplier for the walking speed. A value of 1.0 means the speed is unchanged
Filters​
Filters Properties​

JSON path: friend_types > filters

NameDefault ValueTypeDescription
domainnot setObjectThe domain the test should be performed in.
operatornot setObjectThe comparison to apply with 'value'.
subjectnot setObjectThe subject of this filter test.
testnot setStringThe name of the test to apply.
valuenot setObjectThe value being compared with the test.

Samples​

minecraft:behavior.play_dead​

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

Allows this entity to pretend to be dead to avoid being targeted by attackers.

Entity Play Dead Behavior Properties​

NameDefault ValueTypeDescription
apply_regenerationfalseBoolean true/falseWhether the mob will receive the regeneration effect while playing dead.
control_flags[]Control Flags choices
damage_sources[]Damage Sources choicesThe list of Entity Damage Sources that will cause this mob to play dead.
duration1Decimal numberThe amount of time the mob will remain playing dead (in seconds).
filters (Filters){"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null}Filters itemThe list of other triggers that are required for the mob to activate play dead
filters (Alternate 1)not setObject
force_below_health0Integer numberThe amount of health at which damage will cause the mob to play dead.
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.
random_damage_range{"max":0,"min":0}Random Damage Range itemThe range of damage that may cause the goal to start depending on randomness.
random_start_chance1Decimal numberThe likelihood of this goal starting upon taking damage.

random_damage_range​

The range of damage that may cause the goal to start depending on randomness. Damage taken below the min will never cause the goal to start. Damage taken above the max will always cause the goal to start.

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Damage Sources choices​

ValueTitleDescription
allAll
anvilAnvil
block_explosionBlock explosion
campfireCampfire
chargingCharging
contactContact
drowningDrowning
entity_attackEntity attack
entity_explosionEntity explosion
fallFall
falling_blockFalling block
fireFire
fire_tickFire tick
fireworksFireworks
fly_into_wallFly into wall
freezingFreezing
lavaLava
lightningLightning
mace_smashMace smash
magicMagic
magmaMagma
noneNone
overrideOverride
pistonPiston
projectileProjectile
ram_attackRam attack
self_destructSelf destruct
sonic_boomSonic boom
soul_campfireSoul campfire
stalactiteStalactite
stalagmiteStalagmite
starveStarve
suffocationSuffocation
temperatureTemperature
thornsThorns
voidVoid
witherWither

Filters​

Filters Properties​

JSON path: filters

NameDefault ValueTypeDescription
domainnot setObjectThe domain the test should be performed in.
operatornot setObjectThe comparison to apply with 'value'.
subjectnot setObjectThe subject of this filter test.
testnot setStringThe name of the test to apply.
valuenot setObjectThe value being compared with the test.

Block IntRange​

Block IntRange Properties​

JSON path: random_damage_range

NameDefault ValueTypeDescription
max0Integer number
min0Integer number

Samples​

Sources
idSourceLicenseCommitAccessed
ms-learnMinecraft Creator documentation (Microsoft Learn)CC BY 4.0 (documentation), MIT (code)a9fd1c02026-11-13