Skip to content

PlayerState

PlayerState represents a player's position, rotation, and movement state.

propertytypedescription
xdoublex coordinate
ydoubley coordinate
zdoublez coordinate
yawfloatyaw rotation
pitchfloatpitch rotation
onGroundbooleanwhether the player is on ground
isSprintingbooleanwhether the player is sprinting
isSneakingbooleanwhether the player is sneaking

constructor

Creates a new player state with individual parameters.

java
PlayerState state = new PlayerState(double x, double y, double z, float yaw, float pitch, boolean onGround, boolean sprinting, boolean sneaking);

constructor

Creates a new player state from an array of data.

java
PlayerState state = new PlayerState(Object[] data);

asArray

Returns the player state data as an object array.

java
Object[] data = state.asArray();