跳转至

Work

文档版本:1.21.0.24

Allows the NPC to use the POI.

架构

work:
{
  priority "priority"
  speed_multiplier "speed_multiplier"
  integer "active_time" : opt
  boolean "can_work_in_rain" : opt
  integer "goal_cooldown" : opt
  trigger "on_arrival"
  integer "sound_delay_max" : opt
  integer "sound_delay_min" : opt
  integer "work_in_rain_tolerance" : opt
}
prioritypriority
priority:
integer
speed_multiplierspeed_multiplier
speed_multiplier:
number
active_timeinteger
The amount of ticks the NPC will stay in their the work location.
can_work_in_rainboolean
If true, this entity can work when their jobsite POI is being rained on.
goal_cooldowninteger
The amount of ticks the goal will be on cooldown before it can be used again.
on_arrivaltrigger
Event to run when the mob reaches their jobsite.
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>
sound_delay_maxinteger
The max interval in which a sound will play.
sound_delay_mininteger
The min interval in which a sound will play.
work_in_rain_toleranceinteger
If "can_work_in_rain" is false, this is the maximum number of ticks left in the goal where rain will not interrupt the goal