minecraft:behavior.nap
Allows mobs to occassionally stop and take a nap under certain conditions.
Properties
| Property | Type | Default | What it does |
|---|---|---|---|
cooldown_min | Decimal | 0 | Minimum time in seconds the mob has to wait before using the goal again |
cooldown_max | Decimal | 0 | Maximum time in seconds the mob has to wait before using the goal again |
mob_detect_dist | Decimal | 6 | The block distance in x and z that will be checked for mobs that this mob detects |
mob_detect_height | Decimal | 6 | The block distance in y that will be checked for mobs that this mob detects |
can_nap_filters | Object or List of object | {"AND": null, "NOT": null, "OR": null, "all": null, "all_… | Conditions that need to be met for the entity to nap |
test | Text | — | The name of the test to apply. |
subject | Boolean or Integer or Decimal or Text | — | The subject of this filter test. |
operator | Boolean or Integer or Decimal or Text | — | The comparison to apply with 'value'. |
domain | Boolean or Integer or Decimal or Text | — | The domain the test should be performed in. |
value | Boolean or Integer or Decimal or Text | — | The value being compared with the test. |
wake_mob_exceptions | Object or List of object | {"AND": null, "NOT": null, "OR": null, "all": null, "all_… | Filters for mobs that will not wake this entity from napping |
test | Text | — | The name of the test to apply. |
subject | Boolean or Integer or Decimal or Text | — | The subject of this filter test. |
operator | Boolean or Integer or Decimal or Text | — | The comparison to apply with 'value'. |
domain | Boolean or Integer or Decimal or Text | — | The domain the test should be performed in. |
value | Boolean or Integer or Decimal or Text | — | The value being compared with the test. |
priority | Integermin 0 | 0 | |
control_flags | List of text | [] |
Example from the game files
This is how vanilla Fox uses it in Minecraft Bedrock 1.26.60.5:
{
"minecraft:behavior.nap": {
"priority": 8,
"cooldown_min": 2.0,
"cooldown_max": 7.0,
"mob_detect_dist": 12.0,
"mob_detect_height": 6.0,
"can_nap_filters": {
"all_of": [
{
"test": "in_water",
"subject": "self",
"operator": "==",
"value": false
},
{
"test": "on_ground",
"subject": "self",
"operator": "==",
"value": true
},
{
"test": "is_underground",
"subject": "self",
"operator": "==",
"value": true
},
{
"test": "weather_at_position",
"subject": "self",
"operator": "!=",
"value": "thunderstorm"
}
]
},
"wake_mob_exceptions": {
"any_of": [
{
"test": "trusts",
"subject": "other",
"operator": "==",
"value": true
},
{
"test": "is_family",
"subject": "other",
"operator": "==",
"value": "fox"
},
{
"test": "is_sneaking",
"subject": "other",
"operator": "==",
"value": true
}
]
}
}
}Used by 1
Vanilla entities with minecraft:behavior.nap 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.rise_to_liquid_levelbehavior.rollbehavior.silverfish_merge_with_stonebehavior.silverfish_wake_up_friendsbehavior.sleep