minecraft:behavior.go_home

Allows the mob to move back to the position they were spawned.

Properties

PropertyTypeDefaultWhat it does
speed_multiplierDecimal1Movement speed multiplier of the mob when using this AI Goal.
intervalInteger120A random value to determine when to randomly move somewhere. This has a 1/interval chance to choose this goal.
goal_radiusDecimal0.5Distance in blocks within the mob considers it has reached the goal. This is the "wiggle room" to stop the AI from bouncing back and forth trying to reach a specific spot.
calculate_new_path_radiusDecimal2Distance in blocks that the mob is considered close enough to the end of the current path. A new path will then be calculated to continue toward home.
on_homeList of object[]Event(s) to run when this mob gets home.
eventText""
targetTextself, other, player, target, parent, baby, block, damager, holder, item"self"
filtersObject or List of object{"AND": null, "NOT": null, "OR": null, "all": null, "all_…Filters allow data objects to specify test criteria which allows their use. Filters can be defined by a single object of type (Filter Test), an array of tests, collection groups, or a combination of these objects.
testText—The name of the test to apply.
subjectBoolean or Integer or Decimal or Text—The subject of this filter test.
operatorBoolean or Integer or Decimal or Text—The comparison to apply with 'value'.
domainBoolean or Integer or Decimal or Text—The domain the test should be performed in.
valueBoolean or Integer or Decimal or Text—The value being compared with the test.
on_failedList of object[]Event(s) to run when this goal fails.
eventText""
targetTextself, other, player, target, parent, baby, block, damager, holder, item"self"
filtersObject or List of object{"AND": null, "NOT": null, "OR": null, "all": null, "all_…Filters allow data objects to specify test criteria which allows their use. Filters can be defined by a single object of type (Filter Test), an array of tests, collection groups, or a combination of these objects.
testText—The name of the test to apply.
subjectBoolean or Integer or Decimal or Text—The subject of this filter test.
operatorBoolean or Integer or Decimal or Text—The comparison to apply with 'value'.
domainBoolean or Integer or Decimal or Text—The domain the test should be performed in.
valueBoolean or Integer or Decimal or Text—The value being compared with the test.
priorityIntegermin 00
control_flagsList of text[]

Example from the game files

This is how vanilla Bee uses it in Minecraft Bedrock 1.26.60.5:

{
  "minecraft:behavior.go_home": {
    "priority": 4,
    "speed_multiplier": 1.0,
    "interval": 1,
    "goal_radius": 1.2,
    "on_home": [
      {
        "filters": {
          "any_of": [
            {
              "test": "is_block",
              "subject": "block",
              "value": "minecraft:bee_nest"
            },
            {
              "test": "is_block",
              "subject": "block",
              "value": "minecraft:beehive"
            }
          ]
        },
        "event": "minecraft:bee_returned_to_hive",
        "target": "block"
      },
      {
        "filters": {
          "all_of": [
            {
              "test": "is_block",
              "subject": "block",
              "operator": "!=",
              "value": "minecraft:bee_nest"
            },
            {
              "test": "is_block",
              "subject": "block",
              "operator": "!=",
              "value": "minecraft:beehive"
            }
          ]
        },
        "event": "find_hive_event",
        "target": "self"
      }
    ],
    "on_failed": [
      {
        "event": "find_hive_event",
        "target": "self"
      }
    ]
  }
}

Used by 3

Vanilla entities with minecraft:behavior.go_home in their definition:

Related components