minecraft:behavior.hold_ground for you with a switch.Get GodCraftOverview
minecraft:behavior.hold_ground 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 stand still and stare at its target, and it can alert others of its kind.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
min_radius | number | 10 | The target must be at least this far away for the goal to run. |
broadcast | boolean | false | If true, nearby mobs of the same type are told about the target. |
broadcast_range | number | 0 | How many blocks away the alert reaches. |
within_radius_event | ActorDefinitionTrigger | {"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"} | Event that fires when the target is within the radius. It is sent to others too when broadcast is on. |
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.hold_ground": {
"min_radius": 10,
"broadcast": false,
"broadcast_range": 0,
"within_radius_event": {
"event": "",
"filters": {
"AND": null,
"NOT": null,
"OR": null,
"all": null,
"all_of": null,
"any": null,
"any_of": null,
"none_of": null
},
"target": "self"
},
"priority": 0,
"control_flags": []
}
}