Player, entities and camera

Use provenance and availability rather than assuming complete game knowledge.

Contract 1.0.0 · JavaScript executor documentation

Player and tank data

player.getState() returns Observation<Player>. Available fields include validated client coordinates, health, name, native class identity, cursor position, entity relation and barrel observations. Some fields can be null. Player velocity is unavailable. A native class ID is not a guarantee that every tank feature is supported.

Entity data

entities.getState() returns independently sampled client-synchronized entities. Entity keys identify a specific observed generation. Positions may be world or parent-local. Render coordinates describe client interpolation. Health percentage is derived from client health components; relations and barrel timing also carry their stated provenance. Server-only state is unavailable.

Camera

camera.getState() returns Observation<Camera> with validated position and scale when the current game build can be read safely. The public contract does not expose arbitrary camera memory writes.

Events

events.on(event, listener) accepts state, spawn, death, despawn or connection and returns a synchronous unsubscribe function. Listener snapshots are immutable. An observed death requires validated health evidence; disappearance alone is a despawn. Subscribe once, release the returned function during cleanup and tolerate unavailable data.