minecraft:behavior.follow_mob for you with a switch.Get GodCraftOverview
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
| Field | Type | Default | Description |
|---|---|---|---|
speed_multiplier | number | 1 | Speed multiplier while following. |
stop_distance | number | none | How many blocks behind the followed mob this one stops. |
search_range | integer | 0 | How far, in blocks, the mob looks for someone to follow. |
use_home_position_restriction | boolean | false | If true, only mobs inside this mob's home area can be followed. |
preferred_actor_type | string | "" | A mob type to follow first. Leave empty to pick a random one nearby. |
filters | Filter 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. |
priority | integer | 0 | Lower numbers run first: when two goals compete, the one with the smaller priority wins.Range: 0 to … |
control_flags | Goal's control flags[] | none | Which 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": []
}
}