> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cheart.getvapu.today/llms.txt
> Use this file to discover all available pages before exploring further.

# 注解

> 脚本可用的注解

## @Module

```java theme={null}
@Module(name="Foo", category="COMBAT", description="...", key=-1, defaultEnabled=false)
void meta(valueManager) { /* 用 valueManager 注册属性 */ }
```

| 字段               | 类型      | 默认         | 说明                                                            |
| ---------------- | ------- | ---------- | ------------------------------------------------------------- |
| `name`           | String  | 脚本名        | 模块显示名                                                         |
| `description`    | String  | `""`       | 模块描述                                                          |
| `category`       | String  | `"PLAYER"` | `COMBAT` / `EXPLOIT` / `MOVE` / `PLAYER` / `VISUAL` / `WORLD` |
| `key`            | int     | `-1`       | 默认键位（GLFW keycode）                                            |
| `defaultEnabled` | boolean | `false`    | 加载后立即启用                                                       |

被 `@Module` 标记的方法会在加载时调用一次，参数是 [`ValueManager`](/api/value-manager)。

## @Command

```java theme={null}
@Command(name="hi", aliases="hey,hello", description="...")
void exec(args) { /* args[0] 是命令名, args[1+] 是参数 */ }
```

## @EventTarget

```java theme={null}
@EventTarget(events="tick", priority="MEDIUM")
void onTick(event) { /* 收到 event 对象 */ }
```

* `events`：事件名，用 `+` 连接多个。见 [事件参考](/api/events-reference)
* `priority`：`VERY_LOW` / `LOW` / `MEDIUM` / `HIGH` / `VERY_HIGH`，默认 `MEDIUM`

## 生命周期

```java theme={null}
@OnLoad     void onLoad()    {}   // 脚本加载完
@OnUnload   void onUnload()  {}   // 脚本卸载前
@OnEnable   void onEnable()  {}   // 模块启用（仅 @Module 脚本）
@OnDisable  void onDisable() {}   // 模块禁用
```
