minecraft:behavior.look_at_target for you with a switch.Get GodCraftOverview
minecraft:behavior.look_at_target 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 look at the entity it is currently targeting.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
angle_of_view_vertical | integer | 360 | How many degrees up and down the mob can see.Range: 0 to 360 |
angle_of_view_horizontal | integer | 360 | How many degrees left and right the mob can see.Range: 0 to 360 |
look_time | FloatRange | {"max":4,"min":2} | Random range of time the mob keeps looking. |
look_distance | number | 8 | How close, in blocks, an entity must be to be looked at.Range: 0 to … |
probability | number | 0.02 | Chance to start looking each time it is checked. 1.0 means 100%.Range: 0 to 1 |
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.look_at_target": {
"angle_of_view_vertical": 360,
"angle_of_view_horizontal": 360,
"look_time": {
"max": 4,
"min": 2
},
"look_distance": 8,
"probability": 0.02,
"priority": 0,
"control_flags": []
}
}