minecraft:behavior.random_look_around_and_sit for you with a switch.Get GodCraftOverview
minecraft:behavior.random_look_around_and_sit is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Makes the mob sit down and glance around for a while. The mob needs a sitting animation for this to look right.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
min_look_time | integer | 20 | Shortest time, in ticks, the mob looks in one direction. |
max_look_time | integer | 40 | Longest time, in ticks, the mob looks in one direction. |
continue_sitting_on_reload | boolean | false | If true, the mob is still sitting after the world reloads. |
continue_if_leashed | boolean | false | If true, the mob keeps sitting even while on a lead. |
min_look_count | integer | 1 | Fewest different directions the mob looks in. |
max_look_count | integer | 2 | Most different directions the mob looks in. |
random_look_around_cooldown | integer | 0 | Seconds before the goal can run again. |
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 sitting and 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_and_sit": {
"min_look_time": 20,
"max_look_time": 40,
"continue_sitting_on_reload": false,
"continue_if_leashed": false,
"min_look_count": 1,
"max_look_count": 2,
"random_look_around_cooldown": 0,
"min_angle_of_view_horizontal": -180
}
}