Visibility Detection Activity
Detect players inside an NPC's field of view
Fields
| Field | Type | Default | Description |
|---|---|---|---|
radius | Var<Double> | 10.0 | The radius of vision |
fov | Var<Double> | 90.0 | Field of View in degrees (up to 360) |
shape | Var<VisionShape> | CONE | The shape of the vision detectionValues:CONESPHERE |
showDisplay | Var<Boolean> | false | Show debug display (Client-side optimized) |
Common TypeWriter fields (triggers, criteria)
| Field | Type | Default | Description |
|---|---|---|---|
triggers | List<Ref<TriggerableEntry>> | empty | — |
criteria | List<Criteria> | empty | — |
How to use it
Add this activity to an NPC instance. The NPC looks for players in a CONE (the fov angle, up to 360 degrees, in front of it) or a SPHERE of radius blocks, and a player is detected only if no block is in the way. Once per sighting, triggers run for that player (if their criteria match) and the matching Player Visibility Detection events fire. The player must leave the field of view before they can be detected again.
This activity does not move or rotate the NPC. The activities of the same family (look close, spin, patrol, random patrol, bobbing, path, target location, look at block, look at pitch/yaw, random look) add a movement or rotation to the same detection. showDisplay draws the field of view with flame particles for debugging.