Skip to main content

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

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

Allows an entity to attack by using ranged shots. "charge_shoot_trigger" must be greater than 0 to enable charged up burst-shot attacks. Requires minecraft:shooter to define projectile behaviour.

Entity Ranged Attack Behavior Properties​

NameDefault ValueTypeDescriptionExample Values
attack_interval{"max":-1,"min":-1}Attack Interval itemReload-time range (in seconds), when not using a charged shot.Blaze: {"min":3,"max":5}, Bogged: {"min":3.5,"max":3.5}, {"min":2.5,"max":2.5}
attack_interval_max0Decimal numberMaximum bound for reload-time range (in seconds), when not using a charged shot. Reload-time range scales with target-distance.
attack_interval_min0Decimal numberMinimum bound for reload-time range (in seconds), when not using a charged shot. Reload-time range scales with target-distance.
attack_radius0Decimal numberMinimum distance to target before this entity will attempt to shoot.
attack_radius_min0Decimal numberMinimum distance the target can be for this mob to fire. If the target is closer, this mob will move first before firing
attack_range{"max":0,"min":0}Attack Range itemRange of distances from the target within which the entity can perform a ranged attack. Check that the limits imposed on the range (minimum, maximum and maximum distance between values) are respectedBlaze: {"min":0,"max":48}, Bogged: {"min":0,"max":15}, Drowned: {"min":0,"max":10}
burst_interval0Decimal numberTime (in seconds) between each individual shot when firing a burst of shots from a charged up attack. Value must be > 0.Blaze: 0.3
burst_shots1Integer numberNumber of shots fired every time the attacking entity uses a charged up attack.Blaze: 3
charge_charged_trigger0Decimal numberTime (in seconds, then add "charge_shoot_trigger"), before a charged up attack is done charging. Charge-time decays while target is not in sight. Value must be > 0.Llama: 1
charge_shoot_trigger0Decimal numberAmount of time (in seconds, then doubled) a charged shot must be charging before reloading burst shots. Charge-time decays while target is not in sight. Value must be > 0.Blaze: 4, Llama: 2
control_flags[]Control Flags choices
in_range_movement_modehold_positionIn Range Movement Mode choicesControls how the entity moves while its target is within the configured attack range.
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.Blaze: 3, Llama: 2, Parched: 1
ranged_fov90Decimal numberField of view (in degrees) when using sensing to detect a target for attack.
set_persistentfalseBoolean true/falseAllows the actor to be set to persist upon targeting a player
speed_multiplier1Decimal numberDuring attack behavior, this multiplier modifies the entity's speed when moving toward the target. Value must be > 0.
swingfalseBoolean true/falseIf a swing animation (using variable.attack_time) exists, this causes the actor to swing their arm(s) upon firing the ranged attack.Drowned: true
target_in_sight_time1Decimal numberMinimum amount of time (in seconds) the attacking entity needs to see the target before moving toward it. 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.
y_max_head_rotation30Decimal numberMaximum rotation (in degrees), on the Y-axis, this entity can rotate its head while trying to look at the target.

attack_interval​

Reload-time range (in seconds), when not using a charged shot. Reload-time range scales with target-distance. Check that the limits imposed on the range (minimum, maximum and maximum distance between values) are respected.

in_range_movement_mode​

Controls how the entity moves while its target is within the configured attack range. "hold_position" makes the entity stop and hold its position while facing and attacking the target. "follow_target" makes the entity continue moving toward the target while attacking, stopping just outside the minimum attack range.

Legacy FloatRange​

Legacy FloatRange Properties​

JSON path: attack_interval

NameDefault ValueTypeDescription
max0Decimal number
min0Decimal number

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

In Range Movement Mode choices​

ValueTitleDescription
follow_targetFollow target
hold_positionHold position

Samples​

Blaze​
"minecraft:behavior.ranged_attack": {
"charge_shoot_trigger": 4,
"attack_interval": {
"min": 3,
"max": 5
},
"attack_range": {
"min": 0,
"max": 48
},
"burst_interval": 0.3,
"burst_shots": 3,
"priority": 3
}
Bogged​

At /minecraft:entity/component_groups/minecraft:ranged_attack/minecraft:behavior.ranged_attack/:

"minecraft:behavior.ranged_attack": {
"attack_interval": {
"min": 3.5,
"max": 3.5
},
"attack_range": {
"min": 0,
"max": 15
},
"priority": 0
}

At /minecraft:entity/component_groups/minecraft:ranged_attack_hard/minecraft:behavior.ranged_attack/:

"minecraft:behavior.ranged_attack": {
"attack_interval": {
"min": 2.5,
"max": 2.5
},
"attack_range": {
"min": 0,
"max": 15
},
"priority": 0
}
Drowned​
"minecraft:behavior.ranged_attack": {
"attack_interval": {
"min": 1,
"max": 3
},
"attack_range": {
"min": 0,
"max": 10
},
"priority": 3,
"swing": true
}
Llama​

At /minecraft:entity/component_groups/minecraft:llama_angry/minecraft:behavior.ranged_attack/:

"minecraft:behavior.ranged_attack": {
"priority": 2,
"attack_range": {
"max": 64
},
"charge_shoot_trigger": 2,
"charge_charged_trigger": 1
}
Parched​

At /minecraft:entity/component_groups/minecraft:ranged_attack/minecraft:behavior.ranged_attack/:

"minecraft:behavior.ranged_attack": {
"attack_interval": {
"min": 3.5,
"max": 3.5
},
"attack_range": {
"min": 0,
"max": 15
},
"priority": 1
}

At /minecraft:entity/component_groups/minecraft:ranged_attack_hard/minecraft:behavior.ranged_attack/:

"minecraft:behavior.ranged_attack": {
"attack_interval": {
"min": 2.5,
"max": 2.5
},
"attack_range": {
"min": 0,
"max": 15
},
"priority": 1
}

minecraft:behavior.receive_love​

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

Allows the villager to stop so another villager can breed with it. Can only be used by a Villager.

Entity Receive Love 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.

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Samples​

minecraft:behavior.restrict_open_door​

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

Allows the mob to stay indoors during night time.

Entity Restrict Open Door 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.

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Samples​

minecraft:behavior.restrict_sun​

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

Allows the mob to automatically start avoiding the sun when its a clear day out.

Entity Restrict Sun 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.

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

minecraft:behavior.rise_to_liquid_level​

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

Allows the mob to stay at a certain level when in liquid.

Entity Rise To Liquid Level Behavior Properties​

NameDefault ValueTypeDescriptionExample Values
control_flags[]Control Flags choices
liquid_y_offset0Decimal numberTarget distance down from the liquid surface. i.e. Positive values move the target Y down.Strider: 0.25
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.
rise_delta0Decimal numberMovement up in Y per tick when below the liquid surface.Strider: 0.01
sink_delta0Decimal numberMovement down in Y per tick when above the liquid surface.Strider: 0.01

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Samples​

Strider​
"minecraft:behavior.rise_to_liquid_level": {
"priority": 0,
"liquid_y_offset": 0.25,
"rise_delta": 0.01,
"sink_delta": 0.01
}

minecraft:behavior.roar​

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

Allows this entity to roar at another entity based on data in minecraft:anger_level. Once the anger threshold specified in minecraft:anger_level has been reached, this entity will roar for the specified amount of time, look at the other entity, apply anger boost towards it, and finally target it.

[!Note] Requires the following component in order to work properly:

  • Anger Level (minecraft:anger_level)

Entity Roar Behavior Properties​

NameDefault ValueTypeDescriptionExample Values
control_flags[]Control Flags choices
duration0Decimal numberThe amount of time to roar for.Warden: 4.2
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.Warden: 2

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Samples​

Warden​
"minecraft:behavior.roar": {
"duration": 4.2,
"priority": 2
}

minecraft:behavior.roll​

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

This allows the mob to roll forward.

Entity Roll 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.
probability0.019999999552965164Decimal numberThe probability that the mob will use the goal.

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Samples​

minecraft:behavior.run_around_like_crazy​

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

Allows the mob to run around aimlessly.

Entity Run Around Like Crazy Behavior Properties​

NameDefault ValueTypeDescriptionExample Values
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.Llama: 1
speed_multiplier1Decimal numberMovement speed multiplier of the mob when using this AI GoalLlama: 1.2

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Samples​

Llama​
"minecraft:behavior.run_around_like_crazy": {
"priority": 1,
"speed_multiplier": 1.2
}

minecraft:behavior.scared​

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

Allows the mob to become scared when the weather outside is thundering.

Entity Scared 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.
sound_delay0Integer numberThe interval in which a sound will play when active in a 1/delay chance to kick off.
sound_interval0Integer numberThe interval in which a sound will play when active in a 1/delay chance to kick off.

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Samples​

minecraft:behavior.send_event​

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

Allows the mob to send an event to another mob.

Entity Send Event Behavior Properties​

NameDefault ValueTypeDescription
cast_durationnot setDecimal numberTime in seconds for the entire event sending process
control_flags[]Control Flags choices
event_choices[]Array of Event Choices itemsList of possible events to send with conditions, weights, and targeting parameters.
look_at_targettrueBoolean true/falseIf true, the mob will face the entity it sends an event to
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.
sequencenot setArray of Sequence itemsList of events to send

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Entity SendEventChoice​

Entity SendEventChoice Properties​

JSON path: event_choices

NameDefault ValueTypeDescription
cast_duration0Decimal numberTime in seconds for the entire event sending process
cooldown_time0Decimal numberTime in seconds the mob has to wait before using this spell again
do_castingtrueBoolean true/falseIf true, the mob will show a casting animation while sending the event
filters (Filters){"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null}Filters itemConditions that the target must meet to be eligible for receiving the event
filters (Alternate 1)not setObject
look_at_targettrueBoolean true/falseIf true, the mob will face the entity it sends an event to
max_activation_range32Decimal numberMaximum distance in blocks the target can be for this spell to activate
min_activation_range1Decimal numberMinimum distance in blocks the target must be for this spell to activate
particle_color[255, 255, 255, 255]StringThe color of the particles spawned while casting this spell
particle_color (as Array of numbers)not setArray of numbers
sequence[]Array of Sequence itemsList of events to send
start_sound_eventStringThe sound event to play when this spell starts
weight0Decimal numberRelative weight of this spell choice when randomly selected from valid choices
Filters​
Filters Properties​

JSON path: event_choices > 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.
Entity SendEventStage​
Entity SendEventStage Properties​

JSON path: event_choices > sequence

NameDefault ValueTypeDescription
base_delay0Decimal numberAmount of time in seconds before starting this step
eventStringThe event to send to the entity
sound_eventStringThe sound event to play when this step happens

Sequence​

List of events to send.

Sequence Properties​

JSON path: sequence

NameDefault ValueTypeDescription
base_delay0Decimal numberAmount of time in seconds before starting this step
eventnot setMinecraft Event TriggerThe event to send to the entity
sound_eventnot setMinecraft Event TriggerThe sound event to play when this step happens

Samples​

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