Wiki 9Minecraft Wiki 9Minecraft

minecraft:behavior.look_at_entity — Look at Entity AI Goal

Make custom mobs turn their head to watch nearby entities that match an entity filter.

6Sections
2Code examples
3Known errors

The minecraft:behavior.look_at_entity component is an AI behavior goal that makes a mob periodically rotate its head and body to look at nearby entities. Unlike minecraft:behavior.look_at_player, which only tracks players, or minecraft:behavior.look_at_target, which only tracks the mob's current attack target, this goal lets you define custom entity filters so your mob can watch specific mobs, villagers, or tagged entities. You reach for it whenever you want ambient life in your custom entities, such as guard mobs watching monsters, pets watching their owners' other animals, or ambient creatures acknowledging each other.

How Head Rotation and Look Goals Work

In Minecraft Bedrock, AI goals that control where an entity looks do not move the entity's feet unless the target angle exceeds the body rotation limit. When minecraft:behavior.look_at_entity becomes active, the game picks the closest entity within look_distance that passes the filters check, then interpolates the mob's head yaw and pitch toward that entity's eye position over look_time seconds.

Because looking around is normally an idle or low-importance action, you should give this component a higher priority number (meaning lower importance in Bedrock's priority system, where 0 is the highest priority) than combat, panic, or temptation goals. Typical priorities for look behaviors sit around 7 or 8, just above minecraft:behavior.random_look_around.

Note that the JSON component only updates the entity's internal head rotation variables (query.target_x_rotation and query.target_y_rotation). For the mob's head bone to actually turn visually in-game, its resource pack definition must run a standard look_at_target animation controller or bind those Molang queries to the head bone in a custom animation.

Component Properties

All properties inside minecraft:behavior.look_at_entity are optional, though leaving filters blank makes the mob look at almost any living entity nearby. Below are the supported fields for configuring the goal.

FieldWhat it doesNotes
prioritySets the importance of this goal relative to other AI goals on the entity.Integer. Lower numbers run first. Usually set to 7 or 8 so movement and combat override it.
look_distanceMaximum distance in blocks within which the entity will search for something to look at.Decimal. Defaults to 8.0. Higher values have a slightly higher performance cost due to entity scanning.
probabilityChance per tick that the entity will start looking at a valid target when the goal is not already running.Decimal between 0.0 and 1.0. Defaults to 0.02 (a 2% chance per tick).
look_timeHow long in seconds the entity keeps looking at the chosen target before the goal ends.Accepts a range object with min and max keys, or a two-number array. Defaults to 2 to 4 seconds.
angle_of_view_horizontalThe horizontal field of view in degrees within which the mob can notice and track a target.Integer. Defaults to 360.
angle_of_view_verticalThe vertical field of view in degrees within which the mob can notice and track a target.Integer. Defaults to 360.
filtersStandard Bedrock entity filter block tested against nearby entities to decide who is worth watching.Evaluated using subject: other by default, though setting subject explicitly is best practice.

Basic Usage and Entity Filtering

In most cases, you pair minecraft:behavior.look_at_entity with a filter testing for an entity family or specific type. When writing the filters block, remember that the entity being evaluated is the potential look target, so your filter tests should use "subject": "other".

The following example shows a custom guard golem that ignores passive animals and players during its idle look cycle, choosing instead to keep its eyes locked on nearby monsters or villagers within a 10-block radius. If nothing matches, it falls back to looking around randomly.

BP/entities/guard_golem.json
{
  "format_version": "1.20.80",
  "minecraft:entity": {
    "description": {
      "identifier": "wiki:guard_golem",
      "is_spawnable": true,
      "is_summonable": true
    },
    "components": {
      "minecraft:type_family": {
        "family": [ "golem", "mob" ]
      },
      "minecraft:health": {
        "value": 60,
        "max": 60
      },
      "minecraft:movement": {
        "value": 0.25
      },
      "minecraft:navigation.walk": {
        "can_path_over_water": false,
        "avoid_water": true
      },
      "minecraft:movement.basic": {},
      "minecraft:jump.static": {},
      "minecraft:behavior.look_at_entity": {
        "priority": 7,
        "look_distance": 10.0,
        "probability": 0.04,
        "look_time": {
          "min": 3.0,
          "max": 6.0
        },
        "angle_of_view_horizontal": 180,
        "angle_of_view_vertical": 90,
        "filters": {
          "any_of": [
            {
              "test": "is_family",
              "subject": "other",
              "value": "monster"
            },
            {
              "test": "is_family",
              "subject": "other",
              "value": "villager"
            }
          ]
        }
      },
      "minecraft:behavior.random_look_around": {
        "priority": 8
      }
    }
  }
}

Dynamic Behavior with Component Groups

You can also place minecraft:behavior.look_at_entity inside a component_groups entry to make an entity change what it pays attention to based on its current state. For example, an entity might ignore dropped items or armor stands normally, but watch another specific entity type closely when alerted or tamed.

When you remove a component group containing minecraft:behavior.look_at_entity while the mob is actively looking at something, the goal terminates immediately and the head returns to neutral (or yields to the next active look goal).

Connecting the Resource Pack Head Rotation

A very common stumbling block for creators is adding minecraft:behavior.look_at_entity to the behavior pack and wondering why the custom model stays completely rigid in-game. The behavior component only calculates the rotation angles; the resource pack must apply them to a bone named head.

Every vanilla mob uses the standard animation.common.look_at_target animation, which is already built into the vanilla resource pack and available to all custom entities without copying any animation files. You only need to reference it in your client_entity file under animations and run it in the scripts section, provided your geometry's head bone is named "head".

RP/entity/guard_golem.entity.json
{
  "format_version": "1.10.0",
  "minecraft:client_entity": {
    "description": {
      "identifier": "wiki:guard_golem",
      "materials": {
        "default": "entity_alphatest"
      },
      "textures": {
        "default": "textures/entity/guard_golem"
      },
      "geometry": {
        "default": "geometry.guard_golem"
      },
      "animations": {
        "look_at_target": "animation.common.look_at_target"
      },
      "scripts": {
        "animate": [
          "look_at_target"
        ]
      },
      "render_controllers": [ "controller.render.default" ]
    }
  }
}

Choosing Between Look Goals

Bedrock includes three closely related goals for head tracking. If you only want a mob to look at players, use minecraft:behavior.look_at_player instead; it skips general entity filter evaluation and is slightly cheaper for the game engine to run across dozens of mobs. If you want a mob to stare at whatever it is actively attacking or following, use minecraft:behavior.look_at_target, which reads the mob's current target property directly rather than scanning a radius.

Reserve minecraft:behavior.look_at_entity for situations where the target is neither exclusively a player nor the mob's active combat target.

Which versions this applies to

Stable in all modern Bedrock versions (1.8.0 through 1.21+). Does not require any experimental toggles.

When it does not work

What you seeWhyThe fix
The entity's body twitches toward the target occasionally, or it does not visibly turn its head at all when an entity walks by.The behavior pack goal is running, but the resource pack client_entity definition is either missing animation.common.look_at_target in its scripts.animate array, or the model's head bone in Blockbench is named something other than 'head' (such as 'Head' with a capital H or 'skull').Rename the bone to lowercase 'head' in your geometry file and ensure 'animation.common.look_at_target' is linked and active in RP/entity/<your_mob>.entity.json.
Content Log shows: [AI][error] minecraft:behavior.look_at_entity: failed to parse filters!The filters block inside the component contains a malformed test, or uses a test name that does not exist in Bedrock's filter system.Check that every filter object has 'test', 'subject', and 'value' keys with valid types, and verify that 'subject' is set to 'other' when checking attributes of the entity being looked at.
The mob stops walking or freezes mid-chase just to stare at a nearby entity.The priority on minecraft:behavior.look_at_entity is set lower (for example, 0 or 1) than the mob's movement or combat behaviors, and both goals are competing for control over the entity's look/body orientation.Raise the priority number on minecraft:behavior.look_at_entity to 7 or 8 so that combat (usually priority 1 to 3) and wandering (usually priority 5 or 6) take precedence.

Reference, straight from the game files

Read out of the game itself, so the ids match the version you are building for.