Skip to content

client

Game client utilities

Properties

NameDescription
game_speedtype: number Controls the game timer speed

Functions

player_name(): string

Returns the player name

  • returns (string)

world_to_screen(x : number, y : number, z : number): types.vector2

Projects a world coordinate to screen coordinates

  • x (number) The world x coordinate
  • y (number) The world y coordinate
  • z (number) The world z coordinate
  • returns (types.vector2) The screen coordinates, or nil if the point is behind the camera

in_view_frustum(entity : userdata): boolean

Returns whether the entity is in the view frustum or not

  • entity (userdata) Minecraft's Entity object
  • returns (boolean) Whether the entity is in the view frustum or not

fps(): number

Returns the client FPS

  • returns (number)

time_millis(): number

Returns the current time in milliseconds

  • returns (number)

window_width(): number

Returns the window width

  • returns (number)

window_height(): number

Returns the window height

  • returns (number)

scaled_window_width(): number

Returns the scaled window width

  • returns (number)

scaled_window_height(): number

Returns the scaled window height

  • returns (number)

gui_scale(): number

Returns the gui scale

  • returns (number)

connected_server(): string

Returns the currently connected server's ip address

  • returns (string)

play_sound(id : string, pitch : number, volume : number)

Plays a sound using Minecraft's sound identifiers

  • id (string) The sound id
  • pitch (number) The sound pitch
  • volume (number) The sound volume

is_key_down(key : enums.key_code): boolean

Returns whether a keyboard key is down or not

is_mouse_button_down(button : number): boolean

Returns whether a mouse button is down or not

  • button (number) The mouse button to check
  • returns (bool)

execute_slash_command(cmd : string)

Executes a chat slash command

  • cmd (string) The full command string without leading slash