> Agent-readable docs index: /llms.txt. Download /docs.zip to grep all markdown files locally.

---
title: Entity System
icon: users
sidebar_position: 3
---

# <ApiPageIcon icon="users" />Entity System

<ApiExposes data="[{&#x22;k&#x22;:&#x22;NAMESPACE&#x22;,&#x22;c&#x22;:&#x22;fn&#x22;,&#x22;s&#x22;:&#x22;entity&#x22;,&#x22;h&#x22;:&#x22;#entity&#x22;},{&#x22;k&#x22;:&#x22;OBJECT&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;Entity&#x22;,&#x22;h&#x22;:&#x22;#entity-1&#x22;},{&#x22;k&#x22;:&#x22;OBJECT&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;Hitbox&#x22;,&#x22;h&#x22;:&#x22;#hitbox&#x22;}]" />

## entity<ApiTag label="global table" />

Adds functions for game entities to the engine `entity` namespace. They find the local
player, list the players, and return the game rules and weapon data.

Use this table to choose the function that returns the pawn you need.

| Need                                                                                      | Call                                                |
| ----------------------------------------------------------------------------------------- | --------------------------------------------------- |
| The pawn that you move and shoot with, which is your own pawn or the bot that you control | `GetLocalPlayerPawn()`                              |
| Your own player pawn, also while you control a bot                                        | `GetOwnLocalPlayerPawn()`                           |
| The pawn that the controller points to, which can be an observer pawn                     | `GetLocalPawn()`                                    |
| A pawn that you control and that is not your own                                          | `GetLocalControlledPawn()`                          |
| The player that you spectate                                                              | `GetObservedPawn()`                                 |
| The pawn that the camera renders from                                                     | `GetViewPawn()`                                     |
| The player that you spectate in some observer modes, and your pawn in other cases         | `GetLocalOrObservedPawn()`, `GetLocalOrInEyePawn()` |

`GetLocalPlayerController()` always returns your controller. `GetLocalObserverPawn()` returns
your own observer entity. It can exist while you play, and it is never the player that you
spectate.

A pawn can be missing during a transition, and it can be dead. Get the pawn again in every
callback, and call `pawn:IsAlive()` when you need a living player.

<ApiMembers>
  <ApiMember kind="fn" name="entity.LookupByIndex" summary="Returns the entity with the given entity index. Returns **nil** if no entity has this index." args="index" sig="[{&#x22;s&#x22;:&#x22;entity.LookupByIndex&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;index&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;index&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}],&#x22;d&#x22;:&#x22;The entity index.&#x22;}]" nodiscard />

  <ApiMember kind="fn" name="entity.LookupByHandle" summary="Returns the entity with the given handle. Returns **nil** if the handle is not valid, or if the entity of the handle was deleted." args="handle" sig="[{&#x22;s&#x22;:&#x22;entity.LookupByHandle&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;handle&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;handle&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}],&#x22;d&#x22;:&#x22;The entity handle.&#x22;}]" nodiscard>
    <ApiNotes>
      A handle always refers to one entity. If a new entity later gets the same index, the old
      handle does not return the new entity.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="fn" name="entity.LookupPlayerControllerBySlot" summary="Returns the player controller in the given player slot. Returns **nil** if the slot is empty. Throws an error if the slot is less than `-1` or greater than `64`." args="slot" sig="[{&#x22;s&#x22;:&#x22;entity.LookupPlayerControllerBySlot&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;slot&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.CBasePlayerController&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/CBasePlayerController&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;client.CBasePlayerController&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/CBasePlayerController&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;slot&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}],&#x22;d&#x22;:&#x22;The index of the player slot.&#x22;}]" nodiscard />

  <ApiMember kind="fn" name="entity.LookupPlayerControllerByUserId" summary="Returns the player controller of the player with the given user ID. Returns **nil** if no player has this ID." args="userid" sig="[{&#x22;s&#x22;:&#x22;entity.LookupPlayerControllerByUserId&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;userid&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.CBasePlayerController&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/CBasePlayerController&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;client.CBasePlayerController&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/CBasePlayerController&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;userid&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}],&#x22;d&#x22;:&#x22;The user ID.&#x22;}]" nodiscard />

  <ApiMember kind="fn" name="entity.ListByClassName" summary="Returns a list of all entities of the given class." args="classname, recursive?" sig="[{&#x22;s&#x22;:&#x22;entity.ListByClassName&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;classname&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;T&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;[, &#x22;},{&#x22;s&#x22;:&#x22;recursive&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;T&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;T&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;classname&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;T&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;}],&#x22;d&#x22;:&#x22;The name of the schema class.&#x22;},{&#x22;n&#x22;:&#x22;recursive&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}],&#x22;d&#x22;:&#x22;Pass `true` to also include entities of classes that are derived from this class. The default is `false`.&#x22;,&#x22;o&#x22;:true}]" nodiscard />

  <ApiMember kind="fn" name="entity.Iterate" summary="Returns an iterator over all entities. Use it in a `for` loop. Each step gives the entity index and the entity." args="" sig="[{&#x22;s&#x22;:&#x22;entity.Iterate&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;table&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;},{&#x22;s&#x22;:&#x22;\u003c&#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;},{&#x22;s&#x22;:&#x22;\u003e&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;index&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;table&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;},{&#x22;s&#x22;:&#x22;\u003c&#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;},{&#x22;s&#x22;:&#x22;\u003e&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;index&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}]]" nodiscard />

  <ApiMember kind="fn" name="entity.IterateByClassName" summary="Returns an iterator over the entities of the given class. Use it in a `for` loop. Each step gives the entity index and the entity." args="classname, recursive?" sig="[{&#x22;s&#x22;:&#x22;entity.IterateByClassName&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;classname&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;T&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;[, &#x22;},{&#x22;s&#x22;:&#x22;recursive&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;table&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;},{&#x22;s&#x22;:&#x22;\u003c&#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;T&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;\u003e&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;index&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;T&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;table&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;},{&#x22;s&#x22;:&#x22;\u003c&#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;T&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;\u003e&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;index&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;T&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;classname&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;T&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;}],&#x22;d&#x22;:&#x22;The name of the schema class.&#x22;},{&#x22;n&#x22;:&#x22;recursive&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}],&#x22;d&#x22;:&#x22;Pass `true` to also include entities of classes that are derived from this class. The default is `false`.&#x22;,&#x22;o&#x22;:true}]" nodiscard />

  <ApiMember kind="fn" name="entity.FirstByClassName" summary="Returns the first entity of the given class. Returns **nil** if there is no such entity." args="classname, recursive?" sig="[{&#x22;s&#x22;:&#x22;entity.FirstByClassName&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;classname&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;T&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;[, &#x22;},{&#x22;s&#x22;:&#x22;recursive&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;T&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;T&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;classname&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;T&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;}],&#x22;d&#x22;:&#x22;The name of the schema class.&#x22;},{&#x22;n&#x22;:&#x22;recursive&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}],&#x22;d&#x22;:&#x22;Pass `true` to also include entities of classes that are derived from this class. The default is `false`.&#x22;,&#x22;o&#x22;:true}]" nodiscard />

  <ApiMember kind="fn" name="entity.ListByDesignerName" summary="Returns a list of all entities with the given designer name." args="designer_name?, recursive?" sig="[{&#x22;s&#x22;:&#x22;entity.ListByDesignerName&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;designer_name&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;recursive&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;designer_name&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The designer name. If it is **nil**, all entities are returned.&#x22;,&#x22;o&#x22;:true},{&#x22;n&#x22;:&#x22;recursive&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}],&#x22;d&#x22;:&#x22;Pass `true` to also include entities of classes that are derived from this class. The default is `false`.&#x22;,&#x22;o&#x22;:true}]" nodiscard />

  <ApiMember kind="fn" name="entity.IterateByDesignerName" summary="Returns an iterator over the entities with the given designer name. Use it in a `for` loop. Each step gives the entity index and the entity." args="designer_name?, recursive?" sig="[{&#x22;s&#x22;:&#x22;entity.IterateByDesignerName&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;designer_name&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;recursive&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;table&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;},{&#x22;s&#x22;:&#x22;\u003c&#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;},{&#x22;s&#x22;:&#x22;\u003e&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;index&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;table&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;},{&#x22;s&#x22;:&#x22;\u003c&#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;},{&#x22;s&#x22;:&#x22;\u003e&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;index&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;designer_name&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The designer name. If it is **nil**, all entities are returned.&#x22;,&#x22;o&#x22;:true},{&#x22;n&#x22;:&#x22;recursive&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}],&#x22;d&#x22;:&#x22;Pass `true` to also include entities of classes that are derived from this class. The default is `false`.&#x22;,&#x22;o&#x22;:true}]" nodiscard />

  <ApiMember kind="fn" name="entity.FirstByDesignerName" summary="Returns the first entity with the given designer name. Returns **nil** if there is no such entity." args="designer_name, recursive?" sig="[{&#x22;s&#x22;:&#x22;entity.FirstByDesignerName&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;designer_name&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;[, &#x22;},{&#x22;s&#x22;:&#x22;recursive&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;designer_name&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The designer name.&#x22;},{&#x22;n&#x22;:&#x22;recursive&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}],&#x22;d&#x22;:&#x22;Pass `true` to also include entities of classes that are derived from this class. The default is `false`.&#x22;,&#x22;o&#x22;:true}]" nodiscard />

  <ApiMember kind="fn" name="entity.WrapInstance" summary="Returns an entity object for a pointer to an entity." args="instance" sig="[{&#x22;s&#x22;:&#x22;entity.WrapInstance&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;instance&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;userdata&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#userdata&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;ffi.cdata&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;*&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;instance&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;userdata&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#userdata&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;ffi.cdata&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;*&#x22;}],&#x22;d&#x22;:&#x22;A raw pointer to an entity instance.&#x22;}]" nodiscard>
    <ApiNotes>
      <Warning>
        This function is for advanced users. The pointer must point to an entity that exists. Use it
        only while that entity exists.
      </Warning>
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="fn" name="entity.GetLocalPlayer" summary="Returns the controller of the local player and the pawn that the local player uses. The pawn is the player's own pawn, or the pawn of a bot while the player controls one." args="" sig="[{&#x22;s&#x22;:&#x22;entity.GetLocalPlayer&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.CCSPlayerController&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/CCSPlayerController&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawn&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;client.CCSPlayerController&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/CCSPlayerController&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}],[{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawn&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" nodiscard>
    <ApiNotes>
      Both values are **nil** if there is no local controller. The pawn alone can be **nil** if it is
      not available. To get your own pawn also while you control a bot, use
      `entity.GetOwnLocalPlayerPawn`.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="fn" name="entity.GetLocalPlayerController" summary="Returns the controller of the local player. Returns **nil** if you are not connected. The controller stays your own while you control a bot or spectate another player." args="" sig="[{&#x22;s&#x22;:&#x22;entity.GetLocalPlayerController&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.CCSPlayerController&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/CCSPlayerController&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;client.CCSPlayerController&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/CCSPlayerController&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" nodiscard />

  <ApiMember kind="fn" name="entity.GetLocalPlayerPawn" summary="Returns the pawn that the local player uses. While the local player controls the pawn of another player or a bot, this is that pawn. In other cases this is the local player's own pawn." args="" sig="[{&#x22;s&#x22;:&#x22;entity.GetLocalPlayerPawn&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawn&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawn&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" nodiscard>
    <ApiNotes>
      Use this function for movement and weapons. While you spectate, it returns your own player
      pawn. `entity.GetOwnLocalPlayerPawn` always returns your own pawn, also while you control a
      bot. Both functions can return a dead pawn.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="fn" name="entity.GetViewPawn" summary="Returns the pawn that the camera renders from now. In the in-eye and chase observer modes, this is the player that you spectate. In other cases it is the local player's own pawn." args="" sig="[{&#x22;s&#x22;:&#x22;entity.GetViewPawn&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawn&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawn&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" nodiscard>
    <ApiNotes>
      Returns nil if the pawn or its observer services are not available. Use this function for
      HUD information that follows the camera. During a transition, the result can be different
      from the pawn that `GetLocalOrObservedPawn` returns.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="fn" name="entity.GetLocalOrObservedPawn" summary="Returns the observed pawn while you spectate. In other cases it returns the same pawn as `entity.GetLocalPlayerPawn`." args="predicate?" sig="[{&#x22;s&#x22;:&#x22;entity.GetLocalOrObservedPawn&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;predicate&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;entity.PawnObserveePredicate&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/engine/entity#entity-PawnObserveePredicate&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawn&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawn&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;predicate&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;entity.PawnObserveePredicate&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/engine/entity#entity-PawnObserveePredicate&#x22;}],&#x22;d&#x22;:&#x22;A function that decides whether to use the observed pawn.&#x22;,&#x22;o&#x22;:true}]" nodiscard>
    <ApiNotes>
      Without a predicate, the observed pawn is used in the in-eye and chase observer modes. Pass a
      predicate to decide for each observer mode. The predicate gets the current observer mode as a
      `server.ObserverMode_t` value and the observed pawn. The values of the observer modes are in
      `schema.ObserverMode_t`. The observed pawn is **nil** if there is no observed pawn.

      The predicate is called only while you spectate. If the predicate returns `true` and there is
      no observed pawn, the result is nil. The default selection for the in-eye and chase modes
      works in the same way.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="fn" name="entity.GetLocalOrInEyePawn" summary="Returns the observed pawn while you spectate in the in-eye mode. In other cases it returns the same pawn as `entity.GetLocalPlayerPawn`." args="" sig="[{&#x22;s&#x22;:&#x22;entity.GetLocalOrInEyePawn&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawn&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawn&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" nodiscard />

  <ApiMember kind="fn" name="entity.GetLocalControlledPawn" summary="Returns the pawn that the local player controls if it is not the player's own pawn. Returns **nil** in other cases. While you control a bot, this is the same pawn as `GetLocalPlayerPawn()`." args="" sig="[{&#x22;s&#x22;:&#x22;entity.GetLocalControlledPawn&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawn&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawn&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" nodiscard />

  <ApiMember kind="fn" name="entity.GetLocalPawn" summary="Returns the pawn that the local controller points to now, of any type. `entity.GetLocalPawnType` returns its type. This pawn can be a `client.C_CSObserverPawn`, so use `GetLocalPlayerPawn()` when you need a player pawn." args="" sig="[{&#x22;s&#x22;:&#x22;entity.GetLocalPawn&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawnBase&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawnBase&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawnBase&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawnBase&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" nodiscard />

  <ApiMember kind="fn" name="entity.GetOwnLocalPlayerPawn" summary="Returns the local player's own player pawn. The result is the same while you control a bot or spectate another player. The pawn can be dead." args="" sig="[{&#x22;s&#x22;:&#x22;entity.GetOwnLocalPlayerPawn&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawn&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawn&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" nodiscard />

  <ApiMember kind="fn" name="entity.GetLocalObserverPawn" summary="Returns the observer pawn of the local player. Returns **nil** if there is no observer pawn. The observer pawn can exist while you do not spectate. Use `IsLocalObserving()` to check whether you spectate." args="" sig="[{&#x22;s&#x22;:&#x22;entity.GetLocalObserverPawn&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.C_CSObserverPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSObserverPawn&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;client.C_CSObserverPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSObserverPawn&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" nodiscard />

  <ApiMember kind="fn" name="entity.GetObservedPawn" summary="Returns the current observer target if it is a player pawn. Returns **nil** in other cases. In the free camera observer modes, the target can be different from the pawn that the camera renders from." args="" sig="[{&#x22;s&#x22;:&#x22;entity.GetObservedPawn&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawn&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawn&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" nodiscard />

  <ApiMember kind="fn" name="entity.GetObserverMode" summary="Returns the current observer mode. Returns `OBS_MODE_NONE` if you do not spectate. The values of the observer modes are in `schema.ObserverMode_t`." args="" sig="[{&#x22;s&#x22;:&#x22;entity.GetObserverMode&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;server.ObserverMode_t&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/server/ObserverMode_t&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;server.ObserverMode_t&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/server/ObserverMode_t&#x22;}]]" nodiscard />

  <ApiMember kind="fn" name="entity.GetLocalPawnType" summary="Returns the type of the current pawn as an `entity.LocalPawnType` value. The value is `kNull` if there is no pawn, or if the type of the pawn is not known yet during a transition." args="" sig="[{&#x22;s&#x22;:&#x22;entity.GetLocalPawnType&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;entity.LocalPawnType&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/engine/entity#entity-LocalPawnType&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;entity.LocalPawnType&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/engine/entity#entity-LocalPawnType&#x22;}]]" nodiscard />

  <ApiMember kind="fn" name="entity.IsViewInEye" summary="Returns whether the view is a first person view. This is true when the local player spectates in the in-eye mode, or when the pawn of the player is in first person." args="" sig="[{&#x22;s&#x22;:&#x22;entity.IsViewInEye&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" nodiscard />

  <ApiMember kind="fn" name="entity.IsLocalPlaying" summary="Returns whether the current pawn of the local player is a player pawn. This can be the player's own pawn or a pawn that the player controls. The pawn type is `entity.LocalPawnType.kPlayer`. This function does not check whether the pawn is alive." args="" sig="[{&#x22;s&#x22;:&#x22;entity.IsLocalPlaying&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" nodiscard />

  <ApiMember kind="fn" name="entity.IsLocalObserving" summary="Returns whether the current pawn of the local player is an observer pawn, which means that the player spectates. The pawn type is `entity.LocalPawnType.kObserver`. An observer pawn that exists while it is not the current pawn does not count." args="" sig="[{&#x22;s&#x22;:&#x22;entity.IsLocalObserving&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" nodiscard />

  <ApiMember kind="fn" name="entity.IsLocalPawnOwn" summary="Returns whether the current pawn is the local player's own player pawn. Returns false while the player controls another pawn, and while the player spectates." args="" sig="[{&#x22;s&#x22;:&#x22;entity.IsLocalPawnOwn&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" nodiscard />

  <ApiMember kind="fn" name="entity.IteratePlayers" summary="Returns an iterator over all players. Each step gives a controller and its pawn." args="enemies_only?, include_dead?, relative_to?" sig="[{&#x22;s&#x22;:&#x22;entity.IteratePlayers&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;enemies_only&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;include_dead&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;relative_to&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;entity.IteratePlayers.Iterator&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/engine/entity#entity-IteratePlayers-Iterator&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;entity.IteratePlayers.Table&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/engine/entity#entity-IteratePlayers-Table&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;nil&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#nil&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;entity.IteratePlayers.Iterator&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/engine/entity#entity-IteratePlayers-Iterator&#x22;}],[{&#x22;s&#x22;:&#x22;entity.IteratePlayers.Table&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/engine/entity#entity-IteratePlayers-Table&#x22;}],[{&#x22;s&#x22;:&#x22;nil&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#nil&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;enemies_only&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}],&#x22;d&#x22;:&#x22;If true, returns only enemies. The default is false.&#x22;,&#x22;o&#x22;:true},{&#x22;n&#x22;:&#x22;include_dead&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}],&#x22;d&#x22;:&#x22;If true, also returns dead players. The default is false.&#x22;,&#x22;o&#x22;:true},{&#x22;n&#x22;:&#x22;relative_to&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}],&#x22;d&#x22;:&#x22;The entity that `enemies_only` compares teams with. The default is the pawn from `GetLocalPlayerPawn()`, which can be a controlled bot.&#x22;,&#x22;o&#x22;:true}]" nodiscard />

  <ApiMember kind="fn" name="entity.GetPlayerControllers" summary="Returns all player controllers." args="enemies_only?, relative_to?" sig="[{&#x22;s&#x22;:&#x22;entity.GetPlayerControllers&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;enemies_only&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;relative_to&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.CCSPlayerController&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/CCSPlayerController&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;client.CCSPlayerController&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/CCSPlayerController&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;enemies_only&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}],&#x22;d&#x22;:&#x22;If true, returns only the controllers of enemies. The default is false.&#x22;,&#x22;o&#x22;:true},{&#x22;n&#x22;:&#x22;relative_to&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}],&#x22;d&#x22;:&#x22;The entity that `enemies_only` compares teams with. The default is the pawn from `GetLocalPlayerPawn()`, which can be a controlled bot.&#x22;,&#x22;o&#x22;:true}]" nodiscard />

  <ApiMember kind="fn" name="entity.GetPlayerPawns" summary="Returns all player pawns." args="enemies_only?, include_dead?, relative_to?" sig="[{&#x22;s&#x22;:&#x22;entity.GetPlayerPawns&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;enemies_only&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;include_dead&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;relative_to&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawn&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawn&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;enemies_only&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}],&#x22;d&#x22;:&#x22;If true, returns only the pawns of enemies. The default is false.&#x22;,&#x22;o&#x22;:true},{&#x22;n&#x22;:&#x22;include_dead&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}],&#x22;d&#x22;:&#x22;If true, also returns dead pawns. The default is false.&#x22;,&#x22;o&#x22;:true},{&#x22;n&#x22;:&#x22;relative_to&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}],&#x22;d&#x22;:&#x22;The entity that `enemies_only` compares teams with. The default is the pawn from `GetLocalPlayerPawn()`, which can be a controlled bot.&#x22;,&#x22;o&#x22;:true}]" nodiscard />

  <ApiMember kind="fn" name="entity.GetPlayerResource" summary="Returns the player resource entity." args="" sig="[{&#x22;s&#x22;:&#x22;entity.GetPlayerResource&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.C_CSPlayerResource&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerResource&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;client.C_CSPlayerResource&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerResource&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" nodiscard />

  <ApiMember kind="fn" name="entity.GetGameRules" summary="Returns the game rules schema object. Returns **nil** if it is not available." args="" sig="[{&#x22;s&#x22;:&#x22;entity.GetGameRules&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.C_CSGameRules&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSGameRules&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;client.C_CSGameRules&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSGameRules&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" nodiscard />

  <ApiMember kind="fn" name="entity.GetGameModeRules" summary="Returns the game mode rules schema object. Returns **nil** if it is not available." args="" sig="[{&#x22;s&#x22;:&#x22;entity.GetGameModeRules&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.CCSGameModeRules&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/CCSGameModeRules&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;client.CCSGameModeRules&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/CCSGameModeRules&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" nodiscard />

  <ApiMember kind="fn" name="entity.GetWeaponDataByClassName" summary="Returns the weapon vdata for an entity class name. Returns nil if the name is not a known weapon class." args="classname" sig="[{&#x22;s&#x22;:&#x22;entity.GetWeaponDataByClassName&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;classname&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.CCSWeaponBaseVData&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/CCSWeaponBaseVData&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;client.CCSWeaponBaseVData&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/CCSWeaponBaseVData&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;classname&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The schema class name of the weapon.&#x22;}]" nodiscard />

  <ApiMember kind="fn" name="entity.GetWeaponDataByDesignerName" summary="Returns the weapon vdata for a designer name. Returns nil if the name is not a known weapon." args="designer_name" sig="[{&#x22;s&#x22;:&#x22;entity.GetWeaponDataByDesignerName&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;designer_name&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.CCSWeaponBaseVData&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/CCSWeaponBaseVData&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;client.CCSWeaponBaseVData&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/CCSWeaponBaseVData&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;designer_name&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The designer name of the weapon, for example `weapon_ak47`.&#x22;}]" nodiscard />

  <ApiMember kind="type" name="entity.PawnObserveePredicate" summary="A function that decides whether to use the observed pawn instead of the local pawn. Return `true` to use the observed pawn." ret="[[{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;observer_mode&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;server.ObserverMode_t&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/server/ObserverMode_t&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;pawn&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawn&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;observer_mode&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;server.ObserverMode_t&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/server/ObserverMode_t&#x22;}]},{&#x22;n&#x22;:&#x22;pawn&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawn&#x22;}]}]" returns="[{&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]}]">
    <ApiNotes>
      The function is called only while the local player spectates. In other cases the local pawn
      is used.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="type" name="entity.IteratePlayers.Key" ret="[[{&#x22;s&#x22;:&#x22;client.CCSPlayerController&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/CCSPlayerController&#x22;}]]" />

  <ApiMember kind="type" name="entity.IteratePlayers.Value" ret="[[{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawn&#x22;}]]" />

  <ApiMember kind="type" name="entity.IteratePlayers.Table" ret="[[{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;},{&#x22;s&#x22;:&#x22;\u003c&#x22;},{&#x22;s&#x22;:&#x22;entity.IteratePlayers.Key&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/engine/entity#entity-IteratePlayers-Key&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;entity.IteratePlayers.Value&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/engine/entity#entity-IteratePlayers-Value&#x22;},{&#x22;s&#x22;:&#x22;\u003e&#x22;}]]" />

  <ApiMember kind="type" name="entity.IteratePlayers.Iterator" ret="[[{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;table&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;entity.IteratePlayers.Table&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/engine/entity#entity-IteratePlayers-Table&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;index&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;entity.IteratePlayers.Key&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/engine/entity#entity-IteratePlayers-Key&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;entity.IteratePlayers.Key&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/engine/entity#entity-IteratePlayers-Key&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;entity.IteratePlayers.Value&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/engine/entity#entity-IteratePlayers-Value&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;table&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;entity.IteratePlayers.Table&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/engine/entity#entity-IteratePlayers-Table&#x22;}]},{&#x22;n&#x22;:&#x22;index&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;entity.IteratePlayers.Key&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/engine/entity#entity-IteratePlayers-Key&#x22;}],&#x22;o&#x22;:true}]" returns="[{&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;entity.IteratePlayers.Key&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/engine/entity#entity-IteratePlayers-Key&#x22;}]},{&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;entity.IteratePlayers.Value&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/engine/entity#entity-IteratePlayers-Value&#x22;}]}]" />

  <ApiMember kind="type" name="entity.LocalPawnType" summary="The type of the current pawn of the local player. `entity.GetLocalPawnType` returns this value." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]">
    <ApiEnum name="entity.LocalPawnType" values="[[&#x22;kNull&#x22;,&#x22;0&#x22;,&#x22;There is no current pawn, or its type is not known yet during a transition&#x22;],[&#x22;kPlayer&#x22;,&#x22;1&#x22;,&#x22;A player pawn, which is the local player\u0027s own pawn or a pawn that the player controls&#x22;],[&#x22;kObserver&#x22;,&#x22;2&#x22;,&#x22;An observer pawn, which means that the player spectates&#x22;]]" />
  </ApiMember>
</ApiMembers>

<Heading level={2} id="entity-1">
  Entity

  <ApiTag label="object type" />
</Heading>

<ApiSymbol inherits="[{&#x22;n&#x22;:&#x22;value.Named&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/engine/value#valuenamed&#x22;},{&#x22;n&#x22;:&#x22;value.Object&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/engine/value#valueobject&#x22;}]" />

An entity object refers to one entity through the handle of that entity. After the entity is
deleted, `IsValid` returns `false`, and reading or writing a field throws an error. This is
also true when a new entity gets the same index.

`==` returns `true` if two objects refer to the same entity.

The entities that `entity` returns have their schema fields and the methods below.

Read a field with `pawn.m_iHealth` or `pawn:GetField("m_iHealth")`. Write a field with an
assignment or with `SetField`.

The `self` annotation of each method shows the entity classes that the method works with. For
example, player pawn methods work with `client.C_CSPlayerPawn`, and weapon methods need a
weapon. Use the Schema System and Schema Values namespaces to inspect types and to work with
field values.

### Methods: C\_BaseEntity

<ApiMembers>
  <ApiMember kind="method" name="Entity:GetField" summary="Reads a schema field by name. This does the same as `self.<name>`. Use it when the name of the field is held in a variable, or when the field has the same name as a method." args="name" sig="[{&#x22;s&#x22;:&#x22;Entity:GetField&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;name&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;name&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The name of the schema field.&#x22;}]" self="[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}]" nodiscard />

  <ApiMember kind="method" name="Entity:SetField" summary="Writes a schema field by name. This does the same as `self.<name> = value`." args="name, value" sig="[{&#x22;s&#x22;:&#x22;Entity:SetField&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;name&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;value&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;}]" params="[{&#x22;n&#x22;:&#x22;name&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The name of the schema field.&#x22;},{&#x22;n&#x22;:&#x22;value&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}],&#x22;d&#x22;:&#x22;The value to write. It is converted to the schema type of the field.&#x22;}]" self="[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}]" />

  <ApiMember kind="method" name="Entity:GetClassIndex" summary="Returns the numeric class ID of the entity." args="" sig="[{&#x22;s&#x22;:&#x22;Entity:GetClassIndex&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" self="[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}]" nodiscard />

  <ApiMember kind="method" name="Entity:IsRuntimeIndex" summary="Returns `true` if the runtime class of the entity itself has the given class ID." args="classid" sig="[{&#x22;s&#x22;:&#x22;Entity:IsRuntimeIndex&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;classid&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;classid&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}],&#x22;d&#x22;:&#x22;The class ID to compare with.&#x22;}]" self="[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}]" nodiscard />

  <ApiMember kind="method" name="Entity:IsRecursiveClassIndex" summary="Returns `true` if the class of the entity or one of its base classes has the given class ID." args="classid" sig="[{&#x22;s&#x22;:&#x22;Entity:IsRecursiveClassIndex&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;classid&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;classid&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}],&#x22;d&#x22;:&#x22;The class ID to compare with.&#x22;}]" self="[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}]" nodiscard />

  <ApiMember kind="method" name="Entity:EntIndex" summary="Returns the index of the entity in the entity list. This works also after the entity is deleted." args="" sig="[{&#x22;s&#x22;:&#x22;Entity:EntIndex&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" self="[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}]" nodiscard />

  <ApiMember kind="method" name="Entity:GetSkeleton" summary="Returns the skeleton instance of the entity. Returns **nil** if the entity has no skeleton." args="" sig="[{&#x22;s&#x22;:&#x22;Entity:GetSkeleton&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.CSkeletonInstance&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/CSkeletonInstance&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;client.CSkeletonInstance&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/CSkeletonInstance&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" self="[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}]" nodiscard />

  <ApiMember kind="method" name="Entity:GetDesignerName" summary="Returns the designer name of the entity." args="" sig="[{&#x22;s&#x22;:&#x22;Entity:GetDesignerName&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}]]" self="[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}]" nodiscard />

  <ApiMember kind="method" name="Entity:GetHealth" summary="Returns the current health of the entity." args="" sig="[{&#x22;s&#x22;:&#x22;Entity:GetHealth&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" self="[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}]" nodiscard />

  <ApiMember kind="method" name="Entity:IsAlive" summary="Returns `true` if the entity is alive." args="" sig="[{&#x22;s&#x22;:&#x22;Entity:IsAlive&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" self="[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}]" nodiscard />

  <ApiMember kind="method" name="Entity:IsDormant" summary="Returns `true` if the entity is dormant. A dormant entity is an entity that the server does not send updates for at the moment." args="" sig="[{&#x22;s&#x22;:&#x22;Entity:IsDormant&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" self="[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}]" nodiscard />

  <ApiMember kind="method" name="Entity:GetWorldGroupId" summary="Returns the world group ID of the entity." args="" sig="[{&#x22;s&#x22;:&#x22;Entity:GetWorldGroupId&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" self="[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}]" nodiscard />

  <ApiMember kind="method" name="Entity:GetOwnerEntity" summary="Returns the entity that owns this entity. Returns **nil** if the entity has no valid owner." args="" sig="[{&#x22;s&#x22;:&#x22;Entity:GetOwnerEntity&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" self="[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}]" nodiscard />

  <ApiMember kind="method" name="Entity:GetRefEHandle" summary="Returns the handle of the entity as a raw integer. This works also after the entity is deleted. Pass the handle to `entity.LookupByHandle` to get the entity again." args="" sig="[{&#x22;s&#x22;:&#x22;Entity:GetRefEHandle&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" self="[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}]" nodiscard />

  <ApiMember kind="method" name="Entity:IsValid" summary="Returns `true` while the entity exists. Returns `false` after the entity is deleted, also when a new entity gets the same index." args="" sig="[{&#x22;s&#x22;:&#x22;Entity:IsValid&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" self="[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}]" nodiscard />

  <ApiMember kind="method" name="Entity:GetAbsOrigin" summary="Returns the absolute position of the entity in the world." args="" sig="[{&#x22;s&#x22;:&#x22;Entity:GetAbsOrigin&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;}]]" self="[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}]" nodiscard />

  <ApiMember kind="method" name="Entity:SetAbsOrigin" summary="Sets the absolute position of the entity in the world." args="new_origin" sig="[{&#x22;s&#x22;:&#x22;Entity:SetAbsOrigin&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;new_origin&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;}]" params="[{&#x22;n&#x22;:&#x22;new_origin&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;}],&#x22;d&#x22;:&#x22;The new position.&#x22;}]" self="[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}]">
    <ApiNotes>
      This change is made on the client only. An update from the server can overwrite it.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="method" name="Entity:GetAbsAngles" summary="Returns the absolute angles of the entity in the world." args="" sig="[{&#x22;s&#x22;:&#x22;Entity:GetAbsAngles&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;QAngle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/angle#qangle&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;QAngle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/angle#qangle&#x22;}]]" self="[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}]" nodiscard />

  <ApiMember kind="method" name="Entity:SetAbsAngles" summary="Sets the absolute angles of the entity in the world." args="new_angles" sig="[{&#x22;s&#x22;:&#x22;Entity:SetAbsAngles&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;new_angles&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;QAngle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/angle#qangle&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;}]" params="[{&#x22;n&#x22;:&#x22;new_angles&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;QAngle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/angle#qangle&#x22;}],&#x22;d&#x22;:&#x22;The new angles.&#x22;}]" self="[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}]">
    <ApiNotes>
      This change is made on the client only. An update from the server can overwrite it.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="method" name="Entity:GetAbsVelocity" summary="Returns the absolute velocity of the entity." args="" sig="[{&#x22;s&#x22;:&#x22;Entity:GetAbsVelocity&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;}]]" self="[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}]" nodiscard />

  <ApiMember kind="method" name="Entity:GetEntityIdentity" summary="Returns the identity object of the entity." args="" sig="[{&#x22;s&#x22;:&#x22;Entity:GetEntityIdentity&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;entity2.CEntityIdentity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/entity2/CEntityIdentity&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;entity2.CEntityIdentity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/entity2/CEntityIdentity&#x22;}]]" self="[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}]" nodiscard />

  <ApiMember kind="method" name="Entity:GetHitboxPosition" summary="Returns the center of a hitbox volume in world space. Returns **nil** if it is not available." args="i" sig="[{&#x22;s&#x22;:&#x22;Entity:GetHitboxPosition&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;i&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;i&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}],&#x22;d&#x22;:&#x22;The index of the hitbox.&#x22;}]" self="[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}]" nodiscard>
    <ApiNotes>
      For a sphere hitbox, this is the center of the sphere. For a box or capsule hitbox, this is
      the middle point between its two ends. The hitbox transform moves the point into world
      space. The result is the same as `entity:GetHitbox(i):GetCenter()`. To get the origin of the
      transform, use `Hitbox:GetOrigin()`.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="method" name="Entity:GetHitbox" summary="Returns the hitbox with the given index. Returns nil if the index is out of range." args="i" sig="[{&#x22;s&#x22;:&#x22;Entity:GetHitbox&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;i&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;Hitbox&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/engine/entity#hitbox&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;Hitbox&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/engine/entity#hitbox&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;i&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}],&#x22;d&#x22;:&#x22;The index of the hitbox.&#x22;}]" self="[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}]" nodiscard>
    <ApiNotes>
      Hitbox indices are different for each model. They depend on the hitbox set of the model and
      on the meshes that the bodygroups of the entity enable. Index 0 is the first hitbox of this
      model, and it can be any part of the body.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="method" name="Entity:UpdateBones" summary="Calculates the world space bones of this entity again at its current position and pose. After this call, hitbox functions return the data of this frame." args="" sig="[{&#x22;s&#x22;:&#x22;Entity:UpdateBones&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;}]" self="[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}]">
    <ApiNotes>
      Without this call, hitbox functions use the bones that the game calculated last. These bones
      can be behind the current position of the entity. For example, in `override_view` the bones
      of the local pawn are still from the previous frame. This function calculates all bones, so
      call it only before reads that need the latest data.

      Do not call it on a model whose bones follow the animation of another model, such as a HUD
      weapon that follows the HUD arms. The calculation uses the own pose of the model without the
      animation.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="method" name="Entity:GetBoundingBox" summary="Returns the ESP bounds on the screen. The values are the top left corner, the bottom right corner, and the draw alpha." args="" sig="[{&#x22;s&#x22;:&#x22;Entity:GetBoundingBox&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;Vector2D&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector2#vector2d&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;Vector2D&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector2#vector2d&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;Vector2D&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector2#vector2d&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}],[{&#x22;s&#x22;:&#x22;Vector2D&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector2#vector2d&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}],[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" returns="[{&#x22;n&#x22;:&#x22;min&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;Vector2D&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector2#vector2d&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]},{&#x22;n&#x22;:&#x22;max&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;Vector2D&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector2#vector2d&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]},{&#x22;n&#x22;:&#x22;alpha&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]}]" self="[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}]" nodiscard>
    <ApiNotes>
      For players and hostages, the bounds are around the body on the screen. For world entities,
      the bounds use the ESP label positions, so both corners can be the same point.

      Returns **nil** if there is no local or observed pawn, the scene or collision data of the
      entity is missing, the draw alpha of the entity is zero, or the ESP cannot calculate valid
      bounds. Valid bounds can be outside the screen, so a result does not mean that the entity is
      visible.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="method" name="Entity:GetMaxHealth" summary="Returns the maximum health of the entity." args="" sig="[{&#x22;s&#x22;:&#x22;Entity:GetMaxHealth&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" self="[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}]" nodiscard />

  <ApiMember kind="method" name="Entity:IsEnemy" summary="Returns true if this entity is an enemy of the given entity. Without an argument, it compares with the pawn from `entity.GetLocalPlayerPawn()`, which can be a controlled bot. If there is no local pawn, it returns true." args="to?" sig="[{&#x22;s&#x22;:&#x22;Entity:IsEnemy&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;to&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;to&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}],&#x22;d&#x22;:&#x22;The entity to compare with. The default is the pawn from `GetLocalPlayerPawn()`, which can be a controlled bot.&#x22;,&#x22;o&#x22;:true}]" self="[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}]" nodiscard>
    <ApiNotes>
      The default pawn does not change to the spectated player, so the result stays the same when
      the local player dies and spectates an enemy. To follow the camera, pass
      `entity.GetViewPawn()`.
    </ApiNotes>
  </ApiMember>
</ApiMembers>

### Methods: C\_CSPlayerPawnBase

<ApiMembers>
  <ApiMember kind="method" name="Entity:GetPlayerController" summary="Returns the controller of this pawn." args="" sig="[{&#x22;s&#x22;:&#x22;Entity:GetPlayerController&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.CCSPlayerController&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/CCSPlayerController&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;client.CCSPlayerController&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/CCSPlayerController&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" self="[{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawnBase&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawnBase&#x22;}]" nodiscard />

  <ApiMember kind="method" name="Entity:GetActiveWeapon" summary="Returns the active weapon of this pawn." args="" sig="[{&#x22;s&#x22;:&#x22;Entity:GetActiveWeapon&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.C_CSWeaponBase&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSWeaponBase&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;client.C_CSWeaponBase&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSWeaponBase&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" self="[{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawnBase&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawnBase&#x22;}]" nodiscard />

  <ApiMember kind="method" name="Entity:GetMyWeapons" summary="Returns all weapons that this pawn holds." args="" sig="[{&#x22;s&#x22;:&#x22;Entity:GetMyWeapons&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;value.AtomicCollection&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/engine/value#valueatomiccollection&#x22;},{&#x22;s&#x22;:&#x22;\u003c&#x22;},{&#x22;s&#x22;:&#x22;client.C_CSWeaponBase&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSWeaponBase&#x22;},{&#x22;s&#x22;:&#x22;\u003e&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;value.AtomicCollection&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/engine/value#valueatomiccollection&#x22;},{&#x22;s&#x22;:&#x22;\u003c&#x22;},{&#x22;s&#x22;:&#x22;client.C_CSWeaponBase&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSWeaponBase&#x22;},{&#x22;s&#x22;:&#x22;\u003e&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" self="[{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawnBase&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawnBase&#x22;}]" nodiscard>
    <ApiNotes>
      The collection shows the current state of the game. Its indices start at 0.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="method" name="Entity:GetEyeAngles" summary="Returns the eye angles of this pawn." args="" sig="[{&#x22;s&#x22;:&#x22;Entity:GetEyeAngles&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;QAngle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/angle#qangle&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;QAngle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/angle#qangle&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" self="[{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawnBase&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawnBase&#x22;}]" nodiscard />

  <ApiMember kind="method" name="Entity:GetEyePosition" summary="Returns the eye position of this pawn." args="" sig="[{&#x22;s&#x22;:&#x22;Entity:GetEyePosition&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" self="[{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawnBase&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawnBase&#x22;}]" nodiscard />

  <ApiMember kind="method" name="Entity:GetAbsViewOffset" summary="Returns the view offset of this pawn from its origin." args="" sig="[{&#x22;s&#x22;:&#x22;Entity:GetAbsViewOffset&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" self="[{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawnBase&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawnBase&#x22;}]" nodiscard />
</ApiMembers>

### Methods: CCSPlayerController

<ApiMembers>
  <ApiMember kind="method" name="Entity:GetPlayerSlot" summary="Returns the player slot index of this controller." args="" sig="[{&#x22;s&#x22;:&#x22;Entity:GetPlayerSlot&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" self="[{&#x22;s&#x22;:&#x22;client.CCSPlayerController&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/CCSPlayerController&#x22;}]" nodiscard />

  <ApiMember kind="method" name="Entity:GetPlayerUserId" summary="Returns the user ID of this controller." args="" sig="[{&#x22;s&#x22;:&#x22;Entity:GetPlayerUserId&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" self="[{&#x22;s&#x22;:&#x22;client.CCSPlayerController&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/CCSPlayerController&#x22;}]" nodiscard />

  <ApiMember kind="method" name="Entity:GetPawn" summary="Returns the active pawn of this controller. It can be a player pawn or an observer pawn." args="" sig="[{&#x22;s&#x22;:&#x22;Entity:GetPawn&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawnBase&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawnBase&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawnBase&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawnBase&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" self="[{&#x22;s&#x22;:&#x22;client.CCSPlayerController&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/CCSPlayerController&#x22;}]" nodiscard />

  <ApiMember kind="method" name="Entity:GetPlayerPawn" summary="Returns the player pawn of this controller. The player pawn can exist while the controller spectates." args="" sig="[{&#x22;s&#x22;:&#x22;Entity:GetPlayerPawn&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawn&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawn&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" self="[{&#x22;s&#x22;:&#x22;client.CCSPlayerController&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/CCSPlayerController&#x22;}]" nodiscard />

  <ApiMember kind="method" name="Entity:GetObserverPawn" summary="Returns the observer pawn of this controller. Returns **nil** if it is not available. The observer pawn can exist while it is not the active pawn of the controller." args="" sig="[{&#x22;s&#x22;:&#x22;Entity:GetObserverPawn&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.C_CSObserverPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSObserverPawn&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;client.C_CSObserverPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSObserverPawn&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" self="[{&#x22;s&#x22;:&#x22;client.CCSPlayerController&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/CCSPlayerController&#x22;}]" nodiscard />
</ApiMembers>

### Methods: C\_CSPlayerPawn

<ApiMembers>
  <ApiMember kind="method" name="Entity:GetPlayerMaxSpeed" summary="Returns the maximum movement speed of this pawn." args="" sig="[{&#x22;s&#x22;:&#x22;Entity:GetPlayerMaxSpeed&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" self="[{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawn&#x22;}]" nodiscard />

  <ApiMember kind="method" name="Entity:ScaleDamage" summary="Scales raw damage by the armor and hitgroup modifiers of this pawn. This function does not fire a shot." args="damage, weapon_data, hitgroup, attacker?" sig="[{&#x22;s&#x22;:&#x22;Entity:ScaleDamage&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;damage&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;weapon_data&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.CCSWeaponBaseVData&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/CCSWeaponBaseVData&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;hitgroup&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;[, &#x22;},{&#x22;s&#x22;:&#x22;attacker&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawn&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;damage&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}],&#x22;d&#x22;:&#x22;The raw damage.&#x22;},{&#x22;n&#x22;:&#x22;weapon_data&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;client.CCSWeaponBaseVData&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/CCSWeaponBaseVData&#x22;}],&#x22;d&#x22;:&#x22;The weapon vdata for the damage scaling.&#x22;},{&#x22;n&#x22;:&#x22;hitgroup&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}],&#x22;d&#x22;:&#x22;The index of the hitgroup that was hit.&#x22;},{&#x22;n&#x22;:&#x22;attacker&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawn&#x22;}],&#x22;d&#x22;:&#x22;The pawn that attacks. It is used for team modifiers.&#x22;,&#x22;o&#x22;:true}]" self="[{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawn&#x22;}]" nodiscard />

  <ApiMember kind="method" name="Entity:GetBombDamage" summary="Estimates the health that this pawn would lose if the planted bomb exploded now." args="bomb?" sig="[{&#x22;s&#x22;:&#x22;Entity:GetBombDamage&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;bomb&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.C_PlantedC4&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_PlantedC4&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}],[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;bomb&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;client.C_PlantedC4&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_PlantedC4&#x22;}],&#x22;d&#x22;:&#x22;The planted bomb. The default is the active bomb.&#x22;,&#x22;o&#x22;:true}]" returns="[{&#x22;n&#x22;:&#x22;minimum&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}],&#x22;d&#x22;:&#x22;The lowest expected damage. This is **nil** if no bomb is ticking, or if the pawn is dormant, dead or cannot take damage.&#x22;},{&#x22;n&#x22;:&#x22;maximum&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}],&#x22;d&#x22;:&#x22;The highest expected damage.&#x22;}]" self="[{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawn&#x22;}]" nodiscard>
    <ApiNotes>
      On maps with baked bomb damage, the game's own damage table is used, so both values are
      equal. On other maps, the damage falls off with the distance and armor is applied. The
      minimum and maximum are measured over the body of the pawn. Returns `0, 0` if the pawn is
      out of range. The result does not depend on the bomb visuals settings.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="method" name="Entity:GetPlayerSimulation" summary="Copies the state of this pawn into a separate simulation snapshot. Use `simulation.Player:RunCommand` to move the snapshot forward. This does not change the real player." args="optimizations?" sig="[{&#x22;s&#x22;:&#x22;Entity:GetPlayerSimulation&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;optimizations&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;simulation.SimOpt&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#simulation-SimOpt&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;simulation.Player&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#simulationplayer&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;simulation.Player&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#simulationplayer&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;optimizations&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;simulation.SimOpt&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#simulation-SimOpt&#x22;}],&#x22;d&#x22;:&#x22;The optimizations to use. The default is `simulation.SimOpt.kNoPlayerCollision | simulation.SimOpt.kNoRareEvents | simulation.SimOpt.kNoWeaponSimulation`.&#x22;,&#x22;o&#x22;:true}]" self="[{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawn&#x22;}]" nodiscard>
    <ApiNotes>
      By default, the simulation skips the weapon simulation and the costly movement details. Pass
      `simulation.SimOpt.kNone` for the full simulation.

      For the local player, use the snapshot that the movement callback gives you.
    </ApiNotes>
  </ApiMember>
</ApiMembers>

### Methods: CCSPlayerController / C\_CSPlayerPawnBase

<ApiMembers>
  <ApiMember kind="method" name="Entity:GetPlayerName" summary="Returns the display name of the player." args="" sig="[{&#x22;s&#x22;:&#x22;Entity:GetPlayerName&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" self="[{&#x22;s&#x22;:&#x22;client.CCSPlayerController&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/CCSPlayerController&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawnBase&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawnBase&#x22;}]" nodiscard />

  <ApiMember kind="method" name="Entity:GetPlayerAvatar" summary="Returns the 32x32 Steam avatar of the player. The name ESP and the spectator list draw the same avatar. For a bot, this function returns the icon of its team, which is larger. Pass a size to `render.DrawImage` to draw both at the same size." args="" sig="[{&#x22;s&#x22;:&#x22;Entity:GetPlayerAvatar&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;Image&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/render#image&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;Image&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/render#image&#x22;}]]" self="[{&#x22;s&#x22;:&#x22;client.CCSPlayerController&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/CCSPlayerController&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawnBase&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawnBase&#x22;}]" nodiscard>
    <ApiNotes>
      The avatar is loaded one or two frames after the player first appears. Until then, and for a
      user without an avatar, this function returns an empty image. Its `failed` field is true, and
      `render.DrawImage` does not draw it. Call this function in every frame, and do not keep the
      result.
    </ApiNotes>
  </ApiMember>
</ApiMembers>

### Methods: C\_CSWeaponBase

<ApiMembers>
  <ApiMember kind="method" name="Entity:GetWeaponData" summary="Returns the vdata of the weapon." args="" sig="[{&#x22;s&#x22;:&#x22;Entity:GetWeaponData&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.CCSWeaponBaseVData&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/CCSWeaponBaseVData&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;client.CCSWeaponBaseVData&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/CCSWeaponBaseVData&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" self="[{&#x22;s&#x22;:&#x22;client.C_CSWeaponBase&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSWeaponBase&#x22;}]" nodiscard />

  <ApiMember kind="method" name="Entity:GetInaccuracy" summary="Returns the current inaccuracy of this weapon." args="" sig="[{&#x22;s&#x22;:&#x22;Entity:GetInaccuracy&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" self="[{&#x22;s&#x22;:&#x22;client.C_CSWeaponBase&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSWeaponBase&#x22;}]" nodiscard />

  <ApiMember kind="method" name="Entity:GetSpread" summary="Returns the current spread of this weapon." args="" sig="[{&#x22;s&#x22;:&#x22;Entity:GetSpread&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" self="[{&#x22;s&#x22;:&#x22;client.C_CSWeaponBase&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSWeaponBase&#x22;}]" nodiscard />
</ApiMembers>

### Methods: C\_EconEntity

<ApiMembers>
  <ApiMember kind="method" name="Entity:GetItem" summary="Returns the econ item view of this entity." args="" sig="[{&#x22;s&#x22;:&#x22;Entity:GetItem&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.C_EconItemView&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_EconItemView&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;client.C_EconItemView&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_EconItemView&#x22;}]]" self="[{&#x22;s&#x22;:&#x22;client.C_EconEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_EconEntity&#x22;}]" nodiscard />
</ApiMembers>

### Methods: C\_BaseModelEntity

<ApiMembers>
  <ApiMember kind="method" name="Entity:SetGlowColor" summary="Adds this entity to the glow list of the current frame with the given color. Call it in every frame while you draw. Entities that cannot be drawn are ignored." args="color" sig="[{&#x22;s&#x22;:&#x22;Entity:SetGlowColor&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;color&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;Color&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/color#color-1&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;}]" params="[{&#x22;n&#x22;:&#x22;color&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;Color&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/color#color-1&#x22;}],&#x22;d&#x22;:&#x22;The glow color.&#x22;}]" self="[{&#x22;s&#x22;:&#x22;client.C_BaseModelEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseModelEntity&#x22;}]" />
</ApiMembers>

## Hitbox<ApiTag label="object type" />

<ApiSymbol inherits="[{&#x22;n&#x22;:&#x22;modellib.CHitBox&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/modellib/CHitBox&#x22;}]" />

One hitbox of the skeleton of an entity. Its fields are read from the `modellib.CHitBox` of the
model through the schema, so the field names are the names that the game uses.

Hitbox data is read-only and moves with the entity when the entity is animated. Use it only
while the entity is valid. Reading a field throws an error if the hitbox no longer exists.

<ApiMembers>
  <ApiMember kind="method" name="Hitbox:GetOrigin" summary="Returns the origin of the world transform of this hitbox. Returns nil if it is not available. The transform can come from a bone or from a shape without a bone. To get the center of the hitbox volume, use `Hitbox:GetCenter()`." args="" sig="[{&#x22;s&#x22;:&#x22;Hitbox:GetOrigin&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" nodiscard />

  <ApiMember kind="method" name="Hitbox:GetTransform" summary="Returns the world transform of this hitbox. Returns nil if it is not available." args="" sig="[{&#x22;s&#x22;:&#x22;Hitbox:GetTransform&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;CTransform&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/transform#ctransform&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;CTransform&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/transform#ctransform&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" nodiscard>
    <ApiNotes>
      The transform places the shape of the hitbox in the world. This also works for shapes that do
      not follow a bone.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="method" name="Hitbox:GetCenter" summary="Returns the center of the volume of this hitbox in world space. Returns nil if it is not available. The result is the same as `entity:GetHitboxPosition(index)`." args="" sig="[{&#x22;s&#x22;:&#x22;Hitbox:GetCenter&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" nodiscard />

  <ApiMember kind="method" name="Hitbox:GetCapsule" summary="Returns this hitbox as a capsule in world space. The values are the centers of the two end spheres and the radius, with the scale of the transform applied. For a sphere hitbox, both ends are the same point. Returns **nil** for other shapes, or if the hitbox is not available." args="" sig="[{&#x22;s&#x22;:&#x22;Hitbox:GetCapsule&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}],[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}],[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" returns="[{&#x22;n&#x22;:&#x22;start&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}],&#x22;d&#x22;:&#x22;The center of the first end sphere.&#x22;},{&#x22;n&#x22;:&#x22;finish&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}],&#x22;d&#x22;:&#x22;The center of the second end sphere.&#x22;},{&#x22;n&#x22;:&#x22;radius&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}],&#x22;d&#x22;:&#x22;The radius in world units.&#x22;}]" nodiscard>
    <ApiNotes>
      To draw the capsule, project each end with `projection.SphereEllipse(end, radius)`. To test
      whether a segment hits it, pass the results to `trace.IntersectCapsule`.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="method" name="Hitbox:GetOwnerEntity" summary="Returns the entity that this hitbox belongs to." args="" sig="[{&#x22;s&#x22;:&#x22;Hitbox:GetOwnerEntity&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;Entity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/engine/entity#entity-1&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;Entity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/engine/entity#entity-1&#x22;}]]" nodiscard />

  <ApiMember kind="method" name="Hitbox:GetIndex" summary="Returns the index of this hitbox. This is the index that was passed to `entity:GetHitbox`." args="" sig="[{&#x22;s&#x22;:&#x22;Hitbox:GetIndex&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" nodiscard />
</ApiMembers>
