1. Wiki
  2. /Entities
  3. /minecraft:behavior.move_around_target

minecraft:behavior.move_around_target

Don't want to write this by hand? GodCraft sets minecraft:behavior.move_around_target for you with a switch.Get GodCraft

Overview

minecraft:behavior.move_around_target is an entity component: it goes in the components object of a custom mob, or in one of its component groups. AI goal that keeps the mob at a good distance from its target: it backs off when too close and moves to a random spot nearer when too far.

Fields

FieldTypeDefaultDescription
destination_position_rangeFloatRange{"max":8,"min":4}Closest and farthest from the target that the mob looks for a spot to move to.
movement_speednumber0.6How fast the mob moves to the chosen spot.
destination_pos_spread_degreesnumber90How wide, in degrees, the chosen spot behind the target can vary. 0 picks straight behind it.
filtersFilter Group{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null}Conditions that must pass before the goal starts.
height_difference_limitnumber10The mob only counts as too close if the height gap to the target is below this.Range: 0 to …
horizontal_search_distanceinteger5How far sideways, in blocks, the mob searches for a spot away from the target.Range: 0 to …
vertical_search_distanceinteger5How far up and down, in blocks, the mob searches for a spot away from the target.Range: 0 to …
priorityinteger0Lower numbers run first: when two goals compete, the one with the smaller priority wins.Range: 0 to …
control_flagsGoal's control flags[]noneWhich body parts this goal takes over (move, look, jump), so goals using the same parts cannot run together.

Example

Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):

BP/entities/<name>.json
{
  "minecraft:behavior.move_around_target": {
    "destination_position_range": {
      "max": 8,
      "min": 4
    },
    "movement_speed": 0.6,
    "destination_pos_spread_degrees": 90,
    "filters": {
      "AND": null,
      "NOT": null,
      "OR": null,
      "all": null,
      "all_of": null,
      "any": null,
      "any_of": null,
      "none_of": null
    },
    "height_difference_limit": 10,
    "horizontal_search_distance": 5,
    "vertical_search_distance": 5,
    "priority": 0
  }
}

We use cookies to improve your experience and analyse site traffic. Learn more