Skip to main content

Entity AI goal reference (26/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.ocelot_sit_on_block​

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

Allows to mob to be able to sit in place like the ocelot.

Entity Ocelot Sit On Block Behavior Properties​

NameDefault ValueTypeDescription
control_flags[]Control Flags choices
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.
speed_multiplier1Decimal numberMovement speed multiplier of the mob when using this goal.

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Samples​

minecraft:behavior.ocelotattack​

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

Controls specific attack behavior for Ocelots.

Entity Ocelotattack Behavior Properties​

NameDefault ValueTypeDescription
control_flags[]Control Flags choices
cooldown_time1Decimal numberTime (in seconds) between attacks. Value must be > 0.
max_distance15Decimal numberMax distance from the target, this entity will use this attack behavior. Value must be > 0.
max_sneak_range15Decimal numberMax distance from the target, this entity starts sneaking. Value must be > 0.
max_sprint_range4Decimal numberMax distance from the target, this entity starts sprinting (sprinting takes priority over sneaking). Value must be > 0.
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.
reach_multiplier2Decimal numberUsed with the base size of the entity to determine minimum target-distance before trying to deal attack damage. Value must be > 0.
sneak_speed_multiplier0.6000000238418579Decimal numberModifies the attacking entity's movement speed while sneaking. Value must be > 0.
sprint_speed_multiplier1.3300000429153442Decimal numberModifies the attacking entity's movement speed while sprinting. Value must be > 0.
walk_speed_multiplier0.800000011920929Decimal numberModifies the attacking entity's movement speed when not sneaking or sprinting, but still within attack range. Value must be > 0.
x_max_rotation30Decimal numberMaximum rotation (in degrees), on the X-axis, this entity can rotate while trying to look at the target. Value must be > 0.
y_max_head_rotation30Decimal numberMaximum rotation (in degrees), on the Y-axis, this entity's head can rotate while trying to look at the target. Value must be > 0.

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Samples​

minecraft:behavior.offer_flower​

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

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

[!Note] Requires a flower item to be held by the entity.

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

  • Villager (minecraft:villager)

Entity Offer Flower Behavior Properties​

NameDefault ValueTypeDescriptionExample Values
chance_to_start0.0001250000059371814Decimal numberPercent chance that the mob will start this goal from 0.0 to 1.0 (where 1.0 = 100%). Value must be <= 1.
control_flags[]Control Flags choices
filters (Filters){"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null}Filters itemConditions that need to be met for the behavior to start.Iron Golem: {"test":"is_daytime"}
filters (Alternate 1)not setObject
max_head_rotation_y30Decimal numberMaximum rotation (in degrees), on the Y-axis, this entity can rotate its head while trying to look at the target.
max_offer_flower_duration20Decimal numberThe max amount of time (in seconds) that the mob will offer the flower for before exiting the Goal.
max_rotation_x30Decimal numberMaximum rotation (in degrees), on the X-axis, this entity can rotate while trying to look at the target.
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.Iron Golem: 5
search_area[6, 2, 6]Array of numbersThe dimensions of the AABB used to search for a potential mob to offer flower to.
search_area (Search Area)not setSearch Area (Search Area) item

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

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.

Search Area (Search Area)​

Search Area Properties​

JSON path: search_area

NameDefault ValueTypeDescription
x0Decimal number
y0Decimal number
z0Decimal number

Samples​

Iron Golem​
"minecraft:behavior.offer_flower": {
"filters": {
"test": "is_daytime"
},
"priority": 5
}

minecraft:behavior.open_door​

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

Allows the mob to open doors. Requires the mob to be able to path through doors, otherwise the mob won't even want to try opening them.

Entity Open Door Behavior Properties​

NameDefault ValueTypeDescription
close_door_aftertrueBoolean true/falseIf true, the mob will close the door after opening it and going through it.
control_flags[]Control Flags choices
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Samples​

minecraft:behavior.owner_hurt_by_target​

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

Allows the mob to target another mob that hurts their owner.

[!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.

Entity Owner Hurt By Target Behavior Properties​

NameDefault ValueTypeDescription
control_flags[]Control Flags choices
entity_types[]Array of Entity Types itemsList of entity types that this mob can target if they hurt their owner
entity_types (Entity Types)not setEntity Types (Entity Types) item
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Entity Types​

List of entity types that this mob can target if they hurt their owner.

Entity Types Properties​

JSON path: entity_types

NameDefault ValueTypeDescription
reevaluate_descriptionfalseBoolean true/falseIf true, the targeting entity will continuously reevaluate the target and stop attacking if the target no longer meets the filter conditions.

Entity Types (Entity Types)​

Entity Types Properties​

JSON path: entity_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: entity_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.owner_hurt_target​

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

Allows the mob to target a mob that is hurt by their owner.

[!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.

Entity Owner Hurt Target Behavior Properties​

NameDefault ValueTypeDescription
control_flags[]Control Flags choices
entity_types[]Array of Entity Types itemsList of entity types that this entity can target if the potential target is hurt by this mob's owner
entity_types (Entity Types)not setEntity Types (Entity Types) item
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Entity Types​

List of entity types that this entity can target if the potential target is hurt by this mob's owner.

Entity Types Properties​

JSON path: entity_types

NameDefault ValueTypeDescription
cooldown0Decimal numberThe amount of time in seconds that the mob has to wait before selecting a target of the same type again
filtersnot setMinecraft filterConditions that make this entry in the list valid
max_dist16Decimal numberMaximum distance this mob can be away to be a valid choice
must_seefalseBoolean true/falseIf true, the mob has to be visible to be a valid choice
must_see_forget_duration3Decimal 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
reevaluate_descriptionfalseBoolean true/falseIf true, the mob will stop being targeted if it stops meeting any conditions.
sprint_speed_multiplier1Decimal numberMultiplier for the running 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

Entity Types (Entity Types)​

Entity Types Properties​

JSON path: entity_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: entity_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​

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