-
Notifications
You must be signed in to change notification settings - Fork 0
Local AI Ollama and Player2
Blockpal works out of the box with a free built-in AI, and with a HuggingFace (or any OpenAI-compatible) key. As of 3.21.0 there are two more ways to power your companion that need no HuggingFace key — great for running your own models, or for the absolute easiest setup.
Changed in 3.25.0 — there is no priority order any more. A server picks one AI connection and that's the one that runs: MCP, your own API key, Player2, Ollama, the free service, or none. Turning Player2 or Ollama on switches the others off. See Settings → One AI connection at a time.
/ai connection # what's running now /ai connection set ollama # switch (ops)Upgrading servers keep whichever provider the old priority order would have chosen, so nothing changes when you update.
Easier than either of these: if you already pay for Claude, ChatGPT, Grok or Gemini, connect it straight to your world with the MCP server — no key in the game, no model to download.
Want a big cloud provider instead? ChatGPT, Claude, Gemini and Grok are all OpenAI-compatible too — pick one in one click with the AI provider presets on the AI & API tab (or
/ai admin provider <name>). Those use an API key, so they sit at priority 1 above. See Settings → AI provider presets.
In the settings menu: open
/ai menu→ AI & API tab. The AI connection picker at the top chooses which one runs; the endpoint and model boxes for Player2 and Ollama sit further down under "Local & easy AI endpoints", and a live "▶ Bots will use: …" line names exactly what will answer. The/ai admin …text commands below still work (and are the way to configure on Bedrock/vanilla clients with no GUI) —/ai admin ollama onnow simply switches the connection to Ollama.
Ollama runs language models on your own machine and exposes an OpenAI-compatible endpoint. Point Blockpal at it and you can run any model you have pulled, with no key and no internet.
# once, on the machine running the server:
ollama pull llama3.2
# in-game (ops):
/ai admin ollama on
/ai admin ollama model llama3.2
/ai admin ollama # show status
- Default endpoint:
http://localhost:11434/v1/chat/completions(change with/ai admin ollama url <url>— e.g. LM Studio, or a remote box). -
Model pool for the Growth village game: add several models
with
/ai admin ollama models add <id>and each villager is handed a different one, so they "think differently".
Any keyless local OpenAI-compatible server (LM Studio, llama.cpp's server, …) works the same way — just set the URL.
Player2 is an OpenAI-compatible AI made for games. It works two ways:
-
Local (no key to type): install the free Player2 app, sign into it, and
it serves AI on
localhost:4315— no key to paste, no model download. You don't hand Blockpal a token: the app's API is still signed-in-and-authenticated, and Blockpal does Player2's built-in web-login handshake for you to fetch a short-lived key behind the scenes. Just make sure the app is running and logged in before you play. -
Online (cloud): set a
PLAYER2_KEYand Blockpal uses Player2's hosted API with the stronggpt-oss-120bmodel by default.
/ai admin player2 on
/ai admin player2 # show status (local vs online, model, key)
/ai admin player2 url <url> # repoint the online endpoint if needed
- Blockpal reads the key from the
PLAYER2_KEYenvironment variable (or the-Dplayer2.keyJVM property). It is used but never written to disk, and is never baked into the mod jar — the same secure pattern asBLOCKPAL_API_TOKEN. - On a server you host, set
PLAYER2_KEYin the environment before launching. - A key stored via config is obfuscated at rest (still, prefer the env var).
- Do not hardcode a real key into a public build — the jar is decompilable, so anyone who downloads it would get your key.
Endpoint note. player2.game also publishes an
/api/v1/mcproute, which is an MCP server — a different protocol from the OpenAI-style chat-completions that Blockpal speaks. Blockpal's online default is Player2's chat-completions endpoint (https://api.player2.game/v1/chat/completions); use/ai admin player2 url <url>if Player2's chat endpoint ever changes.
- Local: the Player2 app must be running and signed in. If it isn't, Blockpal can't get a login key and the bot reports that Player2 didn't authorise the request — open the app, log in, and try again. (Enabling Player2 pre-fetches the login key, so the first request is already authenticated once the app is up.)
-
A HuggingFace key wins over Player2. Resolution order is key → Player2 → Ollama →
free, so if you (or the server) have an API key set, bots use that and skip Player2.
Clear the key (
/ai mykey clear, or the admin token) if you specifically want Player2. -
Online: set a valid
PLAYER2_KEY— the cloud API rejects unauthenticated requests with a 401.
Blockpal — a Minecraft Fabric AI companion mod · default companion Ethan · Report an issue · MIT License
Start here
Using the mod
- Commands
- Talking to Your Assistant
- Client-Side Assistant
- Possession Mode
- Voice
- Settings
- Performance Presets
- Custom Skins
- Personalities
- Trust & Per-Bot Management
- Running Commands
- AI Actions
- Vision & Code
- PVT — learning by watching
- Speed & Combat
- Bedrock (Geyser)
- Bedrock Add-On (single-player)
Multiplayer & games
AI providers
- MCP server (Claude/ChatGPT/Grok/Gemini)
- Local AI on your GPU
- Local & Player2 AI
- Per-Player Keys & Models
Admin & safety
Reference