minecraft:behavior.sleep

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

Properties

PropertyTypeDefaultWhat it does
sleep_collider_heightDecimalmin 01The height of the mob's collider while sleeping
sleep_collider_widthDecimalmin 01The width of the mob's collider while sleeping
sleep_y_offsetDecimalmin 01The y offset of the mob's collider while sleeping
cooldown_timeDecimalmin 00Time in seconds the mob has to wait before using the goal again
can_sleep_while_ridingBooleanfalseIf true, the mob will be able to use the sleep goal if riding something
timeout_cooldownDecimalmin 08The cooldown time in seconds before the goal can be reused after a internal failure or timeout condition.
speed_multiplierDecimalmin 01Movement speed multiplier of the mob when using this goal.
priorityIntegermin 00
control_flagsList of text[]

Example from the game files

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

{
  "minecraft:behavior.sleep": {
    "priority": 3,
    "sleep_collider_height": 0.3,
    "sleep_collider_width": 1,
    "sleep_y_offset": 0.6,
    "speed_multiplier": 0.6,
    "timeout_cooldown": 10
  }
}

Used by 1

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

Related components