moonscript
Search…
Player

player.setMovementSpeed

1
player.setMovementSpeed(event, speed)
Copied!
Argument
Object
Description
event
MotionEvent
Parameter from the motion event hook
speed
Number
Player speed
Sets the movement speed of the player, automatically strafes.

player.jump

1
player.jump()
Copied!
Makes the local player jump.

player.setYaw

1
player.setYaw(yaw)
Copied!
Argument
Object
Description
yaw
Number
New yaw rotation
Sets the yaw of the local player.

player.setPitch

1
player.setPitch(pitch)
Copied!
Argument
Object
Description
pitch
Number
New pitch rotation
Sets the pitch of the local player.

player.usingItem

1
player.usingItem() - Boolean
Copied!
Returns if the local player is currently using an item.

player.swingItem

1
player.swingItem()
Copied!
Makes the local player swing the current item.

player.health

1
player.health() - Number
Copied!
Returns the current health of the local player.

player.maxHealth

1
player.maxHealth() - Number
Copied!
Returns the max health the local player can health.

player.armor

1
player.armor() - Number
Copied!
Returns the current total armor value of the local player.

player.setPosition

1
player.setPosition(x, y, z)
Copied!
Argument
Object
Description
x
Number
New x
y
Number
New y
z
Number
New z
Sets the current position of the local player.

player.message

1
player.message(message)
Copied!
Argument
Object
Description
message
String
Message sent
Sends a chat message. Put a - at the start of the message to send a message in the IRC. You can also execute commands like you would in the client with this function.

player.fallDistance

1
player.fallDistance() - Number
Copied!
Returns the current distance the local player has fallen.

player.name

1
player.name() - String
Copied!
Returns the account name you are currently logged in to.

player.renderName

1
player.renderName() - String
Copied!
Returns the render name of the local player. On Hypixel this could look like this: §b[MVP] AccountName.

player.heldItemSlot

1
player.heldItemSlot() - Number
Copied!
Returns the slot the local player is currently holding.

player.setHeldItemSlot

1
player.setHeldItemSlot(slot)
Copied!
Set the current held item of the local player.

player.hurtTime

1
player.hurtTime() - Number
Copied!
Returns the current hurt time of the local player.

player.foodLevel

1
player.foodLevel() - Number
Copied!
Returns the food level of the local player.

player.absorption

1
player.absorption() - Number
Copied!
Returns the local players absorption level.

player.burning

1
player.burning() - Boolean
Copied!
Returns if the local player is burning.

player.leftClick

1
player.leftClick()
Copied!
Clicks the left mouse button.

player.rightClick

1
player.rightClick()
Copied!
Clicks the right mouse button.

player.inWater

1
player.inWater() - Boolean
Copied!
Returns if the local player is in the water.

player.inLava

1
player.inLava() - Boolean
Copied!
Returns if the local player is in the lava.

player.moving

1
player.moving() - Boolean
Copied!
Returns if the local player is moving.

player.onGround

1
player.onGround() - Boolean
Copied!
Returns if the local player is on ground.

player.sneaking

1
player.sneaking() - Boolean
Copied!
Returns if the player is sneaking.

player.setSneaking

1
player.setSneaking(sneak)
Copied!
Argument
Object
Description
sneak
Boolean
New sneak state
Sets the current sneaking state of the local player.

player.dead

1
player.dead() - Boolean
Copied!
Returns if the local player is dead.

player.sprinting

1
player.sprinting() - Boolean
Copied!
Returns if the local player is sneaking.

player.riding

1
player.riding() - Boolean
Copied!
Returns if the local player is riding another entity.

player.onLadder

1
player.onLadder() - Boolean
Copied!
Returns if the local player is currently on a ladder.

player.collidedVertically

1
player.collidedVertically() - Boolean
Copied!
Returns if the local player collided vertically.

player.collidedHorizontally

1
player.collidedHorizontally() - Boolean
Copied!
Returns if the local player collided horizontally.

player.ticksExisted

1
player.ticksExisted() - Number
Copied!
Returns how long the player is already existing (1 tick = 50 milliseconds).

player.addMotion

1
player.addMotion(x, y, z)
Copied!
Argument
Object
Description
x
Number
Added x motion
y
Number
Added y motion
z
Number
Added z motion
Adds values to the local players motion.

player.setMotion

1
player.setMotion(x, y, z)
Copied!
Argument
Object
Description
x
Number
New x motion
y
Number
New y motion
z
Number
New z motion
Sets the local players motion.

player.setMotionX

1
player.setMotionX(x)
Copied!
Argument
Object
Description
x
Number
New x motion
Sets the local players motion z.

player.setMotionY

1
player.setMotionY(y)
Copied!
Argument
Object
Description
y
Number
New y motion
Sets the local players motion y.

player.setMotionZ

1
player.setMotionZ(z)
Copied!
Argument
Object
Description
z
Number
New z motion
Sets the local players motion z.

player.sendPacket

1
player.sendPacket(packetId, args...)
Copied!
Argument
Object
Description
packetId
Number
ID of the packet that will be sent to the server.
args
Anything
Contents of the packet
Sends a packet to the connected server, you can find a list of packets in the packets section.

player.getX

1
player.getX() - Number
Copied!
Returns the x position of the local player.

player.getY

1
player.getY() - Number
Copied!
Returns the y position of the local player.

player.getZ

1
player.getZ() - Number
Copied!
Returns the z position of the local player.

player.setTimer

1
player.setTimer(speed)
Copied!
Argument
Object
Description
speed
Number
The new Game Speed
Increases or decreases your Game Speed.

player.entityBoundingBox

1
player.entityBoundingBox() - AxisAlignedBB
Copied!
Returns the entity bounding box of the local player.

player.collisionBoundingBox

1
player.collisionBoundingBox() - AxisAlignedBB
Copied!
Returns the collision bounding box of the local player.

player.inCobweb

1
player.inCobweb() - Boolean
Copied!
Returns if the player is currently in a cobweb.

player.yaw

1
player.yaw() - Number
Copied!
Returns the players rotation yaw (x axis).

player.pitch

1
player.pitch() - Number
Copied!
Returns the players rotation pitch (y axis).

player.anglesTo

1
player.anglesTo(x, y, z) - Number Array
Copied!
Argument
Object
Description
x
Number
Pos x
y
Number
Pos y
z
Number
Pos z
Gets angles to a specific position on the world.

player.unlocalizedHeldItemName

1
player.unlocalizedHeldItemName() - String
Copied!
Returns the unlocalized name of the currently held item, returns AIR if no item is held.

player.displayedHeldItemName

1
player.displayedHeldItemName() - String
Copied!
Returns the display name of the currently held item, returns AIR if no item is held.

player.baseMoveSpeed

1
player.baseMoveSpeed() - Number
Copied!
Returns the base movement speed of the local player.

player.verticallyCollided

1
player.verticallyCollided() - Boolean
Copied!
Returns if the player has vertically collided with a bounding box.

player.horizontallyCollided

1
player.horizontallyCollided() - Boolean
Copied!
Returns if the player has collided horizontally with a bounding box.

player.itemName

1
player.itemName(slot) - String
Copied!
Argument
Object
Description
slot
Number
Slot of the item
Returns the name of the item in the given slot.

player.displayName

1
player.displayName(slot) - String
Copied!
Argument
Object
Description
slot
Number
Slot of the item
Returns the display name of the item in the given slot.

player.motionX

1
player.motionX() - Number
Copied!
Returns the current motion x.

player.motionY

1
player.motionY() - Number
Copied!
Returns the current motion y.

player.motionZ

1
player.motionZ() - Number
Copied!
Returns the current motion z.

player.windowId

1
player.windowId() - Number
Copied!
Returns the current window id. If no window open returns -1.

player.setMove

1
player.setMove(pressed, moveType)
Copied!
Argument
Object
Description
pressed
Boolean
Defines if the key should be pressed or unpressed
moveType
MoveType
The direction the player should move at
Moves a player in a direction like he would when pressing a key.

player.airBorne

1
player.airBorne() - Boolean
Copied!
Returns if the player is airborne.

player.eating

1
player.eating() - Boolean
Copied!
Returns if the player is eating.

player.setFallDistance

1
player.setFallDistance(newFallDistance)
Copied!
Argument
Object
Description
newFallDistance
Number
The new fall distance
Sets the players fall distance.
Last modified 11mo ago