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

# Cheart 脚本

> 脚本系统简介

<Tip>
  **AI / LLM 读者**：直接读 [LLM Primer](/LLM)
</Tip>

Cheart 支持用 [BeanShell](https://github.com/beanshell/beanshell) 脚本扩展客户端功能。脚本可以注册模块、命令、GUI，订阅事件，调用客户端 API。

## 示例

```java theme={null}
@Module(name="Hello", category="PLAYER", defaultEnabled=true)
void meta(valueManager) {
    valueManager.registerSlider("count", "Count", 0, 100, 10);
}

@EventTarget(events="tick")
void onTick(event) {
    me.log("tick, count = " + me.getInt("count"));
}
```

## MCP

MCP服务器为`https://docs.cheart.getvapu.today/mcp`

您可以使用任何AI工具连接让您的AI助手获得知识库

## 顶层对象

| 名字              | 作用                                        |
| --------------- | ----------------------------------------- |
| `me`            | 玩家 / 世界 / 聊天 / 动作                         |
| `moduleManager` | 查询 / 操作 cheart 所有模块                       |
| `inventory`     | 背包 / 容器 / slot spoof                      |
| `packet`        | 构造 + 发送 serverbound 包                     |
| `notify`        | 右下角通知                                     |
| `bridge`        | 跨脚本共享数据 + 方法调用                            |
| `render`        | 2D GUI 绘制（render\_2d / render\_screen 里用） |
| `render3d`      | 3D 世界绘制（render\_3d 里用）                    |

## 目录

* [LLM Primer](/LLM) — **AI 必读**
* [setup](/setup) — 脚本位置、加载顺序、命令
* [examples](/examples) — 常见模式
* API 参考见左侧边栏
