> 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/game/player.md).

# Свой игрок

Здоровье, позиция, состояние и предметы в руках своего игрока.

`player()` возвращает данные о своём игроке: здоровье, еду, позицию, направление взгляда и предметы в руках. Если игрок не в мире, числа будут нулевыми, а предметы пустыми.

Ванильные объекты игры скрипту не передаются. Каждый вызов возвращает готовые данные на текущий момент, поэтому через них ничего нельзя случайно сломать.

```java
if (player().health() < 8f && inventory().count("golden_apple") > 0) {
    notifications().warning("Мало здоровья, съешьте яблоко", 1500L);
}
```

## Состояние

| Метод                                                             | Тип         | Описание                                                   |
| ----------------------------------------------------------------- | ----------- | ---------------------------------------------------------- |
| `present()`                                                       | `boolean`   | игрок находится в мире                                     |
| `name()`                                                          | `String`    | ник                                                        |
| `entity()`                                                        | `Entity`    | свой игрок как сущность, нужен для `Render3D` и сравнений  |
| `inventory()`                                                     | `Inventory` | то же, что `inventory()` у скрипта                         |
| `health()`                                                        | `float`     | здоровье                                                   |
| `maxHealth()`                                                     | `float`     | максимум здоровья                                          |
| `absorption()`                                                    | `float`     | золотые сердца                                             |
| `food()`                                                          | `int`       | голод, от 0 до 20                                          |
| `saturation()`                                                    | `float`     | насыщение                                                  |
| `experience()`                                                    | `float`     | прогресс до следующего уровня, 0..1                        |
| `level()`                                                         | `int`       | уровень опыта                                              |
| `air()`                                                           | `int`       | запас воздуха в тиках                                      |
| `fallDistance()`                                                  | `float`     | сколько блоков игрок уже падает                            |
| `onGround()`                                                      | `boolean`   | игрок стоит на земле                                       |
| `sneaking()`, `sprinting()`, `inWater()`, `gliding()`, `flying()` | `boolean`   | как игрок двигается                                        |
| `creative()`, `spectator()`                                       | `boolean`   | режим игры                                                 |
| `using()`                                                         | `boolean`   | игрок сейчас что-то использует: ест, натягивает лук и т.п. |
| `moving()`                                                        | `boolean`   | игрок идёт по горизонтали                                  |
| `leftHanded()`                                                    | `boolean`   | в настройках основная рука левая                           |

## Позиция и взгляд

| Метод               | Тип      | Описание                                                     |
| ------------------- | -------- | ------------------------------------------------------------ |
| `x()`, `y()`, `z()` | `double` | позиция игрока; `y` на уровне ног                            |
| `position()`        | `Point`  | то же одной точкой                                           |
| `position(delta)`   | `Point`  | плавная позиция для отрисовки, `delta` берётся из `Render3D` |
| `motion()`          | `Point`  | скорость в блоках за тик                                     |
| `yaw()`, `pitch()`  | `float`  | направление взгляда в градусах                               |

Если нужны углы с учётом того, как их подменяет Quick, или углы, которые на самом деле ушли на сервер, смотрите страницу [Повороты](/actions/rotations.md).

## Руки и броня

| Метод                 | Тип    | Описание                                      |
| --------------------- | ------ | --------------------------------------------- |
| `held()`, `offhand()` | `Item` | предмет в основной и в левой руке             |
| `armor(part)`         | `Item` | броня: `Entity.HEAD`, `CHEST`, `LEGS`, `FEET` |

Что можно узнать у `Item`, описано на странице [Инвентарь и предметы](/game/inventory.md). Эффекты зелий находятся в `client().effects()`, о них рассказано на странице [Сервер, скорборд, таб](/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/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.
