PaperChat - 基于 AI 的 Minecraft 插件
PaperChat 是一款 Minecraft 服务器插件,可将 AI 语言模型直接集成到 Minecraft 中。它允许玩家向 AI 助手发送消息并快速获取回答,从而创建由 Google Gemini 和 OpenAI 模型驱动的自然对话体验,并且您还能添加自己的模型!
该插件专为 PaperMC 服务器构建,为每位玩家维护对话历史记录,并在 Minecraft 玩家与现代 AI 能力之间提供无缝连接。
项目理念
PaperChat 遵循“自行运行”的理念。通过要求您使用自己的 AI API 凭据和本地部署,您可以获得:
- 无速率限制 - 您的 API 密钥,您的使用配额
- 完全隐私 - 玩家的对话永远不会离开您的基础设施
- 完全控制 - 自定义 AI 行为、系统提示词和响应过滤
- 无依赖项 - 除了 AI 提供商本身之外,无需任何外部服务
功能
- 多提供商 AI 支持:自动注册 Google Gemini 和 OpenAI 提供商,并具有易于扩展性
- 持久化对话历史:每位玩家的聊天会话,可配置的历史记录限制
- 智能错误处理:用户友好的错误消息,带有自动响应恢复功能
- 可配置的系统提示词:定义 AI 行为和响应格式化规则
- 输入验证:字符限制
- 异步处理:非阻塞 AI 请求以维持服务器性能
- Docker 就绪:完整的容器化部署,内置 Minecraft 服务器
配置
PaperChat 通过环境变量进行配置:
| 变量 |
描述 |
值 |
PAPERCHAT_API_KEY |
您的 AI 提供商 API 密钥 |
your-api-key(仅由您的提供商要求。如果某个 AI 提供商不需要 API 密钥,您可以留空) |
PAPERCHAT_MAX_HISTORY |
每位玩家保存的最大过去请求数 |
对话历史记录限制 |
PAPERCHAT_PROVIDER |
可用的 AI 提供商之一 |
AI 提供商(更多详情请参见 可用提供商) |
PAPERCHAT_MODEL |
提供商提供的任何 LLM |
要使用的模型(仅由您的提供商要求。如果某个 AI 提供商不需要设置模型,您可以留空) |
PAPERCHAT_TEMPERATURE |
响应创造性 (0.0-1.0) |
0.7 |
PAPERCHAT_TIMEOUT |
请求超时时间(秒) |
30 |
PAPERCHAT_MAX_INPUT_CHARACTERS |
最大输入消息长度 |
100 |
PAPERCHAT_MAX_OUTPUT_TOKENS |
最大响应长度 |
4096 |
PAPERCHAT_SYSTEM_PROMPT |
用于 AI 行为的自定义系统提示词 |
您的自定义提示词(留空则使用默认系统提示词) |
或者位于 data/plugins/PaperChat/ 目录中的 config.yml 文件:
ai:
api-key: "" # 如果您的提供商不需要 API 密钥,您可以将其留空
provider: "google"
model: "gemini-2.5-flash" # 如果您的提供商不需要模型参数,您可以将其留空。不过,目前仅 HackClub 提供商如此
temperature: 0.7
timeout: 30
max-output-tokens: 4096
system-prompt: "" # 在此处包含您的自定义系统提示词
# 注意:在此处设置系统提示词将覆盖当前提示词
# 如果留空,将使用默认系统提示词
# 聊天配置
chat:
max-history: 5
max-input-characters: 100
config.yml 中的配置与环境变量匹配。如果两者都设置了,环境变量优先。
PaperChat - AI-Powered Minecraft Plugin
PaperChat is a Minecraft server plugin that integrates AI language models directly into Minecraft. It allows players to send messages to AI assistants and get answers quickly, creating natural conversation experiences powered by Google Gemini and OpenAI models, with the ability to add your own!
Built for PaperMC servers, PaperChat maintains conversation history per player and provides a seamless bridge between Minecraft players and modern AI capabilities.
Project Philosophy
PaperChat follows the "run it yourself" philosophy. By requiring your own AI API credentials and local deployment, you get:
- No Rate Limits - Your API keys, your usage quotas
- Complete Privacy - Player conversations never leave your infrastructure
- Full Control - Customize AI behavior, system prompts, and response filtering
- No Dependencies - No external services beyond the AI providers themselves
Features
- Multi-Provider AI Support: Automatic registration of Google Gemini and OpenAI providers with easy extensibility
- Persistent Conversation History: Per-player chat sessions with configurable history limits
- Smart Error Handling: User-friendly error messages with automatic response recovery
- Configurable System Prompts: Define AI behavior and response formatting rules
- Input Validation: Character limits
- Asynchronous Processing: Non-blocking AI requests to maintain server performance
- Docker Ready: Complete containerized deployment with Minecraft server bundled in
Configuration
PaperChat is configured through either environment variables:
| Variable |
Description |
Value |
PAPERCHAT_API_KEY |
Your AI provider API key |
your-api-key (required only by your provider. If an AI provider does not require an API key, you can leave this blank) |
PAPERCHAT_MAX_HISTORY |
Max number of past requests to be saved per player |
Conversation history limit |
PAPERCHAT_PROVIDER |
One of the available AI providers |
AI provider (see more at Available Providers) |
PAPERCHAT_MODEL |
Any LLM that a provider provides |
Model to use (required only by your provider. If an AI provider does not require a model to be set, you can leave this blank) |
PAPERCHAT_TEMPERATURE |
Response creativity (0.0-1.0) |
0.7 |
PAPERCHAT_TIMEOUT |
Request timeout in seconds |
30 |
PAPERCHAT_MAX_INPUT_CHARACTERS |
Maximum input message length |
100 |
PAPERCHAT_MAX_OUTPUT_TOKENS |
Maximum response length |
4096 |
PAPERCHAT_SYSTEM_PROMPT |
Custom system prompt for AI behavior |
Your custom prompt (leaving empty uses default system prompt) |
Or config.yml file located in the data/plugins/PaperChat/ directory:
ai:
api-key: "" # You can leave it empty if your provider does NOT require an API key
provider: "google"
model: "gemini-2.5-flash" # You can leave it empty if your provider does NOT require a model parameter. However, at the moment this is only true for HackClub provider
temperature: 0.7
timeout: 30
max-output-tokens: 4096
system-prompt: "" # Include your custom system prompt here
# NOTE: setting a system prompt here will overwrite the current prompt
# If left empty, the default system prompt will be used
# Chat Configuration
chat:
max-history: 5
max-input-characters: 100
Configuration in config.yml matches the environment variables. If both are set, the environment takes precedence.
评论 0
登录后参与评分
还没有评论,来抢沙发吧