1. Wiki
  2. /Entities
  3. /minecraft:behavior.go_home

minecraft:behavior.go_home

Don't want to write this by hand? GodCraft sets minecraft:behavior.go_home for you with a switch.Get GodCraft

Overview

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

FieldTypeDefaultDescription
speed_multipliernumber1Speed multiplier while heading home.
intervalinteger120Gives a 1 in N chance each tick to start, where N is this number.
goal_radiusnumber0.5How close the mob must get to count as arrived, which stops it jittering around the spot.
calculate_new_path_radiusnumber2When the mob gets this close to the end of its current path, a new path home is planned.
on_homeActorDefinitionTrigger[]noneEvents that fire when the mob reaches home.
on_failedActorDefinitionTrigger[]noneEvents that fire when the mob fails to get home.
priorityinteger0Lower numbers run first: when two goals compete, the one with the smaller priority wins.Range: 0 to …
control_flagsGoal's control flags[]noneWhich 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": []
  }
}

We use cookies to improve your experience and analyse site traffic. Learn more