> ## 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.

# 事件参考

> 所有可订阅的事件 + 字段

在 `@EventTarget(events="...")` 里写这些名字，多个用 `+` 连接。

## Tick / 更新

| 事件              | 字段 / 备注                                                                             |
| --------------- | ----------------------------------------------------------------------------------- |
| `tick`          | —                                                                                   |
| `living_update` | —                                                                                   |
| `player_update` | 可 `event.cancel()` 阻止继续；**`me.setRotation(moveFix=true)` 和 `me.placeBlock` 必须在这里调** |
| `motion_update` | `pre`/`post`/`x`/`y`/`z`/`yaw`/`pitch`/`on_ground`；可写回                              |

## 移动

| 事件                | 字段                                      |
| ----------------- | --------------------------------------- |
| `move`            | `x`/`z`/`jump`/`sneak`，可写回              |
| `jump`            | `yaw`，可写回                               |
| `strafe`          | `forward`/`strafe`/`yaw`/`friction`，可写回 |
| `look`            | `yaw`/`pitch`，可写回                       |
| `slowdown`        | 可 `cancel()`                            |
| `attack_slowdown` | `multiple`，可写回                          |

## 网络

| 事件               | 字段                                                              |
| ---------------- | --------------------------------------------------------------- |
| `send_packet`    | `sending=true`、`type`、`cancellable=true`；`event.raw()` 是 Packet |
| `receive_packet` | `sending=false`、同上                                              |

## 交互

| 事件            | 备注           |
| ------------- | ------------ |
| `attack`      | 玩家开始攻击       |
| `action_tick` | 破坏等需要在这里     |
| `entity_push` | 可 `cancel()` |
| `raytrace`    | 可 `cancel()` |

## 渲染

| 事件          | 字段                                           |
| ----------- | -------------------------------------------- |
| `render_2d` | `partial_ticks`；`render.*` 可用                |
| `render_3d` | `pre`/`post`/`partial_ticks`；`render3d.*` 可用 |

## 其他

| 事件               | 字段                          |
| ---------------- | --------------------------- |
| `chat`           | `message`，可写回 / cancel      |
| `key_pressed`    | `key`，可 cancel              |
| `resize_display` | —                           |
| `module_toggle`  | `name`/`category`/`enabled` |

## Screen 事件（仅 me.registerScreen 注册过的 GUI）

| 事件               | 字段                                                 |
| ---------------- | -------------------------------------------------- |
| `init`           | `screen`/`width`/`height`                          |
| `render_screen`  | `mouse_x`/`mouse_y`/`partial_ticks`；`render.*` 可用  |
| `mouse_clicked`  | `mouse_x`/`mouse_y`/`button`                       |
| `mouse_released` | `mouse_x`/`mouse_y`/`button`                       |
| `mouse_dragged`  | `mouse_x`/`mouse_y`/`button`/`delta_x`/`delta_y`   |
| `mouse_scrolled` | `mouse_x`/`mouse_y`/`delta`                        |
| `key_typed`      | `key`+`scan_code`+`modifiers` 或 `char`+`modifiers` |
| `close`          | —                                                  |
