minecraft:behavior.go_home
Allows the mob to move back to the position they were spawned.
Properties
| Property | Type | Default | What it does |
|---|---|---|---|
speed_multiplier | Decimal | 1 | Movement speed multiplier of the mob when using this AI Goal. |
interval | Integer | 120 | A random value to determine when to randomly move somewhere. This has a 1/interval chance to choose this goal. |
goal_radius | Decimal | 0.5 | Distance 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_radius | Decimal | 2 | Distance 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_home | List of object | [] | Event(s) to run when this mob gets home. |
event | Text | "" | |
target | Textself, other, player, target, parent, baby, block, damager, holder, item | "self" | |
filters | Object 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. |
test | Text | — | The name of the test to apply. |
subject | Boolean or Integer or Decimal or Text | — | The subject of this filter test. |
operator | Boolean or Integer or Decimal or Text | — | The comparison to apply with 'value'. |
domain | Boolean or Integer or Decimal or Text | — | The domain the test should be performed in. |
value | Boolean or Integer or Decimal or Text | — | The value being compared with the test. |
on_failed | List of object | [] | Event(s) to run when this goal fails. |
event | Text | "" | |
target | Textself, other, player, target, parent, baby, block, damager, holder, item | "self" | |
filters | Object 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. |
test | Text | — | The name of the test to apply. |
subject | Boolean or Integer or Decimal or Text | — | The subject of this filter test. |
operator | Boolean or Integer or Decimal or Text | — | The comparison to apply with 'value'. |
domain | Boolean or Integer or Decimal or Text | — | The domain the test should be performed in. |
value | Boolean or Integer or Decimal or Text | — | The value being compared with the test. |
priority | Integermin 0 | 0 | |
control_flags | List 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
behavior.floatbehavior.random_swimbehavior.swim_idlebehavior.swim_wanderbehavior.use_kinetic_weaponbehavior.move_to_waterbehavior.teleport_to_ownerbehavior.float_wanderbehavior.random_hoverbehavior.slime_floatbehavior.slime_keep_on_jumpingbehavior.slime_random_directionbehavior.move_to_landbehavior.move_to_random_blockbehavior.circle_around_anchorbehavior.dragonholdingpatternbehavior.dragonlandingbehavior.dragontakeoffbehavior.explore_outskirtsbehavior.find_underwater_treasurebehavior.move_to_blockbehavior.move_to_liquidbehavior.random_breachbehavior.random_fly