minecraft:behavior.move_around_target
Allows an entity to move around a target.If the entity is too close(i.e.closer than destination range min and height difference limit) it will try to move away from its target.If the entity is too far away from its target it will try to move closer to a random position within the destination range.A randomized amount of those positions will be behind the target, and the spread can be tweaked with 'destination_pos_spread_degrees'.
Properties
| Property | Type | Default | What it does |
|---|---|---|---|
destination_position_range | Object | {"max": 8, "min": 4} | The range of distances from the target entity within which the goal should look for a position to move the owner entity to. |
min | Decimal | 0 | |
max | Decimal | 0 | |
movement_speed | Decimal | 0.6 | The speed with which the entity should move to its target position. |
destination_pos_spread_degrees | Decimal | 90 | This angle (in degrees) is used for controlling the spread when picking a destination position behind the target. A zero spread angle means the destination position will be straight behind the target with no variance. A 90 degree spread angle means the destination position can be up to 45 degrees to the left and to the right of the position straight behind the target's view direction. |
filters | Object or List of object | {"AND": null, "NOT": null, "OR": null, "all": null, "all_… | Conditions that need to be met for the behavior to start. |
test | Text | — | The name of the test to apply. |
subject | Boolean or Integer or Decimal or Text | — | The subject of this filter test. |
operator | Boolean or Integer or Decimal or Text | — | The comparison to apply with 'value'. |
domain | Boolean or Integer or Decimal or Text | — | The domain the test should be performed in. |
value | Boolean or Integer or Decimal or Text | — | The value being compared with the test. |
height_difference_limit | Decimalmin 0 | 10 | Distance in height (in blocks) between the owner entity and the target has to be less than this value when owner checks if it is too close and should move away from the target. This value needs to be bigger than zero for the move away logic to trigger. |
horizontal_search_distance | Integermin 0 | 5 | Horizontal search distance (in blocks) when searching for a position to move away from target. |
vertical_search_distance | Integermin 0 | 5 | Vertical search distance (in blocks) when searching for a position to move away from target. |
priority | Integermin 0 | 0 | |
control_flags | List of text | [] |
Example from the game files
This is how vanilla Breeze uses it in Minecraft Bedrock 1.26.60.5:
{
"minecraft:behavior.move_around_target": {
"destination_pos_spread_degrees": 360,
"destination_position_range": {
"min": 4.0,
"max": 8.0
},
"priority": 3,
"filters": {
"all_of": [
{
"test": "on_ground",
"value": true
},
{
"operator": "<=",
"test": "target_distance",
"subject": "self",
"value": 24.0
}
]
},
"height_difference_limit": 0,
"movement_speed": 1.2
}
}Used by 1
Vanilla entities with minecraft:behavior.move_around_target in their definition:
Related components
behavior.hurt_by_targetbehavior.follow_target_captainbehavior.defend_trusted_targetbehavior.defend_village_targetbehavior.jump_around_targetbehavior.look_at_targetbehavior.move_towards_targetbehavior.owner_hurt_by_targetbehavior.owner_hurt_targetbehavior.stalk_and_pounce_on_targetbehavior.target_when_pushedbehavior.wither_target_highest_damagebehavior.follow_target_leaderbehavior.vex_copy_owner_target