跳转至

Move Around Target

文档版本:1.21.50.25

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_search_spread_degrees'.

架构

move_around_target:
{
  priority "priority"
  number "destination_pos_search_spread_degrees" : opt
  vector_of_2_items "destination_position_range"
  number "height_difference_limit" : opt
  integer "horizontal_search_distance" : opt
  number "movement_speed" : opt
  integer "vertical_search_distance" : opt
  filters "filters"
}
prioritypriority
priority:
integer
destination_pos_search_spread_degreesnumber
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.
destination_position_rangevector_of_2_items
The range of distances from the target entity within which the goal should look for a position to move the owner entity to.
vector_of_2_items:
array
{
  number "0..0" : opt
  number "1..1" : opt
}
0..0number
The X component.
1..1number
The Y component.
height_difference_limitnumber
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_distanceinteger
Horizontal search distance (in blocks) when searching for a position to move away from target.
movement_speednumber
The speed with which the entity should move to its target position.
vertical_search_distanceinteger
Number of ticks needed to complete a stay at the block.
filtersfilters
一个过滤器组。Conditions that need to be met for the behavior to start.