minecraft:behavior.look_at_entity
Allows the mob to look at nearby entities.
Properties
| Property | Type | Default | What it does |
|---|---|---|---|
filters | Object or List of object | {"AND": null, "NOT": null, "OR": null, "all": null, "all_… | Filter to determine the conditions for this mob to look at the entity |
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. |
angle_of_view_vertical | Integer0 to 360 | 360 | The angle in degrees that the mob can see rotated on the X-axis (up-down). |
angle_of_view_horizontal | Integer0 to 360 | 360 | The angle in degrees that the mob can see rotated on the Y-axis (left-right). |
look_time | Object | {"max": 4, "min": 2} | Time range to look at the nearest entity. |
min | Decimal | 0 | |
max | Decimal | 0 | |
look_distance | Decimalmin 0 | 8 | The distance in blocks from which the entity will look at the nearest entity. |
probability | Decimal0 to 1 | 0.02 | The probability of looking at the target. A value of 1.00 is 100%. |
priority | Integermin 0 | 0 | |
control_flags | List of text | [] |
Example from the game files
This is how vanilla Ravager uses it in Minecraft Bedrock 1.26.60.5:
{
"minecraft:behavior.look_at_entity": {
"priority": 10,
"look_distance": 8,
"angle_of_view_horizontal": 45,
"filters": {
"test": "is_family",
"subject": "other",
"value": "mob"
}
}
}Used by 3
Vanilla entities with minecraft:behavior.look_at_entity in their definition:
Related components
behavior.random_strollbehavior.random_look_aroundbehavior.equip_itembehavior.move_towards_home_restrictionbehavior.timer_flag_1behavior.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.napbehavior.rise_to_liquid_levelbehavior.rollbehavior.silverfish_merge_with_stonebehavior.silverfish_wake_up_friendsbehavior.sleep