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.
As this project is in its early beta stage, the official demo/beta builds are published here, on GitHub (check Releases and Packages sections) and on Modrinth to be easily accessible by the community.
Using links below you can find the latest builds on both platforms:
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
- 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
- Clone the repository:
git clone https://github.com/yourusername/paperchat.git
cd paperchat- Configure environment variables:
# Create environment file
cp .env.example .envvNOTE: Edit the .env file to set your desired settings.
- Start with Docker Compose:
# Run the cloud container
docker-compose up --build
# Or build yours and then run
docker-compose up --buildd- Java 21 or higher
- Gradle 9.0 or higher
- PaperMC server 1.21+
- Configure and build the plugin:
gradle wrapper --gradle-version 9.0
./gradlew clean buildd- Copy to server:
cp build/libs/paperchat-*.jar /path/to/your/minecraft/server/plugins/- Configure environment variables:
export PAPERCHAT_API_KEY="your-api-key-here"
export PAPERCHAT_PROVIDER="google"
export PAPERCHAT_MODEL="gemini-2.5-flash"- Start your Minecraft server
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: 100Configuration in config.yml matches the environment variables. If both are set, the environment takes precedence.
Send a message to AI:
/paperchat Available options:
- /paperchat : Ask a question to the AI
- /paperchat history : View your conversation history
- /paperchat clear : Clear your conversation history
story
y
paperchat.use- Allows players to use the /paperchat command
- Player sends command with target message
- AI processes the message with conversation history context
- Response is formatted and sent to the sender
- Both the original message and AI response are stored in conversation history
PaperChat follows clean architecture principles:
src/main/java/lt/domax/paperchat/
├── domain/
│ ├── ai/ # AI provider abstractions and registry
│ ├── chat/ # Chat services and session management
│ ├── config/ # Configuration management
│ └── player/ # Player data management
├── infrastructure/
│ └── commands/ # Minecraft command implementations
├── resources/
│ ├── plugin.yml # Plugin metadata
│ └── META-INF # Java metadata
│ └── services/ # Service provider configurations
└── PaperChat.java # Main plugin class
lugin class
- Abstract Provider Class: Base for all AI implementations
- Service Provider Interface: Automatic registration using Java SPI
- Registry Pattern: Centralized provider management
- Graceful Fallback: Automatic error recovery and user-friendly messages
- Create provider class:
@AIProvider("yourprovider")
public class YourProvider extends Provider {
// Implementation
}}- Add to service registry: Add your provider class name to::
src/main/resources/META-INF/services/lt.domax.paperchat.domain.ai.Provider
- Visit Google AI Studio
- Create a new API key
- Set
PAPERCHAT_API_KEYto your key - Set
PAPERCHAT_PROVIDERtogoogle - Set
PAPERCHAT_MODELto your desired Gemini model (e.g.,gemini-2.5-flash)
- Visit OpenAI API
- Create a new API key
- Set
PAPERCHAT_API_KEYto your key - Set
PAPERCHAT_PROVIDERtoopenai - Set
PAPERCHAT_MODELto your desired OpenAI model (e.g.,gpt-5)
- Visit Hack Club's AI
- Set
PAPERCHAT_API_KEYto be empty (any other value will simply be ignored) - Set
PAPERCHAT_PROVIDERtohackclub
Plugin fails to load or compile:
- Check Java version (requires 21+)
- Verify API key and/or model is set correctly
- Check server logs for detailed error messages
AI responses not working:
- Verify API key has sufficient credits/quota
- Check network connectivity from server
- Review timeout settings
Performance issues:
- Reduce
PAPERCHAT_MAX_HISTORYvalue - Increase
PAPERCHAT_TIMEOUTfor slow networks - Monitor API usage and rate limits
- Fork the repository
- Create a feature branch
- Make your changes following the existing architecture
- Submit a pull request
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
- API keys are never logged or exposed
- All AI requests use HTTPS
- Player data is stored locally only
- No external data transmission beyond AI providers
For issues, feature requests, or questions:
- Open an issue on GitHub
- Review configuration options
Built with modern Java practices for reliable Minecraft server integration. Happy chatting!