minecraft:behavior.follow_target_leader for you with a switch.Get GodCraftOverview
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
| Field | Type | Default | Description |
|---|---|---|---|
within_radius | number | 0 | If the leader gets farther than this many blocks, the mob gives up. |
follow_distance | number | 0 | How many blocks the mob stays away from the leader. |
always_look_for_leader | boolean | false | If true, the mob keeps looking for a new leader when it has none or the old one is no longer valid. |
leader_filters | Filter 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_cooldown | integer | 20 | Ticks to wait before searching again after losing a leader or failing to find one. |
speed_multiplier | number | 1 | Speed multiplier while following the leader. |
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_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": []
}
}