minecraft:behavior.hide for you with a switch.Get GodCraftOverview
minecraft:behavior.hide is an entity component: it goes in the components object of a custom mob, or in one of its component groups. AI goal that makes the mob run to its claimed spot, or one nearby, and stay there, like villagers going to their beds when the raid bell rings. Needs minecraft:hide.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
duration | number | 1 | How many seconds the mob stays hidden.Range: 0 to … |
timeout_cooldown | number | 8 | Seconds to wait before trying again after the goal fails or times out.Range: 0 to … |
poi_type | POIType | none | The kind of point of interest to hide at, such as a bed. |
speed_multiplier | number | 1 | Speed multiplier while going to hide.Range: 0 to … |
priority | integer | 0 | Lower numbers run first: when two goals compete, the one with the smaller priority wins.Range: 0 to … |
control_flags | Goal's control flags[] | none | Which body parts this goal takes over (move, look, jump), so goals using the same parts cannot run together. |
Example
Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):
BP/entities/<name>.json
{
"minecraft:behavior.hide": {
"duration": 1,
"timeout_cooldown": 8,
"poi_type": {},
"speed_multiplier": 1,
"priority": 0,
"control_flags": []
}
}