Skip to main content
Players, weapons, grenades, the bomb: every entity in the game as a read-only object.
Values update once per tick, so they don’t change between tick and the render frames after it.

Overview

Lookup

getByIndex, getByHandle, getEntities, find, getPlayers, getLocalPlayer, getLocalController.

Entity objects

alive, index, handle, className, address.

Schema fields

m_iHealth and friends, read, bytes.

Helpers

Origin, eyes, bounds, visibility, hitboxes, bones, weapon data.

EntityQuery

filter, forEach, toArray, first, count, map, some, every.
Anywhere an entity is expected you can also pass its index (EntityRef).

Lookup

getByIndex


The entity at index, or null when there’s none.

getByHandle


The entity with this handle, or null once it’s gone.

getEntities


Every entity.

find


className matches exactly that class, parent matches it and every class deriving from it. Both together is an AND; an unknown name matches nothing. Returns an EntityQuery typed by the class you asked for.

getPlayers


The pawn of every player, in controller order. skipLocal leaves yours out.
A dead or spectating player’s pawn is a C_CSObserverPawn, not a C_CSPlayerPawn. Check className before using player-only fields or getViewAngles().

getLocalPlayer


Your pawn, null when you’re not in a game. Same observer-pawn rule as getPlayers.

getLocalController


Your player controller, null when you’re not in a game. Name, score, money and other per-player state live here.

Entity objects

The same entity is always the same object, so === and Map keys work. Once it’s destroyed, alive is false for good and fields, address, read, bytes and helpers return null; index, handle and className still work.
Field types don’t include null (m_iHealth is typed number), but a stale entity reads null. Check alive on anything you keep across ticks.

Schema fields

Every schema field is a read-only property under its schema name: pawn.m_iHealth, pawn.m_ArmorValue. Autocompletion shows what each class has; the type for class C_CSPlayerPawn is IC_CSPlayerPawn.
Nested structs (m_pWeaponServices above, getWeaponData()) have address, read, bytes and toString as well.

read


Reads one value offset bytes into the object, for data the schema doesn’t name. Types are the Pointer ones. RangeError past the end of the object.

bytes


A copy of size bytes from offset, defaulting to the whole object. RangeError past the end.

Helpers

Helpers return null when the data isn’t there (entity gone, no model).

isVisible


Line of sight through world geometry from this entity’s eyes (box centre if it isn’t a pawn) to target’s eyes or box centre. Pass point to test that spot instead. null when no map is loaded.
Players never block the line. For more control use trace.

Hitboxes and bones


Hitboxes and bones of the current pose, in model order. Look one up by name, or by Hitbox.index (the model’s hitbox id) / bone index. null when the model has none or the name doesn’t exist. Bone has index, name (null if the model has none), position, rotation and scale.

EntityQuery

What find returns. filter returns a new query and leaves the original unchanged.

Example

Name and distance of the closest visible enemy.