跳转至

Go Home

文档版本:1.21.0.24

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

架构

go_home:
{
  priority "priority"
  speed_multiplier "speed_multiplier"
  number "goal_radius" : opt
  integer "interval" : opt
  trigger "on_home"
  array "on_failed" : opt
  {
    event "<any array element>"
  }
  number "calculate_new_path_radius" : opt
}
prioritypriority
priority:
integer
speed_multiplierspeed_multiplier
speed_multiplier:
number
goal_radiusnumber
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
intervalinteger
A random value to determine when to randomly move somewhere. This has a 1/interval chance to choose this goal
on_hometrigger
Event(s) to run when this mob gets home.
trigger:
string
trigger:
{
  string "event" : opt
  filters "filters"
  subject "target"
}
eventstring
The event to run when the conditions for this trigger are met.
filtersfilters
一个过滤器组。The list of conditions for this trigger to execute.
targetsubject
The target of the event.
subject:
string
trigger:
array
{
  object "<any array element>" : opt
  {
    string "event" : opt
    filters "filters"
    subject "target"
  }
}
<any array element>object
<any array element>
on_failedarray
Event(s) to run when this goal fails.
on_failed
<any array element>event
event:
string
event:
{
  string "event" : opt
  string "target" : opt
}
eventstring
The event to fire.
targetstring
The target of the event.
calculate_new_path_radiusnumber
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.