minecraft:behavior.sleep
Allows mobs that own a bed to in a village to move to and sleep in it.
Properties
| Property | Type | Default | What it does |
|---|---|---|---|
sleep_collider_height | Decimalmin 0 | 1 | The height of the mob's collider while sleeping |
sleep_collider_width | Decimalmin 0 | 1 | The width of the mob's collider while sleeping |
sleep_y_offset | Decimalmin 0 | 1 | The y offset of the mob's collider while sleeping |
cooldown_time | Decimalmin 0 | 0 | Time in seconds the mob has to wait before using the goal again |
can_sleep_while_riding | Boolean | false | If true, the mob will be able to use the sleep goal if riding something |
timeout_cooldown | Decimalmin 0 | 8 | The cooldown time in seconds before the goal can be reused after a internal failure or timeout condition. |
speed_multiplier | Decimalmin 0 | 1 | Movement speed multiplier of the mob when using this goal. |
priority | Integermin 0 | 0 | |
control_flags | List 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
behavior.random_strollbehavior.random_look_aroundbehavior.equip_itembehavior.move_towards_home_restrictionbehavior.timer_flag_1behavior.look_at_entitybehavior.move_towards_dwelling_restrictionbehavior.drink_potionbehavior.jump_to_blockbehavior.squid_divebehavior.squid_idlebehavior.squid_move_away_from_groundbehavior.squid_out_of_waterbehavior.croakbehavior.dragondeathbehavior.drink_milkbehavior.emergebehavior.investigate_suspicious_locationbehavior.lay_downbehavior.napbehavior.rise_to_liquid_levelbehavior.rollbehavior.silverfish_merge_with_stonebehavior.silverfish_wake_up_friends