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

minecraft:behavior.follow_mob

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

Overview

minecraft:behavior.follow_mob 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 tag along behind other nearby mobs.

Fields

FieldTypeDefaultDescription
speed_multipliernumber1Speed multiplier while following.
stop_distancenumbernoneHow many blocks behind the followed mob this one stops.
search_rangeinteger0How far, in blocks, the mob looks for someone to follow.
use_home_position_restrictionbooleanfalseIf true, only mobs inside this mob's home area can be followed.
preferred_actor_typestring""A mob type to follow first. Leave empty to pick a random one nearby.
filtersFilter Group{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null}Which nearby mobs can be followed. When empty, a built-in list is used that skips players and some others.
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_mob": {
    "speed_multiplier": 1,
    "stop_distance": 1,
    "search_range": 0,
    "use_home_position_restriction": false,
    "preferred_actor_type": "",
    "filters": {
      "AND": null,
      "NOT": null,
      "OR": null,
      "all": null,
      "all_of": null,
      "any": null,
      "any_of": null,
      "none_of": null
    },
    "priority": 0,
    "control_flags": []
  }
}

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