minecraft:behavior.go_home for you with a switch.Get GodCraftOverview
minecraft:behavior.go_home 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 walk back to its home spot, which by default is where it spawned. Turtles use it to return to their beach.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
speed_multiplier | number | 1 | Speed multiplier while heading home. |
interval | integer | 120 | Gives a 1 in N chance each tick to start, where N is this number. |
goal_radius | number | 0.5 | How close the mob must get to count as arrived, which stops it jittering around the spot. |
calculate_new_path_radius | number | 2 | When the mob gets this close to the end of its current path, a new path home is planned. |
on_home | ActorDefinitionTrigger[] | none | Events that fire when the mob reaches home. |
on_failed | ActorDefinitionTrigger[] | none | Events that fire when the mob fails to get home. |
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.go_home": {
"speed_multiplier": 1,
"interval": 120,
"goal_radius": 0.5,
"calculate_new_path_radius": 2,
"on_home": [],
"on_failed": [],
"priority": 0,
"control_flags": []
}
}