> For the complete documentation index, see [llms.txt](https://daikirai.gitbook.io/scripting/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://daikirai.gitbook.io/scripting/documentation/playerstate.md).

# playerstate

## 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();
```
