
A powerful Minecraft AI chat plugin supporting multiple LLM APIs
图片由 Gemini Nano Banana 2 生成
一个强大的 Minecraft 服务器 AI 聊天插件
让玩家在游戏中与各种大语言模型 (LLM) 进行对话
你是否想过让 Minecraft 服务器中的玩家能够直接与 AI 对话?LLMChat 让这一切变得简单。
LLMChat 是一个为 Minecraft 服务器设计的 AI 聊天插件,支持多种大语言模型 API,让玩家可以在游戏中与 AI 进行自然对话。无论是回答游戏问题、提供服务器帮助,还是简单的闲聊,LLMChat 都能胜任。
[!TIP]
支持所有兼容 OpenAI API 格式的服务,包括 OpenAI、SiliconFlow、DeepSeek、Azure OpenAI 等。
| 特性 | 描述 |
|---|---|
| 🔌 多 API 支持 | 同时配置多个 LLM API(如 OpenAI、SiliconFlow 等) |
| 🎭 多模型选择 | 每个 API 可配置多个模型,玩家可自由选择 |
| ⌨️ 灵活命令 | 支持指定 API 和模型进行对话 |
| ⏱️ 冷却管理 | 可配置的请求频率限制,防止 API 滥用 |
| 📋 白名单系统 | 特定玩家可绕过冷却限制 |
| 📝 聊天日志 | 自动记录所有对话,按日期分文件存储 |
| 🩺 健康检查 | 控制台命令检查所有 API 和模型的可用性 |
| 🔄 热重载 | 无需重启服务器即可重新加载配置 |
| 🔒 安全设计 | 强制 HTTPS 连接,敏感信息自动脱敏 |
| 依赖 | 版本要求 |
|---|---|
| Minecraft Server | Paper 1.20+ (或 Spigot/Bukkit 兼容) |
| Java | 21 或更高版本 |
LLMChat-x.x.jarplugins 目录plugins/LLMChat-Sodium_Sulfate/config.yml 配置你的 API/llmchat reload 重载配置(控制台)[!WARNING]
请勿将包含真实 API Key 的config.yml上传到公开仓库!
# 默认使用的 API
default_api: "siliconflow"
# 帮助信息(支持 Minecraft 颜色代码)
help_message:
- "&e========== LLMChat 帮助 =========="
- "&b/llmchat <消息> &7- 使用默认API和模型与AI对话"
- "&b/llmchat -api:<名称> <消息> &7- 使用指定API"
- "&b/llmchat -model:<名称> <消息> &7- 使用指定模型"
- "&e=================================="
# 冷却时间配置
cooldown:
whitelist: # 绕过冷却的玩家列表
- "admin"
default: # 默认冷却设置
max_requests_per_minute: 5
cooldown_seconds: 60
models: # 特定模型的冷却设置
qwen:
max_requests_per_minute: 10
cooldown_seconds: 30
# API 配置
apis:
siliconflow:
url: "https://api.siliconflow.cn/v1/chat/completions"
api_key: "YOUR_API_KEY"
default_model: "qwen"
system_prompt: "你是Minecraft服务器中的AI助手,说话简短(不超过80字),用中文回答。"
models:
qwen:
model_id: "Qwen/Qwen3-8B"
deepseek:
model_id: "deepseek-ai/DeepSeek-V3"
| 命令 | 描述 | 权限 |
|---|---|---|
/llmchat <消息> |
使用默认 API 和模型对话 | llmchat.use |
/llmchat -api:<名称> <消息> |
使用指定 API 对话 | llmchat.use |
/llmchat -model:<名称> <消息> |
使用指定模型对话 | llmchat.use |
/llmchat -api:<名称> -model:<名称> <消息> |
同时指定 API 和模型 | llmchat.use |
/llmchat list |
列出所有可用的 API 和模型 | llmchat.list |
/llmchat help |
显示帮助信息 | - |
/llmchat check |
检查所有 API 可用性(仅控制台) | llmchat.admin |
/llmchat reload |
重载配置(仅控制台) | llmchat.admin |
| 权限 | 描述 | 默认 |
|---|---|---|
llmchat.use |
使用 AI 对话功能 | 所有人 |
llmchat.list |
查看 API 和模型列表 | 所有人 |
llmchat.admin |
管理员命令 (reload, check) | OP |
llmchat.bypass.cooldown |
绕过冷却时间限制 | OP |
llmchat.* |
所有 LLMChat 权限 | OP |
理论上支持所有兼容 OpenAI API 格式的服务:
| 服务商 | 状态 | 备注 |
|---|---|---|
| OpenAI | ✅ | GPT-3.5, GPT-4 |
| SiliconFlow | ✅ | Qwen, DeepSeek 等 |
| DeepSeek | ✅ | DeepSeek 系列 |
| Azure OpenAI | ✅ | 需配置正确的 endpoint |
| Cloudflare Workers AI | ✅ | - |
| 通义千问 | ✅ | 阿里云 |
| 智谱 AI | ✅ | GLM 系列 |
| Moonshot | ✅ | Kimi 系列 |
| 其他 OpenAI 兼容 API | ✅ | 只需配置正确的 URL |
# 克隆仓库
git clone https://github.com/SodiumSulfate/LLMChat.git
cd LLMChat
# 使用 Maven 构建
mvn clean package
# 构建产物位于 target/LLMChat-x.x.jar
欢迎提交 Issue 和 Pull Request!
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)[!NOTE]
提交 PR 前请确保代码风格与现有代码一致,并通过编译测试。
本项目采用 GNU General Public License v3.0 开源协议。
重要条款:
Have you ever wanted players on your Minecraft server to chat directly with AI? LLMChat makes it simple.
LLMChat is an AI chat plugin designed for Minecraft servers, supporting multiple LLM APIs, allowing players to have natural conversations with AI in-game. Whether answering game questions, providing server help, or just casual chat, LLMChat handles it all.
[!TIP]
Supports all OpenAI API compatible services, including OpenAI, SiliconFlow, DeepSeek, Azure OpenAI, and more.
| Feature | Description |
|---|---|
| 🔌 Multiple API Support | Configure multiple LLM APIs simultaneously (OpenAI, SiliconFlow, etc.) |
| 🎭 Multiple Model Selection | Each API can have multiple models for players to choose from |
| ⌨️ Flexible Commands | Specify API and model for conversations |
| ⏱️ Cooldown Management | Configurable rate limiting to prevent API abuse |
| 📋 Whitelist System | Specific players can bypass cooldown restrictions |
| 📝 Chat Logging | Automatic conversation logging with daily file rotation |
| 🩺 Health Check | Console command to check availability of all APIs and models |
| 🔄 Hot Reload | Reload configuration without server restart |
| 🔒 Security Design | Enforced HTTPS connections, automatic sensitive data sanitization |
| Dependency | Version |
|---|---|
| Minecraft Server | Paper 1.20+ (or Spigot/Bukkit compatible) |
| Java | 21 or higher |
LLMChat-x.x.jar from Releasesplugins directoryplugins/LLMChat-Sodium_Sulfate/config.yml to configure your APIs/llmchat reload to reload configuration (console only)[!WARNING]
Never uploadconfig.ymlcontaining real API keys to public repositories!
| Command | Description | Permission |
|---|---|---|
/llmchat <message> |
Chat with default API and model | llmchat.use |
/llmchat -api:<name> <message> |
Use specified API | llmchat.use |
/llmchat -model:<name> <message> |
Use specified model | llmchat.use |
/llmchat list |
List all available APIs and models | llmchat.list |
/llmchat help |
Show help message | - |
/llmchat check |
Check API availability (console only) | llmchat.admin |
/llmchat reload |
Reload configuration (console only) | llmchat.admin |
| Permission | Description | Default |
|---|---|---|
llmchat.use |
Use AI chat feature | Everyone |
llmchat.list |
View API and model list | Everyone |
llmchat.admin |
Admin commands (reload, check) | OP |
llmchat.bypass.cooldown |
Bypass cooldown restrictions | OP |
llmchat.* |
All LLMChat permissions | OP |
Theoretically supports all OpenAI API compatible services:
| Provider | Status | Notes |
|---|---|---|
| OpenAI | ✅ | GPT-3.5, GPT-4 |
| SiliconFlow | ✅ | Qwen, DeepSeek, etc. |
| DeepSeek | ✅ | DeepSeek series |
| Azure OpenAI | ✅ | Requires correct endpoint |
| Cloudflare Workers AI | ✅ | - |
| Other OpenAI-compatible APIs | ✅ | Just configure the correct URL |
# Clone the repository
git clone https://github.com/SodiumSulfate/LLMChat.git
cd LLMChat
# Build with Maven
mvn clean package
# Output: target/LLMChat-x.x.jar
Issues and Pull Requests are welcome!
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)[!NOTE]
Please ensure your code style is consistent with existing code and passes compilation before submitting a PR.
This project is licensed under the GNU General Public License v3.0.
Key Terms:
Made with ❤️ by Sodium_Sulfate