minecraft:behavior.random_look_around for you with a switch.Get GodCraftOverview
minecraft:behavior.random_look_around is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Makes the mob turn its head and look in random directions when it has nothing else to do. Adds life to idle mobs.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
look_time | IntRange | {"max":40,"min":20} | How long, in seconds, the mob looks one way before turning to another. |
min_angle_of_view_horizontal | number | -180 | Furthest angle to the left the mob can look, measured from where it faces. |
max_angle_of_view_horizontal | number | 180 | Furthest angle to the right the mob can look, measured from where it faces. |
probability | number | 0.02 | Chance that the mob starts looking around. |
priority | integer | 0 | Decides which goal wins when several want to run: lower numbers run first.Range: 0 to … |
control_flags | Goal's control flags[] | none | Lists the body parts this goal takes control of (such as move, look or jump), so goals that need the same part don't run together. |
Example
Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):
BP/entities/<name>.json
{
"minecraft:behavior.random_look_around": {
"look_time": {
"max": 40,
"min": 20
},
"min_angle_of_view_horizontal": -180,
"max_angle_of_view_horizontal": 180,
"probability": 0.02,
"priority": 0,
"control_flags": []
}
}