minecraft:behavior.follow_mob

Allows the mob to follow other mobs.

Properties

PropertyTypeDefaultWhat it does
speed_multiplierDecimal1Movement speed multiplier of the mob when using this AI Goal
stop_distanceDecimal—The distance in blocks this mob stops from the mob it is following
search_rangeInteger0The distance in blocks it will look for a mob to follow
use_home_position_restrictionBooleanfalseIf true, the mob will respect the 'minecraft:home' component's 'restriction_radius' field when choosing a target to follow. If false, it will choose target position without considering home restrictions.
preferred_actor_typeText""The type of actor to prefer following. If left unspecified, a random actor among those in range will be chosen.
filtersObject or List of object{"AND": null, "NOT": null, "OR": null, "all": null, "all_…If non-empty, provides criteria for filtering which nearby Mobs can be followed. If empty default criteria will be used, which will exclude Players, Squid variants, Fish variants, Tadpoles, Dolphins, and mobs of the same type as the owner of the Goal.
testText—The name of the test to apply.
subjectBoolean or Integer or Decimal or Text—The subject of this filter test.
operatorBoolean or Integer or Decimal or Text—The comparison to apply with 'value'.
domainBoolean or Integer or Decimal or Text—The domain the test should be performed in.
valueBoolean or Integer or Decimal or Text—The value being compared with the test.
priorityIntegermin 00
control_flagsList of text[]

Example from the game files

This is how vanilla Happy Ghast uses it in Minecraft Bedrock 1.26.60.5:

{
  "minecraft:behavior.follow_mob": {
    "priority": 6,
    "search_range": 16,
    "stop_distance": 5,
    "speed_multiplier": 1.1,
    "use_home_position_restriction": true,
    "preferred_actor_type": "player",
    "filters": {
      "all_of": [
        {
          "test": "is_underwater",
          "subject": "other",
          "value": false
        },
        {
          "test": "is_baby",
          "subject": "other",
          "value": false
        },
        {
          "any_of": [
            {
              "test": "is_family",
              "subject": "other",
              "value": "player"
            },
            {
              "test": "is_family",
              "subject": "other",
              "value": "armadillo"
            },
            {
              "test": "is_family",
              "subject": "other",
              "value": "bee"
            },
            {
              "test": "is_family",
              "subject": "other",
              "value": "camel"
            },
            {
              "test": "is_family",
              "subject": "other",
              "value": "cat"
            },
            {
              "test": "is_family",
              "subject": "other",
              "value": "chicken"
            },
            {
              "test": "is_family",
              "subject": "other",
              "value": "cow"
            },
            {
              "test": "is_family",
              "subject": "other",
              "value": "donkey"
            },
            {
              "test": "is_family",
              "subject": "other",
              "value": "fox"
            },
            {
              "test": "is_family",
              "subject": "other",
              "value": "goat"
            },
            {
              "test": "is_family",
              "subject": "other",
              "value": "happy_ghast"
            },
            {
              "test": "is_family",
              "subject": "other",
              "value": "horse"
            },
            {
              "test": "is_family",
              "subject": "other",
              "value": "skeleton_horse"
            },
            {
              "test": "is_family",
              "subject": "other",
              "value": "llama"
            },
            {
              "test": "is_family",
              "subject": "other",
              "value": "mule"
            },
            {
              "test": "is_family",
              "subject": "other",
              "value": "ocelot"
            },
            {
              "test": "is_family",
              "subject": "other",
              "value": "panda"
            },
            {
              "test": "is_family",
              "subject": "other",
              "value": "parrot"
            },
            {
              "test": "is_family",
              "subject": "other",
              "value": "pig"
            },
            {
              "test": "is_family",
              "subject": "other",
              "value": "polar_bear"
            },
            {
              "test": "is_family",
              "subject": "other",
              "value": "rabbit"
            },
            {
              "test": "is_family",
              "subject": "other",
              "value": "sheep"
            },
            {
              "test": "is_family",
              "subject": "other",
              "value": "sniffer"
            },
            {
              "test": "is_family",
              "subject": "other",
              "value": "strider"
            },
            {
              "test": "is_family",
              "subject": "other",
              "value": "villager"
            },
            {
              "test": "is_family",
              "subject": "other",
              "value": "villager_v2"
            },
            {
              "test": "is_family",
              "subject": "other",
              "value": "wolf"
            }
          ]
        }
      ]
    }
  }
}

Used by 2

Vanilla entities with minecraft:behavior.follow_mob in their definition:

Related components