Player2 AI NPC is a Minecraft mod that adds an AI-powered companion you can talk to in plain language, and it doubles as a live showcase of the PlayerEngine framework, which lets that companion act in the world instead of just chatting. This guide explains what the mod is, how it works under the hood, how to get it running, where the Godot plugin fits, and how to build an AI NPC game of your own when you want more control than a mod gives you.
What is Player2 AI NPC?
An NPC (non-player character) is any character in a game that the player does not control: shopkeepers, guards, villagers, enemies. Traditionally their behaviour is scripted. A designer writes dialogue trees and behaviour rules, and the character picks from them. If you want the longer version of that distinction, our explainer on scripted vs LLM characters covers it.
Player2 AI NPC takes the other route. The companion’s replies come from a large language model (LLM), the same kind of AI behind modern chatbots, so you can type anything and get an in-character answer. What sets the mod apart from simple “chatbot in a game” experiments is the PlayerEngine layer: the companion can turn what you say into actual gameplay, such as following you, gathering materials or helping in a fight.
The name covers a small family of things, which causes some confusion:
- The Minecraft mod: builds for Forge and Fabric on Minecraft 1.20.1.
- The Player2 AI NPC Pack: a vanilla-plus, AI-themed modpack built around the mod, including a NeoForge 1.21.1 version. It is credited to the mod’s author, Goodbird.
- The Player2 AI NPC plugin for Godot: a developer tool for adding AI NPCs to your own Godot projects.
- The Player2 app: the desktop app that supplies the AI features these projects call.
The Player2 team has also run an AI NPC game jam with prizes, which is why you will find small games with “NPCs that remember everything you say” tagged with the same name.
How the Player2 AI NPC mod works in Minecraft
Under the surface, every Player2 AI NPC companion runs the same loop. Understanding it helps you predict what the companion will be good at and where it will struggle.
- You speak. You type a message to the companion in game.
- The model reads context. Your message is sent, along with a description of the character and recent conversation, to a language model through the Player2 app.
- The model decides. It produces a reply in the character’s voice and, when appropriate, chooses an action.
- PlayerEngine acts. The action is handed to PlayerEngine, which drives the companion like a player would: pathfinding, mining, crafting, following.
That last step is the important part. A language model cannot press keys or walk around a voxel world on its own. It can only produce text. PlayerEngine is the bridge that turns “go get me some wood” into a sequence of real movements and block interactions that Minecraft understands. The model handles intent; the engine handles execution.
This split also explains the companion’s quirks. When it misunderstands you, the fault is usually in the language step. When it understands you but gets stuck on terrain, the fault is in the execution step. Telling the two apart saves a lot of frustration.

How to set up Player2 AI NPC
Exact steps change between versions, so treat the mod page you download from as your checklist. The general process looks like this:
- Pick your loader and version. Decide between Forge 1.20.1, Fabric 1.20.1, or the NeoForge 1.21.1 modpack. The file name tells you which is which, for example a name containing “forge-1.20.1” followed by the mod version.
- Install the mod loader. Install the matching loader for your Minecraft version, or use a launcher that handles modpacks for you if you are going the pack route.
- Add the mod and any dependencies. Drop the jar into your mods folder along with whatever libraries the mod page lists.
- Install and run the Player2 app. The AI side runs through it, so have it open before you launch the game.
- Launch, spawn a companion, and talk. Start with simple, concrete requests before testing anything elaborate.
Common setup problems
- Crash on launch: almost always a mismatch between loader, Minecraft version and mod build. Fabric jars will not load on Forge and vice versa.
- Companion spawns but never answers: check that the Player2 app is running and signed in before you open the world.
- Conflicts with other mods: large modpacks that change AI, pathfinding or player behaviour can clash with PlayerEngine. Test the mod alone first, then add mods back in small batches.
If you only want to play with an AI companion and do not care about mixing it into your own setup, the Player2 AI NPC Pack is the lowest-effort option, because someone has already matched the versions for you.
Player2 AI NPC for Godot and other engines
The Godot plugin is aimed at developers rather than players. Godot is an open-source game engine released under the MIT License, popular with indie developers and jam teams. The Player2 AI NPC plugin lets you add AI-driven characters to a Godot project, using AI APIs provided through the Player2 app rather than a paid API key you manage yourself.
Whatever engine you use, the pattern that makes a Player2 AI NPC work in Minecraft carries over directly. A game engine is the software framework that handles rendering, physics, input and the rest of a game’s core systems, and it is the right place to own anything that changes game state. The language model should only ever suggest. Your code decides.
Here is a minimal JavaScript version of the loop for a browser game. It asks the model for structured JSON, checks the action against a whitelist, and falls back to a scripted line if anything fails:
// Call your own backend, which holds the API key. Never put keys in client code.
const NPC_API_URL = "https://your-backend.example/npc-chat";
const ALLOWED_ACTIONS = ["follow", "stay", "mine", "attack", "none"];
const npc = {
name: "Bramble",
persona: "You are Bramble, a grumpy dwarf miner who helps the player. " +
"Keep replies under 30 words.",
history: []
};
async function talkToNpc(playerText) {
npc.history.push({ role: "user", content: playerText });
const messages = [
{
role: "system",
content: npc.persona +
' Reply ONLY with JSON: {"say": string, "action": one of ' +
JSON.stringify(ALLOWED_ACTIONS) + "}"
},
...npc.history.slice(-10) // short memory keeps cost and drift down
];
try {
const res = await fetch(NPC_API_URL, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ messages })
});
const data = await res.json();
// Assumes your backend returns an OpenAI-style chat response
const reply = JSON.parse(data.choices[0].message.content);
const action = ALLOWED_ACTIONS.includes(reply.action) ? reply.action : "none";
npc.history.push({ role: "assistant", content: JSON.stringify(reply) });
return { say: String(reply.say).slice(0, 200), action };
} catch (err) {
return { say: "Hmph. Ask me again later.", action: "none" };
}
}
// Usage: const { say, action } = await talkToNpc("Can you mine that iron?");
The whitelist is the important line. It is the browser-game equivalent of PlayerEngine: the model can ask to “mine”, but only your game code knows how to mine, and anything outside the list is ignored.





