> 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/extras/modules.md).

# Модули клиента

Список модулей Quick с их состоянием и событие переключения модуля.

`modules()` возвращает список модулей Quick. Это нужно, например, чтобы нарисовать свой список включённых модулей или узнать, когда включили ауру. Метод отдаёт новый массив `ModuleInfo` с данными на момент вызова. Доступ только на чтение: сами модули скрипту не передаются, иначе через них можно было бы включать чужие функции и менять внутреннее состояние Quick.

```java
@Override
public void onRender2D(Render2D render) {
    float y = 10f;
    for (ModuleInfo module : modules()) {
        if (module.animation() < 0.01f) continue;
        int alpha = (int) (module.animation() * 255f) << 24;
        render.drawClientText(module.name(), 5f, y, 7f, alpha | 0xFFFFFF);
        y += 9f;
    }
}
```

## Как это работает

* Модули с почти нулевой анимацией пропускаются, их уже не видно.
* Прозрачность берётся из `animation()`, поэтому строки плавно появляются и исчезают.

## ModuleInfo

| Метод         | Тип       | Описание                                                                                 |
| ------------- | --------- | ---------------------------------------------------------------------------------------- |
| `name()`      | `String`  | имя модуля, как в меню                                                                   |
| `bind()`      | `String`  | клавиша текстом: `"R"`, `"LShift"`, `"Mouse4"`                                           |
| `bound()`     | `boolean` | есть ли бинд                                                                             |
| `category()`  | `String`  | категория: `"Combat"`, `"Render"` и так далее                                            |
| `enabled()`   | `boolean` | включён ли модуль сейчас                                                                 |
| `animation()` | `float`   | анимация включения 0..1; пока значение больше нуля, модуль имеет смысл рисовать в списке |

Массив собирается заново при каждом вызове и отсортирован так же, как в меню. Изменения массива на модули не влияют. При отрисовке лучше получать его один раз за кадр.

Скрипты тоже есть в этом списке: для Quick это модули категории Scripts.

## Реакция на переключение

Когда любой модуль включают или выключают, приходит событие `toggleModule`. В нагрузке лежит `Object[]` с именем модуля и его новым состоянием.

```java
on("toggleModule", event -> {
    Object[] payload = (Object[]) event.payload();
    if ("KillAura".equals(payload[0]) && (Boolean) payload[1]) chat("аура включилась");
});
```

Включить чужой модуль из скрипта нельзя. Сам скрипт включается как обычно: переключателем, биндом или командой `.script toggle`.


---

# 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/extras/modules.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.
