PlayerState
PlayerState represents a player's position, rotation, and movement state.
| property | type | description |
|---|---|---|
| x | double | x coordinate |
| y | double | y coordinate |
| z | double | z coordinate |
| yaw | float | yaw rotation |
| pitch | float | pitch rotation |
| onGround | boolean | whether the player is on ground |
| isSprinting | boolean | whether the player is sprinting |
| isSneaking | boolean | whether 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();