
专为 Minecraft 构建的 AI 智能体。
Comparator 为你的 Paper 服务器带来了一个完全对话式的 AI 智能体;它具备多轮记忆、内置工具,并提供 API 供你自行扩展。
功能
? 对话式 AI 智能体
将完全对话式的 AI 智能体直接嵌入到你的 Minecraft 服务器中。Comparator 能在消息之间保持上下文,实现自然、连贯的对话,而不仅仅是单次响应的问答。
? 内置工具
该智能体不仅能聊天。Comparator 自带多个内置工具,AI 可以调用这些工具来提供准确且基于事实的回答:
| 工具 | 描述 |
|---|---|
| Web Search | 搜索网络以获取最新信息,使智能体不局限于其训练数据 |
| Current Date | 获取当前日期,帮助智能体判断其知识的时效性 |
| Game Version | 获取服务器运行的 Minecraft 版本,确保回答的版本准确性 |
| Player Info | 获取玩家的周围环境、物品栏、附近实体、生物群系、游戏模式以及正在查看的目标。这实现了基于上下文的游戏中协助 |
? 嵌入式 Web 面板
Comparator 包含一个内置的 Web 面板,通过嵌入式服务器直接从插件提供服务。它为服务器管理员提供对对话、工具运行和已注册工具的实时视图,并支持实时更新。无需单独部署;只需在 comparator.conf 中配置主机和端口,然后运行 /comparator panel start 即可启动。
? 可扩展的工具 API
第三方插件可以使用 Comparator API 注册自己的工具。定义一个工具就像给函数添加注解一样简单:
@ToolFunction("give_item", "Gives an item to the requesting player")
suspend fun giveItem(
@ToolParameter("The item to give") item: String,
context: ToolContext
): GiveResult {
val player = context.bukkitPlayer ?: throw ToolException("No player context", null)
// ...
}
// Register during ToolRegistrationEvent
event.registry.register(tool(::giveItem))
API 会自动处理参数验证、类型检查、序列化和错误报告。有关详细信息,请参阅 API 文档。
? 为负责任地使用 AI 而设计
Comparator 在设计时考虑了安全性和透明度。这使其区别于那些仅包装 AI API 而没有护栏的插件:
- 权限限制访问 — 所有命令和公共聊天交互都尊重 Bukkit 权限,赋予服务器管理员精细的控制权,决定谁可以使用智能体以及谁可以管理它。
- 可配置的系统提示词 — 智能体的行为、人格和约束均可完全配置。默认提示词明确指示智能体保持话题专注、避免捏造信息,并在其知识可能过时发出标记。
- 上下文隔离 — 对话按玩家、控制台和公共聊天进行隔离。一个玩家无法读取或污染另一个玩家的对话历史。
- 自动上下文过期 — 对话历史在一段可配置的无活动期后过期,从而限制非预期的数据保留。
- 工具结果和参数验证 — 在执行前,工具输入会根据声明的参数类型和约束进行验证。智能体无法使用格式错误的参数调用工具。
- 基于队列的消息处理 — 每个对话都通过有界通道运行。如果玩家向智能体发送大量消息,多余的请求会被优雅地拒绝,而不是无限排队。
- 结构化错误处理 — 工具失败会以描述性错误的形式呈现给模型,而不是原始堆栈跟踪或内部状态。
⚡ 高性能、非阻塞架构
基于 Kotlin 协程构建,实现完全非阻塞执行。AI 请求、工具调用和上下文操作永远不会阻塞服务器线程,因此智能体不会对服务器 Tick 性能产生影响。
✨ 灵活的 AI 提供商支持
集成 Ollama,支持云端托管和自托管模型。在 comparator.conf 中配置你的模型、基础 URL 和可选的 API 密钥。
安装
- 从 Modrinth 或 GitHub Releases 下载插件
.jar文件 - 将
.jar文件放入服务器的plugins/文件夹中 - 重启服务器
- 遵循 快速入门指南 完成设置
用法
私聊询问(DM 风格):
/ask <prompt>
在公共聊天中提及:
@bot <prompt>
如需完整使用说明,请参阅文档。
支持
贡献指南
欢迎贡献!
- Fork 本仓库
- 创建功能分支:
git checkout -b feature/my-feature - 提交更改:
git commit -m "Add my feature" - 推送并发起 Pull Request
请遵循现有的代码风格,并在适用时包含测试。更多详情请参阅 CONTRIBUTING.md。
致谢
- 主图标:电路,由 Skena Grafis 创作,来自 The Noun Project(CC BY 3.0)

The AI agent built for Minecraft.
Comparator brings a fully conversational AI agent to your Paper server; with multi-turn memory, built-in tools, and an API to extend it on your own.
Features
? Conversational AI Agent
Embed a fully conversational AI agent directly into your Minecraft server. Comparator maintains context across messages for natural, coherent dialogue; not just one-shot responses.
? Built-In Tools
The agent can to more than just chat. Comparator ships with several built-in tools the AI can invoke to give accurate, grounded answers:
| Tool | Description |
|---|---|
| Web Search | Searches the web for up-to-date information, so the agent isn't limited to its training data |
| Current Date | Retrieves the current date, helping the agent reason about how recent its knowledge is |
| Game Version | Fetches the server's running Minecraft version so answers are version-accurate |
| Player Info | Retrieves the player's surroundings, inventory, nearby entities, biome, game mode, and what they're looking at. This enables contextual in-game assistance |
? Embedded Web Panel
Comparator includes a built-in web panel served directly from the plugin via an embedded server. It gives server admins a live view into conversations, tool runs, and registered tools with real-time updates. No separate deployment needed; just configure the host and port in comparator.conf and run /comparator panel start to launch it.
? Extensible Tool API
Third-party plugins can register their own tools using the Comparator API. Defining a tool is as simple as annotating a function:
@ToolFunction("give_item", "Gives an item to the requesting player")
suspend fun giveItem(
@ToolParameter("The item to give") item: String,
context: ToolContext
): GiveResult {
val player = context.bukkitPlayer ?: throw ToolException("No player context", null)
// ...
}
// Register during ToolRegistrationEvent
event.registry.register(tool(::giveItem))
The API handles parameter validation, type checking, serialization, and error reporting automatically. See the API docs for full details.
? Designed for Responsible AI Use
Comparator was built with safety and transparency in mind. This sets it apart from plugins that simply wrap an AI API with no guardrails:
- Permission-gated access — All commands and public chat interactions respect Bukkit permissions, giving server admins fine-grained control over who can use the agent and who can manage it.
- Configurable system prompt — The agent's behavior, persona, and constraints are fully configurable. The default prompt explicitly instructs the agent to stay on-topic, avoid fabricating information, and flag when its knowledge may be outdated.
- Context scoping — Conversations are isolated per-player, per-console, and for public chat. A player cannot read or pollute another player's conversation history.
- Automatic context expiry — Conversation history expires after a configurable period of inactivity, limiting unintended data retention.
- Tool result and parameter validation — Tool inputs are validated against declared parameter types and constraints before execution. The agent cannot invoke a tool with malformed arguments.
- Queue-based message handling — Each conversation runs through a bounded channel. If a player floods the agent with messages, excess requests are rejected gracefully rather than queued unboundedly.
- Structured error handling — Tool failures are surfaced to the model as descriptive errors, not raw stack traces or internal state.
⚡ High-Performance, Non-Blocking Architecture
Built on Kotlin coroutines for fully non-blocking execution. AI requests, tool calls, and context operations never block the server thread, so the agent has no impact on server tick performance.
✨ Flexible AI Provider Support
Integrates with Ollama, supporting both cloud-hosted and self-hosted models. Configure your model, base URL, and optional API key in comparator.conf.
Installation
- Download the plugin
.jarfrom Modrinth or GitHub Releases - Place the
.jarin your server'splugins/folder - Restart your server
- Follow the quickstart guide to complete setup
Usage
Ask in private (DM-style):
/ask <prompt>
Mention in public chat:
@bot <prompt>
For full usage information, see the documentation.
Support
Contributing
Contributions are welcome!
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Commit your changes:
git commit -m "Add my feature" - Push and open a Pull Request
Please follow the existing code style and include tests where applicable. For more details, see CONTRIBUTING.md.
Credits
- Main icon: circuit by Skena Grafis from The Noun Project (CC BY 3.0)
下载 Comparator
下载 Comparator
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Comparator
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Comparator
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Comparator
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Comparator
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Comparator
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Comparator
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Comparator
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Comparator
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
完整更新日志可在 GitHub 上查看
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
插件
PacketEvents 是一款专为 Minecraft Java 版打造的协议库,旨在简化数据包的处理与传输。
插件
ExyliaPlugins 的库。
插件
通过对话框或铁砧界面帮助你的 Anthme
插件
自定义你的Minecraft头像!
插件
重新定义服务器上的生物运输方式。使用高度可定制的口袋道具,安全地捕获、存储和释放任何实体。
插件
为基于 Spigot/Paper/Folia 的服务器添加对 Vivecraft 的支持
评论 0
登录后参与评分
还没有评论,来抢沙发吧