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

minecraft:behavior.follow_target_leader

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

Overview

minecraft:behavior.follow_target_leader is an entity component: it goes in the components object of a custom mob, or in one of its component groups. AI goal that makes the mob move toward a leader mob and stay near it.

Fields

FieldTypeDefaultDescription
within_radiusnumber0If the leader gets farther than this many blocks, the mob gives up.
follow_distancenumber0How many blocks the mob stays away from the leader.
always_look_for_leaderbooleanfalseIf true, the mob keeps looking for a new leader when it has none or the old one is no longer valid.
leader_filtersFilter Group{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null}Conditions a mob must pass to be a leader.
search_cooldowninteger20Ticks to wait before searching again after losing a leader or failing to find one.
speed_multipliernumber1Speed multiplier while following the leader.
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.follow_target_leader": {
    "within_radius": 0,
    "follow_distance": 0,
    "always_look_for_leader": false,
    "leader_filters": {
      "AND": null,
      "NOT": null,
      "OR": null,
      "all": null,
      "all_of": null,
      "any": null,
      "any_of": null,
      "none_of": null
    },
    "search_cooldown": 20,
    "speed_multiplier": 1,
    "priority": 0,
    "control_flags": []
  }
}

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