-
Notifications
You must be signed in to change notification settings - Fork 0
Home
This file is gitignored. Copy sections into your GitHub Wiki as separate pages. Suggested page names are marked with
<!-- PAGE: Name -->.
Aicraft is a Paper plugin that adds private AI chat to Minecraft — in-game and in the browser. Players talk to any OpenAI-compatible API (Ollama, Unsloth, vLLM, OpenAI, etc.). Conversations are saved per player with optional web access to history.
Author: SushiMC
Current version: 1.1.0
Supported platforms: Paper 1.21+ and 26.x
- Installation
- Configuration
- Commands
- Web UI
- Permissions and Rate Limits
- Database
- AI Providers
- Troubleshooting
- FAQ
- Changelog
- Private in-game chat — only the player sees messages
- OpenAI-compatible API (
/v1/chat/completions) - Local models (Ollama, Unsloth, LM Studio, vLLM) and cloud APIs
- Per-player chat IDs (
Chat #1is always your chat #1) - Saved chat history (SQLite or Postgres)
- Web UI with account linking
- LuckPerms-friendly daily chat limits
| Component | Requirement |
|---|---|
| Server software | Paper 1.21+ or 26.x (not Spigot) |
| Java | 21 (Paper 1.21.x) or 25 (Paper 26.x) |
| AI backend | Any OpenAI-compatible chat API |
| Web UI (optional) | Open port 8765 (or your configured port) |
- Download the latest
aicraft-x.x.x.jarfrom Releases or Modrinth. - Place the JAR in your server's
plugins/folder. - Start or restart the server.
- On first run, Aicraft creates:
| File | Purpose |
|---|---|
plugins/Aicraft/config.yml |
AI endpoint and model settings |
plugins/Aicraft/web.yml |
Web UI, database, rate limits |
plugins/Aicraft/aicraft.db |
SQLite database (auto-created) |
- Edit
config.yml(andweb.ymlif using the web UI). - Restart the server. Reloading may not restart the web server or database pool.
See Configuration for all options.
Aicraft uses two config files in plugins/Aicraft/:
| File | What it controls |
|---|---|
config.yml |
AI provider, model, system prompt, timeouts |
web.yml |
Web UI, database, rate limits, account linking |
Restart the server after editing either file.
endpoint: "http://localhost:11434/v1/chat/completions"
api-key: "ollama"
model: "llama3.2"
system-prompt: "You are a helpful assistant inside a Minecraft server. Keep replies concise and game-friendly."
timeout-seconds: 120
max-history-messages: 20| Option | Description |
|---|---|
endpoint |
Full URL to /v1/chat/completions
|
api-key |
Sent as Authorization: Bearer …. Use any placeholder (e.g. ollama) if auth is not required |
model |
Model name your provider expects |
system-prompt |
Prepended to every new chat |
timeout-seconds |
HTTP timeout for AI requests |
max-history-messages |
Max user + assistant messages kept in the AI context window |
enabled: true
port: 8765
bind-address: "0.0.0.0"
database:
type: sqlite
sqlite-file: "aicraft.db"
postgres:
host: "localhost"
port: 5432
database: "aicraft"
username: "aicraft"
password: ""
rate-limits:
default-chats-per-day: 50
linking:
link-code-expiry-minutes: 2
web-session-days: 30| Option | Description |
|---|---|
enabled |
Enable or disable the web UI |
port |
Web server port (default 8765) |
bind-address |
0.0.0.0 = all interfaces; 127.0.0.1 = localhost only |
database.type |
sqlite or postgres
|
database.sqlite-file |
SQLite filename inside plugins/Aicraft/
|
database.postgres.* |
Postgres connection settings |
rate-limits.default-chats-per-day |
Default max new chats per player per 24h |
linking.link-code-expiry-minutes |
How long /ailink codes stay valid |
linking.web-session-days |
How long a linked web session lasts |
See Database and AI Providers for setup details.
| Command | Permission | Description |
|---|---|---|
/newchat |
aicraft.use |
Start a new private chat. Shows your Chat #N ID. |
/ai <message> |
aicraft.use |
Send a message in your active chat |
/endchat |
aicraft.use |
End your active chat (history is saved) |
/reopenchat <id> |
aicraft.use |
Reopen one of your saved chats by number |
/ailink |
aicraft.web |
Get a link code for the web UI |
Each player has their own numbered chats. /reopenchat 1 opens your chat #1, not another player's.
Chat numbers increment per player: first chat is #1, second is #2, and so on. The same numbers appear in the web UI.
/newchat
→ Chat #3 started. Only you see this conversation.
/ai what should I build in survival?
/ai give me a compact starter base layout
/endchat
/reopenchat 3
/ai add a storage room to that plan
/endchat
-
/aionly works while a chat is active (/newchator/reopenchat). - Messages are private — other players cannot see your chat or the AI's replies.
- Starting a new chat with
/newchatcounts toward your daily limit (see Permissions and Rate Limits).
The web UI lets players browse chat history, start new chats, and continue conversations from a browser.
In web.yml:
enabled: true
port: 8765
bind-address: "0.0.0.0"Open http://<server-ip>:8765 (replace with your server IP and port).
- Open the web UI and enter your Minecraft username.
- Join the server and run
/ailink. - A code is shown only to you in-game. Enter it on the web page.
Codes expire after link-code-expiry-minutes (default: 2 minutes). If it expires, start over from step 1.
- View all saved chats
- Start new chats from the browser
- Continue previous conversations
- See the same chat numbers as in-game
| Goal | Suggestion |
|---|---|
| Remote access | Open/forward the web port in your firewall |
| HTTPS | Set bind-address: "127.0.0.1" and put nginx/Caddy in front |
| Disable web only | Set enabled: false — in-game chat and DB still work |
| Security | Do not expose the web UI publicly without HTTPS and access controls |
| Permission | Default | Description |
|---|---|---|
aicraft.use |
true |
In-game commands: /newchat, /ai, /endchat, /reopenchat
|
aicraft.web |
true |
/ailink for web UI account linking |
aicraft.chats.unlimited |
op |
No daily cap on new chats |
aicraft.chats.<n> |
— | e.g. aicraft.chats.50 = 50 new chats per 24h |
- Limits apply to new chats created in a rolling 24-hour window — not individual messages.
-
/newchatand creating a chat on the web both count. - Reopening an existing chat with
/reopenchatdoes not count as a new chat.
-
aicraft.chats.unlimited→ no cap - Highest matching
aicraft.chats.<n>permission - Fallback:
rate-limits.default-chats-per-dayinweb.yml
/lp group default permission set aicraft.chats.10 true
/lp group vip permission set aicraft.chats.100 true
/lp group staff permission set aicraft.chats.unlimited true
Players creating chats from the web while offline use LuckPerms cached permissions when LuckPerms is installed.
Aicraft stores chat history, web sessions, and link requests in a database. The database is always initialized — even when the web UI is disabled.
Zero setup. On first startup:
- Creates
plugins/Aicraft/aicraft.db - Runs migrations automatically
- Creates all required tables
database:
type: sqlite
sqlite-file: "aicraft.db"You never need to run SQL manually.
Create the database on your Postgres server first, then configure:
database:
type: postgres
postgres:
host: "localhost"
port: 5432
database: "aicraft"
username: "aicraft"
password: "your-password"Migrations run automatically on startup.
| Table | Purpose |
|---|---|
chats |
Chat sessions per player (with per-player chat number) |
chat_messages |
Messages (user, assistant, system) |
web_sessions |
Linked web UI sessions |
link_requests |
Pending /ailink verification codes |
schema_version |
Migration tracking |
For SQLite, stop the server (or ensure no writes) and copy plugins/Aicraft/aicraft.db. For Postgres, use your normal backup tooling.
Aicraft uses the OpenAI chat completions format: POST /v1/chat/completions with a JSON body containing model and messages.
On the same machine as Minecraft:
ollama pull llama3.2
ollama serveendpoint: "http://localhost:11434/v1/chat/completions"
api-key: "ollama"
model: "llama3.2"If Ollama runs on another machine, replace localhost with that host's IP.
endpoint: "https://api.openai.com/v1/chat/completions"
api-key: "sk-your-key-here"
model: "gpt-4o-mini"Any service exposing /v1/chat/completions works, including:
- Unsloth
- vLLM
- LM Studio
- Groq
- OpenRouter
Set endpoint to the full completions URL, api-key to your key (or a placeholder if unused), and model to the provider's model name.
If the AI server runs in Docker and Minecraft runs on the host, localhost from the Minecraft server's perspective may not reach the container. Use the container's published IP/port or host.docker.internal where applicable.
Run /newchat or /reopenchat <id> before /ai.
The player hit their 24h new-chat cap. Grant aicraft.chats.<n>, aicraft.chats.unlimited, or raise default-chats-per-day in web.yml.
- Confirm the AI server is running (
ollama serve, etc.) - Check
endpointincludes the full path:/v1/chat/completions - If the model is on another machine, use that IP instead of
localhost - Check firewall / Docker networking between Minecraft and the AI host
- Pull the model:
ollama pull <model> - Match
modelinconfig.ymlexactly to the provider's name
- Increase
timeout-secondsinconfig.yml - Use a smaller/faster model
- Confirm
enabled: trueinweb.yml - Check firewall / port forwarding for your configured port
- Look for
Aicraft web UI running on http://...in server logs
Enter your username on the web UI first, then run /ailink within the expiry window.
Start over: enter username on the web → /ailink in-game → enter code quickly.
- Verify the database exists and credentials in
web.ymlare correct - Ensure the Minecraft server can reach the Postgres host and port
Rare with normal use. Restart the server. Avoid copying the .db file while the server is running.
No. Aicraft requires Paper 1.21+ or 26.x.
No. All in-game messages are sent only to you.
Yes. SQLite creates plugins/Aicraft/aicraft.db on first startup with all tables.
Yes. Set enabled: false in web.yml. The database still saves in-game chats.
Yes. In-game and web chats use the same database and per-player chat numbers.
No. Only new chats (/newchat or "New chat" on the web) count.
Yes. Rate limits fall back to default-chats-per-day in web.yml. LuckPerms is optional for per-group limits.
Paper 1.21 through 26.x. Same JAR for all supported versions.
- Web UI on configurable port
- SQLite database (default) and Postgres support
- Auto-run database migrations
- Per-player chat IDs with
/reopenchat - Account linking via web UI +
/ailink - LuckPerms-compatible daily chat limits (
aicraft.chats.<n>) - Chat history synced between in-game and web
- Initial release
- Private in-game AI chat (
/newchat,/ai,/endchat) - OpenAI-compatible API support (Ollama, local models, cloud)
-
config.ymlfor endpoint, API key, and model
Wiki maintained by SushiMC. For bugs and feature requests, open an issue on the repository.