minecraft:behavior.follow_mob
Allows the mob to follow other mobs.
Properties
| Property | Type | Default | What it does |
|---|---|---|---|
speed_multiplier | Decimal | 1 | Movement speed multiplier of the mob when using this AI Goal |
stop_distance | Decimal | — | The distance in blocks this mob stops from the mob it is following |
search_range | Integer | 0 | The distance in blocks it will look for a mob to follow |
use_home_position_restriction | Boolean | false | If 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_type | Text | "" | The type of actor to prefer following. If left unspecified, a random actor among those in range will be chosen. |
filters | Object 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. |
test | Text | — | The name of the test to apply. |
subject | Boolean or Integer or Decimal or Text | — | The subject of this filter test. |
operator | Boolean or Integer or Decimal or Text | — | The comparison to apply with 'value'. |
domain | Boolean or Integer or Decimal or Text | — | The domain the test should be performed in. |
value | Boolean or Integer or Decimal or Text | — | The value being compared with the test. |
priority | Integermin 0 | 0 | |
control_flags | List 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
behavior.look_at_playerbehavior.temptbehavior.breedbehavior.mount_pathingbehavior.follow_parentbehavior.player_ride_tamedbehavior.find_mountbehavior.celebratebehavior.follow_ownerbehavior.stay_while_sittingbehavior.look_at_trading_playerbehavior.random_look_around_and_sitbehavior.take_flowerbehavior.trade_with_playerbehavior.celebrate_survivebehavior.controlled_by_playerbehavior.follow_caravanbehavior.make_lovebehavior.ocelot_sit_on_blockbehavior.playbehavior.receive_lovebehavior.share_itemsbehavior.trade_interestbehavior.admire_item