Files
minecraft-bedrock-json-schemas/source/behavior/entities/format/components/looked_at.json
Xterionix ec99529c64 Updated to 1.21.50 (#330)
* - Add new client biome components
* - Added built-in block tags
* - Add liquid detection block component
* - Add item visual component
* - Allow ambient_occlusion to use floats
* - Added cannot_be_attacked and ignore component
* - Added play_sound event response
* - Added summon_event property to summon_entity behavior
* - Updated home and looked_at components
* - Added compostable item component
* - Added jigsaws
* - Added processor_lists
* - Made identifier required in jigsaws
* - Added structure sets
* - Remove compressed volume file
* - Add template pools
* - Setup jigsaw schemas
* - Added broadcast_when_dying
* - Update interact.vibration
* - Fix format_version ref in jigsaw schemas
2024-12-05 16:54:27 +01:00

100 lines
4.3 KiB
JSON

{
"$id": "blockception.minecraft.behavior.entities.minecraft.looked_at",
"description": "Defines the behavior when another entity looks at this entity.",
"type": "object",
"title": "Looked At",
"additionalProperties": false,
"properties": {
"field_of_view": {
"type": "number",
"default": 26,
"description": "Defines, in degrees, the width of the field of view for entities looking at the owner entity. If 'scale_fov_by_distance' is set to true, this value corresponds to the field of view at a distance of one block between the entities.",
"title": "Field Of View"
},
"filters": {
"$ref": "../../filters/filters.json",
"description": "Defines the entities that can trigger this component.",
"title": "Filters"
},
"find_players_only": {
"title": "Find Players Only",
"description": "Limits the search to only the nearest Player that meets the specified \"filters\" rather than all nearby entities.",
"type": "boolean",
"default": false
},
"line_of_sight_obstruction_type": {
"title": "Line Of Sight Obstruction Type",
"description": "Defines the type of block shape used to check for line of sight obstructions.",
"type": "string",
"enum": [ "outline", "collision", "collision_for_camera" ],
"default": "collision"
},
"look_at_locations": {
"title": "Look At Locations",
"description": "A list of locations on the owner entity towards which line of sight checks are performed. At least one location must be unobstructed for the entity to be considered as looked at.",
"type": "array",
"minItems": 1,
"items": {
"title": "",
"description": "",
"type": "object",
"additionalProperties": false,
"properties": {
"location": {
"title": "Location",
"type": "string",
"description": "Location to be looked at",
"enum": [ "head", "body", "feet" ]
},
"vertical_offset": {
"title": "Vertical Offset",
"description": "Vertical offset from the set location",
"type": "number"
}
}
}
},
"looked_at_cooldown": {
"$ref": "../types/range_number_type.json",
"default": [ 0.0, 0.0 ],
"description": "The range for the random amount of time during which the entity is `cooling down` and won't get angered or look for a target.",
"title": "Look Cooldown"
},
"looked_at_event": {
"description": "The event identifier to run when the entities specified in filters look at this entity.",
"title": "Looked At Event",
"$ref": "../types/event_object.json"
},
"not_looked_at_event": {
"description": "Defines the event to trigger when no entity is found looking at the owner entity.",
"title": "Not Looked At Event",
"$ref": "../types/event_object.json"
},
"scale_fov_by_distance": {
"title": "Scale Fov By Distance",
"description": "When true, the field of view narrows as the distance between the owner entity and the entity looking at it increases. This ensures that the width of the view cone remains somewhat constant towards the owner entity position, regardless of distance.",
"type": "boolean",
"default": false
},
"search_radius": {
"type": "number",
"default": 10,
"description": "Maximum distance this entity will look for another entity looking at it.",
"title": "Search Radius"
},
"set_target": {
"title": "Set Target",
"description": "Defines if and how the owner entity will set entities that are looking at it as its combat targets. Valid values:\n- \"never\", looking entities are never set as targets, but events are emitted.\n- \"once_and_stop_scanning\", the first detected looking entity is set as target. Scanning and event emission is suspended if and until the owner entity has a target.\n- \"once_and_keep_scanning\", the first detected looking entity is set as target. Scanning and event emission continues.",
"type": "string",
"default": "once_and_stop_scanning",
"enum": [ "never", "once_and_stop_scanning", "once_and_keep_scanning" ]
}
},
"examples": [
{
"search_radius": 10,
"set_target": true
}
]
}