EntityPlayerSP
The player entity
EntityPlayerSP
objects inherit methods from LivingEntity
Getting the player entity.
You can get the player entity from the mc
namespace.
setX(double x): void
setX(double x): void
Sets the x
position of the player.
setY(double x): void
setY(double x): void
Sets the y
position of the player.
setZ(double x): void
setZ(double x): void
Sets the z
position of the player.
Set the x
, y
, and z
position of the player using a Vec3
.
setPitch(float pitch): void
setPitch(float pitch): void
Set the pitch
of the player.
setYaw(float yaw): void
setYaw(float yaw): void
Set the yaw
of the player.
setLastPitch(float pitch): void
setLastPitch(float pitch): void
Set the prevPitch
of the player.
setLastYaw(float yaw): void
setLastYaw(float yaw): void
Set the prevYaw
of the player.
setMotionX(double motionX): void
setMotionX(double motionX): void
Sets the motionX
of the player.
setMotionY(double motionY): void
setMotionY(double motionY): void
Sets the motionY
of the player.
setMotionZ(double motionZ): void
setMotionZ(double motionZ): void
Sets the motionZ
of the player.
Set the motionX
, motionY
, and motionZ
of the player using a Vec3
.
getForward(): float
getForward(): float
Returns the moveForward
input of the player.
getStrafe(): float
getStrafe(): float
Returns the moveStrafe
input of the player.
isUsingItem(): boolean
isUsingItem(): boolean
Returns True if the player is using an item.
swingItem(): void
swingItem(): void
Swings the hand and sends a C0APacketAnimation
.
sendChatMessage(String message): void
sendChatMessage(String message): void
Send a chat message to the server, can be used for commands.
jump(): void
jump(): void
Makes the player jump up.
isSneaking(): boolean
isSneaking(): boolean
Returns true if the player is sneaking.
setSneaking(boolean sneak): void
setSneaking(boolean sneak): void
Set the sneaking state of the player.
isSprinting(): boolean
isSprinting(): boolean
Returns true if the player is currently sprinting.
setSprinting(boolean sprint): void
setSprinting(boolean sprint): void
Make the player start or stop sprinting.
Last updated