minecraft:looked_at
Dynamic value
Properties
This component has no properties in the official schema: add it as an empty object {} to switch the behaviour on.
Example from the game files
This is how vanilla Creaking uses it in Minecraft Bedrock 1.26.60.5:
{
"minecraft:looked_at": {
"line_of_sight_obstruction_type": "collision_for_camera",
"field_of_view": 120,
"not_looked_at_event": {
"event": "minecraft:on_target_stop_looking",
"filter": "self"
},
"filters": {
"none_of": [
{
"subject": "target",
"test": "actor_health",
"value": 0
},
{
"domain": "head",
"subject": "other",
"test": "has_equipment",
"value": "carved_pumpkin"
}
]
},
"looked_at_event": {
"event": "minecraft:on_target_start_looking",
"filter": "self"
},
"find_players_only": true,
"look_at_locations": [
{
"location": "head"
},
{
"location": "body"
},
{
"location": "feet",
"vertical_offset": 0.5
}
],
"looked_at_cooldown": 0.1,
"scale_fov_by_distance": false,
"search_radius": 24,
"set_target": "never"
}
}Used by 2
Vanilla entities with minecraft:looked_at in their definition:
Related components
damage_sensorinteractenvironment_sensoron_target_acquiredtimeron_target_escapegame_event_movement_trackingentity_sensorrail_sensortarget_nearby_sensorbody_rotation_blockedon_friendly_angeron_hurtblock_sensorinside_block_notifieron_hurt_by_playerschedulervibration_listenerbody_rotation_always_follows_headon_deathon_equipment_changedon_start_landingon_start_takeoffon_wake_with_owner