EntityPlayerSP

The player entity

EntityPlayerSP objects inherit methods from LivingEntity

Getting the player entity.

You can get the player entity from the mc namespace.

'tick': function() {
    player = mc.getPlayer()
    
    player.jump()
    
    player.swingItem()
}

setX(double x): void

Sets the x position of the player.

setY(double x): void

Sets the y position of the player.

setZ(double x): void

Sets the z position of the player.

setPosition(Vec3 pos): void

Set the x, y, and z position of the player using a Vec3.

setPitch(float pitch): void

Set the pitch of the player.

setYaw(float yaw): void

Set the yaw of the player.

setLastPitch(float pitch): void

Set the prevPitch of the player.

setLastYaw(float yaw): void

Set the prevYaw of the player.

setMotionX(double motionX): void

Sets the motionX of the player.

setMotionY(double motionY): void

Sets the motionY of the player.

setMotionZ(double motionZ): void

Sets the motionZ of the player.

setMotion(Vec3 motion): void

Set the motionX, motionY, and motionZ of the player using a Vec3.

getForward(): float

Returns the moveForward input of the player.

getStrafe(): float

Returns the moveStrafe input of the player.

isUsingItem(): boolean

Returns True if the player is using an item.

swingItem(): void

Swings the hand and sends a C0APacketAnimation.

sendChatMessage(String message): void

Send a chat message to the server, can be used for commands.

jump(): void

Makes the player jump up.

isSneaking(): boolean

Returns true if the player is sneaking.

setSneaking(boolean sneak): void

Set the sneaking state of the player.

isSprinting(): boolean

Returns true if the player is currently sprinting.

setSprinting(boolean sprint): void

Make the player start or stop sprinting.

Last updated