player
Local player related functions
player.jump
Makes the local player jump
player.click_mouse
Left clicks
player.right_click_mouse
Right clicks
player.message
Argument
Type
Description
message
String
Message
Sends a message in chat, can also run client commands such as ".killaura" to toggle modules or set any option.
player.strafe
Returns the forward and strafing speed the player is moving at
player.position
Returns the player's x, y and z positions.
player.camera_position
Returns the camera's x, y and z positions.
player.prev_position
Returns the player's previous x, y and z positions.
player.motion
Returns the player's x, y and z motion amount.
player.set_motion
Argument
Type
Description
motion_x
Number
New motion x value
motion_y
Number
New motion y value
motion_z
Number
New motion z value
Sets the local player motion
player.set_position
Argument
Type
Description
pos_x
Number
New player position x
pos_y
Number
New player position y
pos_z
Number
New player position z
Sets the local player position
player.set_sprinting
Argument
Type
Description
sprinting
boolean
Player sprinting state
Sets local player's sprinting state
player.distance_to_entity
Argument
Type
Description
entity_id
number
ID of the entity
Returns the distance in blocks between you and the entity.
player.distance_to
Argument
Type
Description
pos_x
Number
pos x
pos_y
Number
pos y
pos_z
Number
pos z
Returns the distance in blocks between you and the coordinates.
player.send_packet
Argument
Type
Description
packet_id
Number
Packet ID
Sends a packet to the server.
Packet IDs can be found here: https://wiki.vg/index.php?title=Protocol&oldid=7368#Serverbound_2
Packets supported: 0x0A, 0x07, 0x08, 0x0B, 0x03, 0x04, 0x05, 0x06, 0x07, 0x0F
player.angles
Returns yaw and pitch.
player.prev_angles
Returns prev yaw and prev pitch.
player.set_angles
Argument
Type
Description
yaw
Number
new yaw
pitch
Number
new pitch
Sets the player in-game look angles
player.using_item
Returns if the player is using an item or not.
player.swing_item
Swings the item
player.use_item
Uses the item you're holding
player.id
Returns your current player entity ID
player.health
Returns your current player health, divide by two for getting heart amount
player.fall_distance
Returns the amount of blocks you're falling
player.max_health
Returns the max amount of health your player can have, divide by two for getting hearts
player.held_item
Returns the name of the item you're holding
player.name
Returns the player name
player.base_speed
Returns the base speed amount, used for speed calculations.
player.held_item_slot
Returns the slot number of the item you're holding. Counting from 1 to 9
player.set_held_item_slot
Argument
Type
Description
slot
Number
New hotbar slot
Sets your hotbar slot to the desired one
player.hurt_time
Returns how much ticks of hurt time left
player.food_stats
Returns the hunger you have, divide by two to get muslito amount
player.absorption
Returns amount of yellow health that you have, divide by two to get heart amount
player.eye_height
Returns
player.facing
This function will return a direction on a number.
1: Down 2: Up 3: North 4: South 5: West 6: East
player.over_mouse
This function will return different values depending on the first returned number.
If the first number is 1, this means your player is not aiming at anything.
If the number is 3, this means its aiming at an entity, second number will return the index of that entity
If the number is 2, this means its aiming at a block, will return side_hit, block_x, block_x, block_x, hit_x, hit_y, hit_z
player.convert_speed
Argument
Type
Description
table
Table
The table that on_player_move
gives you
speed
Number
Speed amount, player.base_speed() is used here
This function will return a table that sets the on_player_move
table values to ones that will make the player strafe according to the speed assigned
player.kill_aura_target
Returns the player id of KillAura's target
player.on_ground
Returns if the player is on the ground
player.is_in_water
Returns if the player is in water
player.is_in_lava
Returns if the player is in lava
player.burning
Returns if the player is currently burning
player.is_sneaking
Returns if the player is currently sneaking
player.set_sneaking
Argument
Type
Description
sneak
boolean
Sneak
player.is_in_cobweb
Returns if the player is currently in a cobweb
player.angles_for_cords
Argument
Type
Description
x
Number
x position
y
Number
y position
z
Number
z position
This function returns a yaw and pitch to look at the desired coordinates.
player.dead
Returns if the player is currently dead
player.sprinting
Returns if the player is currently sprinting
player.riding
Returns if the player is currently riding an entity
player.on_ladder
Returns if the player is currently on a ladder
player.collided_vertically
Returns if the player is currently colliding with any block vertically
player.collided_horizontally
Returns if the player is currently colliding with any block horizontally
player.is_potion_active
Argument
Type
Description
potion_id
Number
ID of the potion to check
Returns if the desired potion is currently active
player.ticks_existed
Returns the amount of ticks the player has existed in the world
player.ray_cast
Argument
Type
Description
yaw
Number
Yaw to simulate
pitch
Number
Pitch to simulate
range
Number
Amount of blocks
This function will return different values depending on the first returned number.
If the first number is 1, this means your player is not aiming at anything.
If the number is 3, this means its aiming at an entity, second number will return the index of that entity
If the number is 2, this means its aiming at a block, will return side_hit, block_x, block_x, block_x, hit_x, hit_y, hit_z
player.place_block
Argument
Type
Description
item_slot
Number
Number of the slot of the block you're trying to place (must be held in hand)
block_x
Number
X coordinate of the block
block_y
Number
Y coordinate of the block
block_z
Number
Z coordinate of the block
side
Number
Index of the facing value
hit_x
, hit_y
and hit_z
are values used to check where the actual placement took place, this are the values sent to the server in the 0x08 packet
This means that the hit_* values you'll put in the function will be applied to the example shown before
Places a block
player.is_on_edge
Returns if the player is at the edge of a block
player.get_speed
Returns the players speed
player.set_speed
Argument
Type
Description
speed
Number
Amount of speed
Sets the player's speed
Last updated
Was this helpful?