跳转至

Sleep

文档版本:1.21.0.24

Allows mobs that own a bed to in a village to move to and sleep in it.

架构

sleep:
{
  priority "priority"
  speed_multiplier "speed_multiplier"
  boolean "can_sleep_while_riding" : opt
  number "cooldown_time" : opt
  number "sleep_collider_height" : opt
  number "sleep_collider_width" : opt
  number "sleep_y_offset" : opt
  number "timeout_cooldown" : opt
  number "goal_radius" : opt
}
prioritypriority
priority:
integer
speed_multiplierspeed_multiplier
speed_multiplier:
number
can_sleep_while_ridingboolean
If true, the mob will be able to use the sleep goal if riding something.
cooldown_timenumber
Time in seconds the mob has to wait before using the goal again.
sleep_collider_heightnumber
The height of the mob's collider while sleeping.
sleep_collider_widthnumber
The width of the mob's collider while sleeping.
sleep_y_offsetnumber
The y offset of the mob's collider while sleeping.
timeout_cooldownnumber
The cooldown time in seconds before the goal can be reused after a internal failure or timeout condition.
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