player
Local player related functions
player.jump
player.jump()Makes the local player jump
player.click_mouse
player.click_mouse()Left clicks
player.right_click_mouse
player.right_click_mouse()Right clicks
player.message
player.message(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
player.strafe(): number, numberReturns the forward and strafing speed the player is moving at
player.position
player.position(): number, number, numberReturns the player's x, y and z positions.
player.camera_position
player.camera_position(): number, number, numberReturns the camera's x, y and z positions.
player.prev_position
player.prev_position(): number, number, numberReturns the player's previous x, y and z positions.
player.motion
player.motion(): number, number, numberReturns the player's x, y and z motion amount.
player.set_motion
player.set_motion(motion_x, motion_y, motion_z)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
player.set_position(pos_x, pos_y, pos_z)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
player.set_sprinting(sprinting)Argument
Type
Description
sprinting
boolean
Player sprinting state
Sets local player's sprinting state
player.distance_to_entity
player.distance_to_entity(entity_id): numberArgument
Type
Description
entity_id
number
ID of the entity
Returns the distance in blocks between you and the entity.
player.distance_to
player.distance_to(pos_x, pos_y, pos_z): numberArgument
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
player.send_packet(packet_id, [...])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
player.angles(): number, numberReturns yaw and pitch.
player.prev_angles
player.prev_angles(): number, numberReturns prev yaw and prev pitch.
player.set_angles
player.set_angles(yaw, pitch)Argument
Type
Description
yaw
Number
new yaw
pitch
Number
new pitch
Sets the player in-game look angles
player.using_item
player.using_item(): booleanReturns if the player is using an item or not.
player.swing_item
player.swing_item()Swings the item
player.use_item
player.use_item()Uses the item you're holding
player.id
player.id(): numberReturns your current player entity ID
player.health
player.health(): numberReturns your current player health, divide by two for getting heart amount
player.fall_distance
player.fall_distance(): numberReturns the amount of blocks you're falling
player.max_health
player.max_health(): numberReturns the max amount of health your player can have, divide by two for getting hearts
player.held_item
player.held_item(): stringReturns the name of the item you're holding
player.name
player.name(): stringReturns the player name
player.base_speed
player.base_speed(): numberReturns the base speed amount, used for speed calculations.
player.held_item_slot
player.held_item_slot(): numberReturns the slot number of the item you're holding. Counting from 1 to 9
player.set_held_item_slot
player.set_held_item_slot(slot)Argument
Type
Description
slot
Number
New hotbar slot
Sets your hotbar slot to the desired one
player.hurt_time
player.hurt_time(): numberReturns how much ticks of hurt time left
player.food_stats
player.food_stats(): numberReturns the hunger you have, divide by two to get muslito amount
player.absorption
player.absorption(): numberReturns amount of yellow health that you have, divide by two to get heart amount
player.eye_height
player.eye_height(): numberReturns
player.facing
player.facing(): numberThis function will return a direction on a number.
1: Down 2: Up 3: North 4: South 5: West 6: East
player.over_mouse
player.over_mouse(): number, [...]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
player.convert_speed(on_player_move_table, speed): [fixed_table]Argument
Type
Description
table
Table
The table that on_player_movegives 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
player.kill_aura_target(): numberReturns the player id of KillAura's target
player.on_ground
player.on_ground(): booleanReturns if the player is on the ground
player.is_in_water
player.is_in_water(): booleanReturns if the player is in water
player.is_in_lava
player.is_in_lava(): booleanReturns if the player is in lava
player.burning
player.burning(): booleanReturns if the player is currently burning
player.is_sneaking
player.is_sneaking(): booleanReturns if the player is currently sneaking
player.set_sneaking
player.set_sneaking(sneak)Argument
Type
Description
sneak
boolean
Sneak
player.is_in_cobweb
player.is_in_cobweb(): booleanReturns if the player is currently in a cobweb
player.angles_for_cords
player.angles_for_cords(x, y, z): number, numberArgument
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
player.dead(): booleanReturns if the player is currently dead
player.sprinting
player.sprinting(): booleanReturns if the player is currently sprinting
player.riding
player.riding(): booleanReturns if the player is currently riding an entity
player.on_ladder
player.on_ladder(): booleanReturns if the player is currently on a ladder
player.collided_vertically
player.collided_vertically(): booleanReturns if the player is currently colliding with any block vertically
player.collided_horizontally
player.collided_horizontally(): booleanReturns if the player is currently colliding with any block horizontally
player.is_potion_active
player.is_potion_active(potion_id): booleanArgument
Type
Description
potion_id
Number
ID of the potion to check
Returns if the desired potion is currently active
player.ticks_existed
player.ticks_existed(): numberReturns the amount of ticks the player has existed in the world
player.ray_cast
player.ray_cast(yaw, pitch, range): number, [...]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
player.place_block(item_slot, block_x, block_y, block_z, side, hit_x, hit_y, hit_z): booleanArgument
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_yand hit_zare values used to check where the actual placement took place, this are the values sent to the server in the 0x08 packet
local facing_x = hit_x - block_x
local facing_y = hit_y - block_y
local facing_y = hit_z - block_zThis 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
player.is_on_edge(): booleanReturns if the player is at the edge of a block
player.get_speed
player.get_speed(): numberReturns the players speed
player.set_speed
player.set_speed(speed): numberArgument
Type
Description
speed
Number
Amount of speed
Sets the player's speed
Last updated
Was this helpful?