---
title: "AI NPC mod: how to add AI-talking NPCs to a game you did not make"
subtitle: Which games can take an AI NPC mod, the steps in order, what the mod must do and what Yumina does, and where it stops.
description: How to make an AI NPC mod for a game you did not make. Which mod loaders work, the steps, what the mod does versus Yumina, and the limits.
author: Yumina
date: 2026-12-04
category: guides
tags: AI NPC mod, AI NPC, game mod, BepInEx, MelonLoader, SMAPI, Yumina Link, Yumina games SDK
lang: en
url: https://yumina.io/blog/ai-npc-mod-for-any-game
canonical: https://yumina.io/blog/ai-npc-mod-for-any-game
---

# AI NPC mod: how to add AI-talking NPCs to a game you did not make

*Which games can take an AI NPC mod, the steps in order, what the mod must do and what Yumina does, and where it stops.*

An AI NPC mod for a single-player game is about 350 to 450 lines of game-specific code. That was the count in three test builds described in Yumina's docs, as of 4 December 2026: a Lua game, a Unity game and an Unreal 5.4 game, each built by an AI working alone in 31 to 40 minutes. The mod reads the game and shows the reply. The characters run on Yumina.

People search "ai npc mod" with a game's name after it: Skyrim, Minecraft, GTA 5, Cyberpunk. We have no mod for any of those four and have tested none of them. This page is the method.

## Which games can take an AI NPC mod?

A game can take one if a mod can run code in it and reach the network, or at least write a file. The path depends on what the game's mod loader lets you write.

| The mod can run | Path | Named in Yumina's docs |
| --- | --- | --- |
| C# | The C# SDK, one DLL with no third-party dependencies | BepInEx, MelonLoader, SMAPI |
| JavaScript | The npm package `@yumina.io/games` | Web games, Electron, Node |
| Any language with HTTPS | One HTTPS call per line | Any engine |
| Scripts with no HTTPS | Yumina Link, a small program beside the game | UE4SS Lua, Papyrus, the Baldur's Gate 3 Script Extender |

Of the loaders, the docs call Unity Mono, 64-bit, "supported end to end today", with BepInEx 5.

Two kinds of game are out. Games with anti-cheat such as EasyAntiCheat, BattlEye or GameGuard: players get banned, and Yumina's mod tool refuses them. And multiplayer games. The docs say plainly: only single-player games you own.

## What does the mod do, and what does Yumina do?

| The mod | Yumina |
| --- | --- |
| Finds who is on screen and builds their card from the player's copy of the game | Writes the prompt and calls the model |
| Sends the player's words and the game's facts each turn | Keeps memory for each save |
| Shows the reply, best in the game's own speech bubble | Checks every action against your manifest |
| Applies an accepted action with the game's own functions, and reports it | Signs the player in and charges the player's account |
| Stores one memory id when the game saves | Returns the line, suggested replies and at most one action |

The mod holds no API key, no prompt template and no chat history. The developer pays nothing. Each turn is charged to the player's Yumina wallet at the model's real cost, or the player sets their own AI key in their Yumina settings and Yumina charges nothing.

## What are the steps to make an AI NPC mod?

The docs give the order that worked.

1. **Back up first.** Record the game folder and copy the saves before you touch anything.
2. **Register the mod** at [yumina.io/app/developer](https://yumina.io/app/developer) and write the manifest: the facts the game sends each turn, and two or three actions the game can do in one call each.
3. **Read the game's code.** Decompile it and find who is on screen, where their name and lines are kept, the functions the game uses to change money, items and health, and the save and load calls.
4. **Install the loader and write the mod.** Most of the work is one adapter file.
5. **Sign in once and test in the real game.** Check each action in the game's own UI, each refusal, and memory after save, quit and load.
6. **Put everything back** and verify the game folder against the record from step 1.

In C#, one line of talk with one action looks like this:

```csharp
var turn = await npc.SayAsync(text, inputs: facts, allow: new object[]
{
    Allow.Action("give_item").Only("item", carried),      // only what this NPC carries
    Allow.Action("give_gold").Range("amount", 0, npc.Gold),
});

if (turn.Action is { Accepted: true } a && a.Id == "give_gold")
{
    player.Gold += (int)a.Number("amount");
    npc.Report(turn, true);
}
```

The AI only proposes. `Only` and `Range` narrow what the character may ask for on this turn, Yumina refuses any other value, and the game still applies the action itself.

## What if the game's scripts cannot reach the network?

Then the script writes a file. Yumina Link runs beside the game on the player's PC, keeps the player's sign-in, and watches a folder. The script writes a request there:

```json
{ "client_id": "ym_…", "op": "turns", "body": { "character": "shadowheart", "card": { "id": "…" }, "text": "…", "memory": { "head": null } } }
```

It saves this as `<id>.yumina-request.json` and reads `<id>.yumina-response.json` when it appears. Link also answers on `http://127.0.0.1:47600` for scripts that have HTTP and no HTTPS. It refuses any request that comes from a web page, so a website cannot spend the player's balance through it.

The Unreal test build used this path, because UE4SS Lua cannot make HTTPS calls.

## What goes wrong in practice?

The three test builds each hit something different. These are the ones worth knowing before you start.

- **Character ids.** Use the game's content id, such as an enemy key. An object's instance id changes on every load, and the character forgets everything.
- **Scene changes in Unity.** Many games destroy BepInEx's manager object on the first scene change. Put the mod on its own object that survives loads.
- **Hotkeys.** A typing field does not stop the game's own keys. Find each place the game reads a key and silence it while the player types.
- **Timeouts.** A turn takes 5 to 10 seconds, and some engines' HTTP gives up sooner. Give each turn a request id. Link then answers a repeat with the same turn and does not charge twice.
- **Unasked actions.** A character may do anything it is allowed to. In one test a wall "mended the town" twice with nobody asking. Mark such an action `onlyWhenAsked`.
- **Memory tests.** Ask "Have we met?", not "You remember my red die, right?". A model plays along with a leading question.

## What are the limits?

One account can register 10 games or mods. A new one is in development, open to you and up to 50 testers, until Yumina reviews its manifest. Each turn carries at most one action.

The mod tool, `yumina-mod`, automates backup, decompiling and loader install for Unity Mono today. For other engines it reports what it found and you do those steps by hand.

Nothing from the game ships in the mod. Cards are built at runtime from the player's own copy.

On the Yumina side, an account is free and has free models with no message limit, or the player brings their own key. Memory is unlimited, up to what the model can hold. The SDK packages are Apache-2.0.

## FAQ

### Is there a Yumina AI NPC mod for Skyrim, Minecraft, GTA 5 or Cyberpunk 2077?

No. As of 4 December 2026 Yumina has not built or tested a mod for any of those four games. Its docs cover the method, a Stardew Valley kit, and three unnamed test builds on Lua, Unity and Unreal.

### Is there a working mod that shows the method?

Yes, one. SpireTalk gives nine characters in Slay the Spire 2 AI conversation, and its code is public. It runs Yumina's engine inside the mod on the player's own API key, an older route than the sign-in SDK. [The write-up is here](/blog/ai-events-and-characters-slay-the-spire-2).

### Does an AI NPC mod need an API key?

A mod built on Yumina's SDK holds no key. The player signs in with a Yumina account in the browser or by QR code, and that account pays for the turns, or uses the player's own key from their Yumina settings.

### Can an AI build the mod for me?

Yumina's docs describe a Mod Workshop window that lists the Steam games on a PC and lets Yumina's AI, Claude Code or another AI with MCP do the work. The docs report a fresh AI rebuilding the Unity test mod in 25 minutes with the tool and template.

## Sources

- Yumina developer docs, read 4 December 2026: [Any game](https://docs.yumina.io/developers/any-game), [Yumina Link](https://docs.yumina.io/developers/link), [C# SDK](https://docs.yumina.io/developers/dotnet), [How it works](https://docs.yumina.io/developers/concepts), [Stardew Valley example](https://docs.yumina.io/developers/example-stardew).
- [docs.bepinex.dev](https://docs.bepinex.dev/), checked 4 December 2026: BepInEx is "a patcher/plug-in framework for Unity games that use Mono as their scripting backend".
- Related: [What is an AI NPC?](/blog/what-is-an-ai-npc) and [the Stardew Valley AI mod guide](/blog/stardew-valley-ai-mod).
- Not verified: which loaders the Skyrim, Minecraft, GTA 5 and Cyberpunk 2077 scenes use for a mod like this. We left those games out of the method for that reason.
