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

---
title: entity
description: Query game entities and call methods on entity objects
icon: users
---

The `entity` namespace queries game entities and exposes methods you can call on entity objects.

## get

```lua
entity.get(idx: number[, by_userid: boolean]): entity
```

> Returns a pointer to the specified entity.

<Schema title="Parameters">
  <SchemaField name="idx" type="number" required>
    Index of the entity.
  </SchemaField>

  <SchemaField name="by_userid" type="boolean">
    If true then idx will be perceived as a userid.
  </SchemaField>
</Schema>

<Schema title="Returns">
  <SchemaField name="entity" type="entity">
    A pointer to the specified entity.
  </SchemaField>
</Schema>

## get\_local\_player

```lua
entity.get_local_player(): entity
```

> Returns a pointer to the local player.

<Schema title="Returns">
  <SchemaField name="entity" type="entity">
    A pointer to the local player.
  </SchemaField>
</Schema>

## get\_players

```lua
entity.get_players([enemies_only: boolean, include_dormant: boolean, callback: function]): table
```

> If the callback is `nil`, it returns the table of pointers to player entities. Otherwise the callback will be called. Access the player pointer using the arguments of the specified callback.

<Schema title="Parameters">
  <SchemaField name="enemies_only" type="boolean">
    If true then only enemies will be included.
  </SchemaField>

  <SchemaField name="include_dormant" type="boolean">
    If true then dormant players will be included.
  </SchemaField>

  <SchemaField name="callback" type="function">
    A callback with an entity pointer as the argument.
  </SchemaField>
</Schema>

<Schema title="Returns">
  <SchemaField name="players" type="table">
    The table of pointers to player entities.
  </SchemaField>
</Schema>

## get\_entities

```lua
entity.get_entities([class: number/string, include_dormant: boolean, callback: function]): table
```

> If the callback is `nil`, it returns the table of pointers to entities. Otherwise the callback will be called. Access the entity pointer using the arguments of the specified callback.

<Schema title="Parameters">
  <SchemaField name="class" type="number/string">
    Either a name or an ID of the needed class. Pass `nil` to get every entity.
  </SchemaField>

  <SchemaField name="include_dormant" type="boolean">
    If true then dormant players will be included.
  </SchemaField>

  <SchemaField name="callback" type="function">
    A callback with an entity pointer as the argument.
  </SchemaField>
</Schema>

<Schema title="Returns">
  <SchemaField name="entities" type="table">
    The table of pointers to entities.
  </SchemaField>
</Schema>

## get\_threat

```lua
entity.get_threat([ hittable: boolean ]): entity
```

> Returns a pointer to the current threat.

<Schema title="Parameters">
  <SchemaField name="hittable" type="boolean">
    If true then returns a pointer to the player that can hit you.
  </SchemaField>
</Schema>

<Schema title="Returns">
  <SchemaField name="entity" type="entity">
    A pointer to the current threat.
  </SchemaField>
</Schema>

## get\_game\_rules

```lua
entity.get_game_rules(): entity
```

> Returns the pointer to the CCSGameRulesProxy instance, or `nil` if none exists.

<Schema title="Returns">
  <SchemaField name="entity" type="entity">
    The pointer to the CCSGameRulesProxy instance, or `nil` if none exists.
  </SchemaField>
</Schema>

## get\_player\_resource

```lua
entity.get_player_resource(): entity
```

> Returns the pointer to the CCSPlayerResource instance, or `nil` if none exists.

<Schema title="Returns">
  <SchemaField name="entity" type="entity">
    The pointer to the CCSPlayerResource instance, or `nil` if none exists.
  </SchemaField>
</Schema>

### Netprops

### Getting FFI pointer

```lua
ent[0]: userdata
```

> Returns the `ffi` pointer to the entity.

<Schema title="Returns">
  <SchemaField name="pointer" type="userdata">
    The `ffi` pointer to the entity.
  </SchemaField>
</Schema>

### Getting netprop values

```lua
ent.prop_name: any
```

```lua
ent.prop_name[index]: any
```

```lua
ent["prop_name"]: any
```

<Schema title="Parameters">
  <SchemaField name="prop_name" type="string" required>
    Name of the networked property.
  </SchemaField>

  <SchemaField name="index" type="number">
    Optional. If prop\_name is an array, the value at this array index will be returned.
  </SchemaField>
</Schema>

<Expandable title="Example">
  ```lua lines=false
  local on_createmove = function(cmd)
      local localplayer = entity.get_local_player()
      
      if localplayer == nil then
          return
      end
      
      -- example 1
      local health = localplayer.m_iHealth

      -- example 2 [array netprops]
      local pitch = localplayer.m_flPoseParameter[12]

      -- example 3
      local stamina = localplayer['m_flStamina']
      
      print(('my health is: %d | pitch: %.1f | stamina: %d%%'):format(
          health, pitch,
          100 - (80 / 100 * stamina)
      ))
  end

  events.createmove:set(on_createmove)
  ```
</Expandable>

### Setting netprop values

```lua
ent.prop_name = value
```

```lua
ent.prop_name[index] = value
```

```lua
ent["prop_name"] = value
```

<Schema title="Parameters">
  <SchemaField name="prop_name" type="string" required>
    Name of the networked property.
  </SchemaField>

  <SchemaField name="value" type="any" required>
    The property will be set to this value.
  </SchemaField>

  <SchemaField name="index" type="number">
    Optional. If prop\_name is an array, the value at this array index will be set.
  </SchemaField>
</Schema>

<Expandable title="Example">
  ```lua lines=false
  for _, player in ipairs(entity.get_players(true)) do
    -- example 1
    player.m_bSpotted = true
    
    -- example 2 [array netprops]
    player.m_flPoseParameter[12] = 0.5
    
    -- example 3
    player['m_nSkin'] = 2
  end
  ```
</Expandable>

### Common

## is\_player

```lua
ent:is_player(): boolean
```

> Returns `true` if the entity is a player entity.

<Schema title="Returns">
  <SchemaField name="is_player" type="boolean">
    `true` if the entity is a player entity.
  </SchemaField>
</Schema>

## is\_weapon

```lua
ent:is_weapon(): boolean
```

> Returns `true` if the entity is a weapon entity.

<Schema title="Returns">
  <SchemaField name="is_weapon" type="boolean">
    `true` if the entity is a weapon entity.
  </SchemaField>
</Schema>

## is\_dormant

```lua
ent:is_dormant(): boolean
```

> Returns `true` if the entity is dormant.

<Schema title="Returns">
  <SchemaField name="is_dormant" type="boolean">
    `true` if the entity is dormant.
  </SchemaField>
</Schema>

## is\_bot

```lua
ent:is_bot(): boolean
```

> Returns `true` if the entity is a bot.

<Schema title="Returns">
  <SchemaField name="is_bot" type="boolean">
    `true` if the entity is a bot.
  </SchemaField>
</Schema>

## is\_alive

```lua
ent:is_alive(): boolean
```

> Returns `true` if the entity is alive.

<Schema title="Returns">
  <SchemaField name="is_alive" type="boolean">
    `true` if the entity is alive.
  </SchemaField>
</Schema>

## is\_enemy

```lua
ent:is_enemy(): boolean
```

> Returns `true` if the entity is an enemy.

<Schema title="Returns">
  <SchemaField name="is_enemy" type="boolean">
    `true` if the entity is an enemy.
  </SchemaField>
</Schema>

## is\_visible

```lua
ent:is_visible(): boolean
```

> Returns `true` if the entity is visible.

<Schema title="Returns">
  <SchemaField name="is_visible" type="boolean">
    `true` if the entity is visible.
  </SchemaField>
</Schema>

## is\_occluded

```lua
ent:is_occluded([ to_entity: entity ]): boolean
```

> If the `to_entity` is `nil`, the local player is checked. Returns `true` if the entity is completely occluded for the current entity.

<Schema title="Parameters">
  <SchemaField name="to_entity" type="entity">
    Optional. The entity that will be checked for occlusion.
  </SchemaField>
</Schema>

<Schema title="Returns">
  <SchemaField name="is_occluded" type="boolean">
    `true` if the entity is completely occluded for the current entity.
  </SchemaField>
</Schema>

## get\_index

```lua
ent:get_index(): number
```

> Returns the index of the entity.

<Schema title="Returns">
  <SchemaField name="index" type="number">
    The index of the entity.
  </SchemaField>
</Schema>

## get\_name

```lua
ent:get_name(): string
```

> Returns the player name, weapon name or class name if the entity is neither of those.

<Schema title="Returns">
  <SchemaField name="name" type="string">
    The player name, weapon name or class name if the entity is neither of those.
  </SchemaField>
</Schema>

## get\_origin

```lua
ent:get_origin(): vector
```

> Returns the position vector of the entity.

<Schema title="Returns">
  <SchemaField name="origin" type="vector">
    The position vector of the entity.
  </SchemaField>
</Schema>

## get\_angles

```lua
ent:get_angles(): vector
```

> Returns the absolute angles of the entity.

<Schema title="Returns">
  <SchemaField name="angles" type="vector">
    The absolute angles of the entity.
  </SchemaField>
</Schema>

## get\_simulation\_time

```lua
ent:get_simulation_time(): table
```

> Returns a table containing `current` and `old` simulation time values.

<Schema title="Returns">
  <SchemaField name="simulation_time" type="table">
    A table containing `current` and `old` simulation time values.
  </SchemaField>
</Schema>

## get\_classname

```lua
ent:get_classname(): string
```

> Returns the name of the entity's class.

<Schema title="Returns">
  <SchemaField name="classname" type="string">
    The name of the entity's class.
  </SchemaField>
</Schema>

## get\_classid

```lua
ent:get_classid(): number
```

> Returns the ID of the entity's class.

<Schema title="Returns">
  <SchemaField name="classid" type="number">
    The ID of the entity's class.
  </SchemaField>
</Schema>

## get\_materials

```lua
ent:get_materials(): table
```

> Returns a table containing all materials used by the entity.

<Schema title="Returns">
  <SchemaField name="materials" type="table">
    A table containing all materials used by the entity.
  </SchemaField>
</Schema>

## get\_model\_name

```lua
ent:get_model_name(): string
```

> Returns the model name of the entity.

<Schema title="Returns">
  <SchemaField name="model_name" type="string">
    The model name of the entity.
  </SchemaField>
</Schema>

### Players

## get\_network\_state

```lua
ent:get_network_state(): number
```

> Returns the network state of the player.

<Schema title="Returns">
  <SchemaField name="network_state" type="number">
    The network state of the player.

    <Expandable title="Possible values">
      <SchemaField name="0" type="number">
        The entity is not dormant.
      </SchemaField>

      <SchemaField name="1" type="number">
        The entity is dormant but the cheat has 100% info where the player is.
      </SchemaField>

      <SchemaField name="2" type="number">
        The entity is dormant (updated by Shared ESP).
      </SchemaField>

      <SchemaField name="3" type="number">
        The entity is dormant (updated by Sounds).
      </SchemaField>

      <SchemaField name="4" type="number">
        The entity is dormant (not updated).
      </SchemaField>

      <SchemaField name="5" type="number">
        The entity is dormant (data is unavailable or too old).
      </SchemaField>
    </Expandable>
  </SchemaField>
</Schema>

## get\_bbox

```lua
ent:get_bbox(): table
```

> Returns a table containing `pos1`, `pos2`, and `alpha` values.

<Schema title="Returns">
  <SchemaField name="bbox" type="table">
    A table containing `pos1`, `pos2`, and `alpha` values.
  </SchemaField>
</Schema>

## get\_player\_info

```lua
ent:get_player_info(): table
```

> Returns a table containing information from the `player_info_t` structure of the entity.

<Schema title="Returns">
  <SchemaField name="player_info" type="table">
    A table containing information from the `player_info_t` structure of the entity.

    <Expandable title="Table values">
      <SchemaField name="is_hltv" type="boolean" />

      <SchemaField name="is_fake_player" type="boolean" />

      <SchemaField name="steamid" type="number" />

      <SchemaField name="steamid64" type="number" />

      <SchemaField name="userid" type="number" />

      <SchemaField name="files_downloaded" type="number" />
    </Expandable>
  </SchemaField>
</Schema>

## get\_player\_weapon

```lua
ent:get_player_weapon([all_weapons: boolean]): entity / table
```

> Returns a pointer to the player's weapon entity.
>
> If `all_weapons` is `true`, returns a table containing pointers to every weapon entity the player is currently carrying.

<Schema title="Parameters">
  <SchemaField name="all_weapons" type="boolean">
    If true then all weapons will be included.
  </SchemaField>
</Schema>

<Schema title="Returns">
  <SchemaField name="weapon" type="entity / table">
    A pointer to the player's weapon entity. If `all_weapons` is `true`, a table containing pointers to every weapon entity the player is currently carrying.
  </SchemaField>
</Schema>

## get\_anim\_state

```lua
ent:get_anim_state(): table
```

> Returns a table containing information about the animation state of the player.

<Schema title="Returns">
  <SchemaField name="anim_state" type="table">
    A table containing information about the animation state of the player.
  </SchemaField>
</Schema>

<Expandable title="animation_state">
  <Schema>
    <SchemaField name="abs_yaw" type="number" />

    <SchemaField name="abs_yaw_last" type="number" />

    <SchemaField name="acceleration" type="vector" />

    <SchemaField name="acceleration_weight" type="number" />

    <SchemaField name="action_weight_bias_remainder" type="number" />

    <SchemaField name="adjust_started" type="boolean" />

    <SchemaField name="aim_matrix_transition" type="number" />

    <SchemaField name="aim_matrix_transition_delay" type="number" />

    <SchemaField name="aim_pitch_max" type="number" />

    <SchemaField name="aim_pitch_min" type="number" />

    <SchemaField name="aim_yaw_max" type="number" />

    <SchemaField name="aim_yaw_min" type="number" />

    <SchemaField name="anim_duck_amount" type="number" />

    <SchemaField name="animstate_model_version" type="number" />

    <SchemaField name="cached_model_index" type="number" />

    <SchemaField name="camera_smooth_height" type="number" />

    <SchemaField name="crouch_walk_aim" type="userdata" />

    <SchemaField name="defuse_started" type="boolean" />

    <SchemaField name="duck_additional" type="number" />

    <SchemaField name="duration_in_air" type="number" />

    <SchemaField name="duration_move_weight_is_too_high" type="number" />

    <SchemaField name="duration_moving" type="number" />

    <SchemaField name="duration_still" type="number" />

    <SchemaField name="duration_strafing" type="number" />

    <SchemaField name="eye_pitch" type="number" />

    <SchemaField name="eye_position_smooth_lerp" type="number" />

    <SchemaField name="eye_yaw" type="number" />

    <SchemaField name="feet_crossed" type="boolean" />

    <SchemaField name="first_foot_plant_since_init" type="boolean" />

    <SchemaField name="first_run_since_init" type="boolean" />

    <SchemaField name="flashed" type="boolean" />

    <SchemaField name="foot_left" type="userdata" />

    <SchemaField name="foot_lerp" type="number" />

    <SchemaField name="foot_right" type="userdata" />

    <SchemaField name="in_air_smooth_value" type="number" />

    <SchemaField name="jump_to_fall" type="number" />

    <SchemaField name="ladder_speed" type="number" />

    <SchemaField name="ladder_weight" type="number" />

    <SchemaField name="land_anim_multiplier" type="number" />

    <SchemaField name="landed_on_ground_this_frame" type="boolean" />

    <SchemaField name="landing" type="boolean" />

    <SchemaField name="last_foot_plant_update" type="number" />

    <SchemaField name="last_rendered_eye_z" type="number" />

    <SchemaField name="last_time_velocity_over_ten" type="number" />

    <SchemaField name="last_update_frame" type="number" />

    <SchemaField name="last_update_increment" type="number" />

    <SchemaField name="last_update_time" type="number" />

    <SchemaField name="last_velocity_test_time" type="number" />

    <SchemaField name="layer_order_preset" type="userdata" />

    <SchemaField name="left_ground_height" type="number" />

    <SchemaField name="left_the_ground_this_frame" type="boolean" />

    <SchemaField name="move_weight" type="number" />

    <SchemaField name="move_weight_smoothed" type="number" />

    <SchemaField name="move_yaw" type="number" />

    <SchemaField name="move_yaw_current_to_ideal" type="number" />

    <SchemaField name="move_yaw_ideal" type="number" />

    <SchemaField name="next_twitch_time" type="number" />

    <SchemaField name="on_ground" type="boolean" />

    <SchemaField name="on_ladder" type="boolean" />

    <SchemaField name="plant_anim_started" type="boolean" />

    <SchemaField name="player" type="entity" />

    <SchemaField name="player_is_accelerating" type="boolean" />

    <SchemaField name="pose_param_mappings" type="userdata" />

    <SchemaField name="position_current" type="vector" />

    <SchemaField name="position_last" type="vector" />

    <SchemaField name="previous_move_state" type="number" />

    <SchemaField name="primary_cycle" type="number" />

    <SchemaField name="recrouch_weight" type="number" />

    <SchemaField name="smooth_height_valid" type="boolean" />

    <SchemaField name="speed_as_portion_of_crouch_top_speed" type="number" />

    <SchemaField name="speed_as_portion_of_run_top_speed" type="number" />

    <SchemaField name="speed_as_portion_of_walk_top_speed" type="number" />

    <SchemaField name="stand_run_aim" type="userdata" />

    <SchemaField name="stand_walk_aim" type="userdata" />

    <SchemaField name="static_approach_speed" type="number" />

    <SchemaField name="step_height_left" type="number" />

    <SchemaField name="step_height_right" type="number" />

    <SchemaField name="strafe_change_cycle" type="number" />

    <SchemaField name="strafe_change_target_weight" type="number" />

    <SchemaField name="strafe_change_weight" type="number" />

    <SchemaField name="strafe_change_weight_smooth_fall_off" type="number" />

    <SchemaField name="strafe_changing" type="boolean" />

    <SchemaField name="strafe_sequence" type="number" />

    <SchemaField name="stutter_step" type="number" />

    <SchemaField name="target_acceleration" type="vector" />

    <SchemaField name="time_of_last_known_injury" type="number" />

    <SchemaField name="time_to_align_lower_body" type="number" />

    <SchemaField name="twitch_anim_started" type="boolean" />

    <SchemaField name="velocity" type="vector" />

    <SchemaField name="velocity_last" type="vector" />

    <SchemaField name="velocity_length_xy" type="number" />

    <SchemaField name="velocity_length_z" type="number" />

    <SchemaField name="velocity_normalized" type="vector" />

    <SchemaField name="velocity_normalized_non_zero" type="vector" />

    <SchemaField name="walk_run_transition" type="number" />

    <SchemaField name="walk_to_run_transition_state" type="boolean" />

    <SchemaField name="weapon" type="entity" />

    <SchemaField name="weapon_last" type="entity" />

    <SchemaField name="weapon_last_bone_setup" type="entity" />
  </Schema>
</Expandable>

## get\_anim\_overlay

```lua
ent:get_anim_overlay([idx: number]): table
```

> Returns a table containing information about the specified animation layer. Pass `nil` to get every animation layer.

<Schema title="Parameters">
  <SchemaField name="idx" type="number">
    Index of the animation layer.
  </SchemaField>
</Schema>

<Schema title="Returns">
  <SchemaField name="anim_overlay" type="table">
    A table containing information about the specified animation layer.
  </SchemaField>
</Schema>

<Expandable title="animation_overlay">
  <Schema>
    <SchemaField name="activity" type="number" />

    <SchemaField name="cycle" type="number" />

    <SchemaField name="dispatched_dst" type="number" />

    <SchemaField name="dispatched_src" type="number" />

    <SchemaField name="dispatched_studio_hdr" type="userdata" />

    <SchemaField name="invalidate_physics_bits" type="number" />

    <SchemaField name="layer_animtime" type="number" />

    <SchemaField name="layer_fade_outtime" type="number" />

    <SchemaField name="order" type="number" />

    <SchemaField name="owner" type="entity" />

    <SchemaField name="playback_rate" type="number" />

    <SchemaField name="prev_cycle" type="number" />

    <SchemaField name="sequence" type="number" />

    <SchemaField name="weight" type="number" />

    <SchemaField name="weight_delta_rate" type="number" />
  </Schema>
</Expandable>

## get\_eye\_position

```lua
ent:get_eye_position(): vector
```

> Returns the eye position of the player.

<Schema title="Returns">
  <SchemaField name="eye_position" type="vector">
    The eye position of the player.
  </SchemaField>
</Schema>

## get\_bone\_position

```lua
ent:get_bone_position(idx: number): vector
```

> Returns the position of the specified bone.

<Schema title="Parameters">
  <SchemaField name="idx" type="number" required>
    Index of the bone.
  </SchemaField>
</Schema>

<Schema title="Returns">
  <SchemaField name="bone_position" type="vector">
    The position of the specified bone.
  </SchemaField>
</Schema>

## get\_hitbox\_position

```lua
ent:get_hitbox_position(idx: number): vector
```

> Returns the position of the specified hitbox.

<Schema title="Parameters">
  <SchemaField name="idx" type="number" required>
    Index of the hitbox.
  </SchemaField>
</Schema>

<Schema title="Returns">
  <SchemaField name="hitbox_position" type="vector">
    The position of the specified hitbox.
  </SchemaField>
</Schema>

## get\_steam\_avatar

```lua
ent:get_steam_avatar(): texture
```

> Returns a pointer to the Steam avatar image object of the specified entity.

<Schema title="Returns">
  <SchemaField name="avatar" type="texture">
    A pointer to the Steam avatar image object of the specified entity.
  </SchemaField>
</Schema>

## get\_xuid

```lua
ent:get_xuid(): string
```

> Returns the Steam ID of the player.

<Schema title="Returns">
  <SchemaField name="xuid" type="string">
    The Steam ID of the player.
  </SchemaField>
</Schema>

## get\_resource

```lua
ent:get_resource(): entity
```

> Returns the pointer to the CCSPlayerResource instance attached to the player, or `nil` if none exists.

<Schema title="Returns">
  <SchemaField name="resource" type="entity">
    The pointer to the CCSPlayerResource instance attached to the player, or `nil` if none exists.
  </SchemaField>
</Schema>

## get\_spectators

```lua
ent:get_spectators(): table
```

> Returns a table of pointers to the players that are currently spectating the specified player.

<Schema title="Returns">
  <SchemaField name="spectators" type="table">
    A table of pointers to the players that are currently spectating the specified player.
  </SchemaField>
</Schema>

## set\_icon

```lua
ent:set_icon([icon: string])
```

> Sets an icon in the scoreboard next to the specified player's avatar. The icon will be removed if no icon was provided.

<Schema title="Parameters">
  <SchemaField name="icon" type="string">
    Optional. URL to the icon or a panorama path.
  </SchemaField>
</Schema>

## simulate\_movement

```lua
ent:simulate_movement([origin: vector, velocity: vector, flags: number]): simulation_context
```

> Predicts a player's movement. Returns a `simulation_context` object — call `:think()` on it to run the simulation, then read the result fields.

<Schema title="Parameters">
  <SchemaField name="origin" type="vector">
    Origin to simulate from. Defaults to the player's current origin.
  </SchemaField>

  <SchemaField name="velocity" type="vector">
    Velocity to simulate with. Defaults to the player's current velocity.
  </SchemaField>

  <SchemaField name="flags" type="number">
    `m_fFlags` 32-bit prediction mask. Defaults to the player's current `m_fFlags`.
  </SchemaField>
</Schema>

<Schema title="Returns">
  <SchemaField name="simulation_context" type="simulation_context">
    A `simulation_context` object holding the simulation tools and results.
  </SchemaField>
</Schema>

<Expandable title="Example">
  ```lua lines=false
  local me = entity.get_local_player()

  -- build a context from the player's current state, then advance 1 tick
  local sim = me:simulate_movement()
  sim:think(1)

  print(sim.origin, sim.velocity, sim.did_hit_collision)
  ```
</Expandable>

<AccordionGroup>
  <Accordion title="struct simulation_context">
    Returned by [`:simulate_movement`](#simulate_movement). Run the simulation with `:think()`, then read the populated result fields off the same object.

    <Schema>
      <SchemaField name="think" type="function">
        Runs the movement simulation for the given number of ticks (defaults to `1`), populating the fields below. `:think([ticks: number])`
      </SchemaField>

      <SchemaField name="origin" type="vector">
        Position of the player after simulation.
      </SchemaField>

      <SchemaField name="velocity" type="vector">
        Velocity of the player after simulation.
      </SchemaField>

      <SchemaField name="view_offset" type="number">
        Z axis view offset. Used to calculate the eye position.
      </SchemaField>

      <SchemaField name="duck_amount" type="number">
        m\_flDuckAmount value of the player after simulation.
      </SchemaField>

      <SchemaField name="did_hit_collision" type="boolean">
        Flags whether the player hit a collision during the simulation.
      </SchemaField>

      <SchemaField name="obb_mins" type="vector">
        Player's bounding box's minimum points.
      </SchemaField>

      <SchemaField name="obb_maxs" type="vector">
        Player's bounding box's maximum points.
      </SchemaField>

      <SchemaField name="move" type="vector" />

      <SchemaField name="simulation_ticks" type="number">
        The number of ticks over which the simulation was conducted.
      </SchemaField>

      <SchemaField name="gravity_per_apply" type="number">
        Indicates the applied gravitational force during the simulation.
      </SchemaField>

      <SchemaField name="original_max_speed" type="number">
        The player's maximum speed before the simulation.
      </SchemaField>

      <SchemaField name="max_speed" type="number">
        The maximum speed achieved by the player during the simulation.
      </SchemaField>

      <SchemaField name="is_speed_cropped" type="boolean" />

      <SchemaField name="velocity_modifier" type="number">
        m\_flVelocityModifier value of the player after simulation.
      </SchemaField>

      <SchemaField name="duck_speed" type="number">
        The simulated speed at which the player can be crouching.
      </SchemaField>

      <SchemaField name="stamina" type="number">
        `m_flStamina` value of the player after simulation.
      </SchemaField>

      <SchemaField name="surface_friction" type="number">
        m\_surfaceFriction value of the player after simulation.
      </SchemaField>

      <SchemaField name="trace" type="trace">
        Post-simulation trace object.
      </SchemaField>
    </Schema>
  </Accordion>
</AccordionGroup>

### Weapons

<Note>
  Access functions listed below via [`:get_player_weapon`](/csgo/api-reference/namespaces/entity#get_player_weapon) function.
</Note>

## get\_weapon\_index

```lua
ent:get_weapon_index(): number
```

> Returns the index of the weapon.

<Schema title="Returns">
  <SchemaField name="weapon_index" type="number">
    The index of the weapon.
  </SchemaField>
</Schema>

## get\_weapon\_icon

```lua
ent:get_weapon_icon(): texture
```

> Returns the icon of the weapon.

<Schema title="Returns">
  <SchemaField name="weapon_icon" type="texture">
    The icon of the weapon.
  </SchemaField>
</Schema>

## get\_weapon\_info

```lua
ent:get_weapon_info(): userdata
```

> Returns a pointer to the `CCSWeaponInfo` struct of the weapon.

<Schema title="Returns">
  <SchemaField name="weapon_info" type="userdata">
    A pointer to the `CCSWeaponInfo` struct of the weapon.
  </SchemaField>
</Schema>

<Expandable title="weapon_info">
  <Schema>
    <SchemaField name="max_player_speed" type="number" />

    <SchemaField name="max_player_speed_alt" type="number" />

    <SchemaField name="attack_move_speed_factor" type="number" />

    <SchemaField name="spread" type="number" />

    <SchemaField name="spread_alt" type="number" />

    <SchemaField name="inaccuracy_crouch" type="number" />

    <SchemaField name="inaccuracy_crouch_alt" type="number" />

    <SchemaField name="inaccuracy_stand" type="number" />

    <SchemaField name="inaccuracy_stand_alt" type="number" />

    <SchemaField name="inaccuracy_jump_initial" type="number" />

    <SchemaField name="inaccuracy_jump_apex" type="number" />

    <SchemaField name="inaccuracy_jump" type="number" />

    <SchemaField name="inaccuracy_jump_alt" type="number" />

    <SchemaField name="inaccuracy_land" type="number" />

    <SchemaField name="inaccuracy_land_alt" type="number" />

    <SchemaField name="inaccuracy_ladder" type="number" />

    <SchemaField name="inaccuracy_ladder_alt" type="number" />

    <SchemaField name="inaccuracy_fire" type="number" />

    <SchemaField name="inaccuracy_fire_alt" type="number" />

    <SchemaField name="inaccuracy_move" type="number" />

    <SchemaField name="inaccuracy_move_alt" type="number" />

    <SchemaField name="inaccuracy_reload" type="number" />

    <SchemaField name="recoil_seed" type="number" />

    <SchemaField name="recoil_angle" type="number" />

    <SchemaField name="recoil_angle_alt" type="number" />

    <SchemaField name="recoil_angle_variance" type="number" />

    <SchemaField name="recoil_angle_variance_alt" type="number" />

    <SchemaField name="recoil_magnitude" type="number" />

    <SchemaField name="recoil_magnitude_alt" type="number" />

    <SchemaField name="recoil_magnitude_variance_alt" type="number" />

    <SchemaField name="spread_seed" type="number" />

    <SchemaField name="recovery_time_crouch" type="number" />

    <SchemaField name="recovery_time_stand" type="number" />

    <SchemaField name="recovery_time_crouch_final" type="number" />

    <SchemaField name="recovery_time_stand_final" type="number" />

    <SchemaField name="recovery_transition_start_bullet" type="number" />

    <SchemaField name="recovery_transition_end_bullet" type="number" />

    <SchemaField name="unzoom_after_shot" type="boolean" />

    <SchemaField name="hide_view_model_zoomed" type="boolean" />

    <SchemaField name="zoom_level" type="number" />

    <SchemaField name="zoom_fov" type="userdata" />

    <SchemaField name="zoom_time" type="userdata" />

    <SchemaField name="weapon_class" type="string" />

    <SchemaField name="has_burst_mode" type="boolean" />

    <SchemaField name="is_revolver" type="boolean" />

    <SchemaField name="recoil_magnitude_variance" type="number" />

    <SchemaField name="weapon_name" type="string" />

    <SchemaField name="weapon_type" type="number" />

    <SchemaField name="weapon_price" type="number" />

    <SchemaField name="console_name" type="string" />

    <SchemaField name="max_clip1" type="number" />

    <SchemaField name="max_clip2" type="number" />

    <SchemaField name="world_model" type="string" />

    <SchemaField name="view_model" type="string" />

    <SchemaField name="dropped_model" type="string" />

    <SchemaField name="hud_name" type="string" />

    <SchemaField name="kill_award" type="number" />

    <SchemaField name="cycle_time" type="number" />

    <SchemaField name="cycle_time_alt" type="number" />

    <SchemaField name="time_to_idle" type="number" />

    <SchemaField name="full_auto" type="boolean" />

    <SchemaField name="damage" type="number" />

    <SchemaField name="headshot_multiplier" type="number" />

    <SchemaField name="armor_ratio" type="number" />

    <SchemaField name="bullets" type="number" />

    <SchemaField name="penetration" type="number" />

    <SchemaField name="range" type="number" />

    <SchemaField name="range_modifier" type="number" />

    <SchemaField name="throw_velocity" type="number" />

    <SchemaField name="has_silencer" type="boolean" />
  </Schema>
</Expandable>

## get\_weapon\_owner

```lua
ent:get_weapon_owner(): entity
```

> Returns a pointer to the weapon owner's entity.

<Schema title="Returns">
  <SchemaField name="owner" type="entity">
    A pointer to the weapon owner's entity.
  </SchemaField>
</Schema>

## get\_weapon\_reload

```lua
ent:get_weapon_reload(): number
```

> Returns the weapon reload percentage (0.0-1.0), -1 if not reloading.

<Schema title="Returns">
  <SchemaField name="reload" type="number">
    The weapon reload percentage (0.0-1.0), -1 if not reloading.
  </SchemaField>
</Schema>

## get\_max\_speed

```lua
ent:get_max_speed(): number
```

> Returns the maximum speed the player can move with the weapon.

<Schema title="Returns">
  <SchemaField name="max_speed" type="number">
    The maximum speed the player can move with the weapon.
  </SchemaField>
</Schema>

## get\_spread

```lua
ent:get_spread(): number
```

> Returns the spread of the weapon in radians.

<Schema title="Returns">
  <SchemaField name="spread" type="number">
    The spread of the weapon in radians.
  </SchemaField>
</Schema>

## get\_inaccuracy

```lua
ent:get_inaccuracy(): number
```

> Returns the inaccuracy of the weapon in radians.

<Schema title="Returns">
  <SchemaField name="inaccuracy" type="number">
    The inaccuracy of the weapon in radians.
  </SchemaField>
</Schema>
