> For the complete documentation index, see [llms.txt](https://docs.quickclient.cc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.quickclient.cc/en/game/player.md).

# Your player

Health, position, state and held items of your own player.

`player()` returns data about your own player: health, food, position, view direction and items in hand. If you are not in a world, numbers are zero and items are empty.

Scripts never receive the game's vanilla objects. Each call returns ready data for the current moment, so you can't accidentally break anything through it.

```java
if (player().health() < 8f && inventory().count("golden_apple") > 0) {
    notifications().warning("Low health, eat an apple", 1500L);
}
```

## State

| Method                                                            | Type        | Description                                                              |
| ----------------------------------------------------------------- | ----------- | ------------------------------------------------------------------------ |
| `present()`                                                       | `boolean`   | the player is in a world                                                 |
| `name()`                                                          | `String`    | nickname                                                                 |
| `entity()`                                                        | `Entity`    | your player as an entity, used for `Render3D` and comparisons            |
| `inventory()`                                                     | `Inventory` | the same as the script's `inventory()`                                   |
| `health()`                                                        | `float`     | health                                                                   |
| `maxHealth()`                                                     | `float`     | max health                                                               |
| `absorption()`                                                    | `float`     | golden hearts                                                            |
| `food()`                                                          | `int`       | hunger, 0 to 20                                                          |
| `saturation()`                                                    | `float`     | saturation                                                               |
| `experience()`                                                    | `float`     | progress to the next level, 0..1                                         |
| `level()`                                                         | `int`       | experience level                                                         |
| `air()`                                                           | `int`       | air supply in ticks                                                      |
| `fallDistance()`                                                  | `float`     | how many blocks the player has been falling                              |
| `onGround()`                                                      | `boolean`   | the player is standing on the ground                                     |
| `sneaking()`, `sprinting()`, `inWater()`, `gliding()`, `flying()` | `boolean`   | how the player is moving                                                 |
| `creative()`, `spectator()`                                       | `boolean`   | game mode                                                                |
| `using()`                                                         | `boolean`   | the player is using something right now: eating, drawing a bow and so on |
| `moving()`                                                        | `boolean`   | the player is moving horizontally                                        |
| `leftHanded()`                                                    | `boolean`   | the main hand is set to left in the settings                             |

## Position and view

| Method              | Type     | Description                                                  |
| ------------------- | -------- | ------------------------------------------------------------ |
| `x()`, `y()`, `z()` | `double` | player position; `y` is at foot level                        |
| `position()`        | `Point`  | the same as one point                                        |
| `position(delta)`   | `Point`  | smooth position for rendering, `delta` comes from `Render3D` |
| `motion()`          | `Point`  | velocity in blocks per tick                                  |
| `yaw()`, `pitch()`  | `float`  | view direction in degrees                                    |

If you need angles that account for how Quick replaces them, or the angles that were actually sent to the server, see [Rotations](/en/actions/rotations.md).

## Hands and armor

| Method                | Type   | Description                                   |
| --------------------- | ------ | --------------------------------------------- |
| `held()`, `offhand()` | `Item` | item in the main hand and in the off hand     |
| `armor(part)`         | `Item` | armor: `Entity.HEAD`, `CHEST`, `LEGS`, `FEET` |

What you can read from an `Item` is described in [Inventory and items](/en/game/inventory.md). Potion effects are in `client().effects()`, which is covered in [Server, scoreboard, tab list](/en/game/server.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.quickclient.cc/en/game/player.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
