---
title: "Stardew Valley AI mod: how villagers get AI conversation, and how to build one"
subtitle: "What a Stardew Valley AI NPC mod needs from the player, how a villager's turn uses hearts, season and weather, how a gift is checked by the game, and what it costs."
description: "How a Stardew Valley AI mod gives villagers AI chat with Yumina's Stardew kit. Sign-in, hearts and weather, gifts the game checks, memory in the save, cost."
author: Yumina
date: 2026-12-04
category: guides
tags: Stardew Valley AI mod, Stardew Valley AI NPC, AI dialogue mod, SMAPI, AI NPC, Yumina games SDK
lang: en
url: https://yumina.io/blog/stardew-valley-ai-mod
canonical: https://yumina.io/blog/stardew-valley-ai-mod
---

# Stardew Valley AI mod: how villagers get AI conversation, and how to build one

*What a Stardew Valley AI NPC mod needs from the player, how a villager's turn uses hearts, season and weather, how a gift is checked by the game, and what it costs.*

In a Stardew Valley AI mod built on Yumina's kit, the player walks up to a villager, presses Q and types, and the villager answers knowing the season, the weather and how many hearts you have. The kit is `Yumina.Games.Stardew`, a library for SMAPI, the Stardew mod loader, and Yumina's developer console turns it into a project that builds and plays. It is a kit for mod makers: as of 4 December 2026 Yumina has not put a finished mod on Nexus.

## What does a Stardew Valley AI NPC mod need from the player?

Stardew Valley, SMAPI and the mod's folder in Mods. Then one of two things.

The first is a Yumina account. The player signs in once and plays. The second is the player's own API key, pasted into the mod's settings. The kit's list of providers is DeepSeek, OpenAI, OpenRouter, Gemini, Claude, Kimi, SiliconFlow, a local Ollama, or any OpenAI-compatible API.

The mod ships no model key and no game text. Each villager's card is built on the player's PC from their installed game: age, manner, birthday, gift tastes and some of the villager's real lines, in the game's language. Villagers added by other mods get a card the same way.

## How does the player sign in?

With one click in the browser. The settings open from F9 or from a section at the top of the game's Options tab. The day after install, Mayor Lewis sends a letter that says how to talk, and a villager you face shows the talk key in a speech bubble.

Sign-in is OAuth with PKCE, the standard for apps that cannot keep a secret. The game opens yumina.io, the player allows the mod, and the code comes back to a port on `127.0.0.1`. The mod keeps a refresh token, encrypted with Windows DPAPI on Windows. The player can disconnect the mod under Settings, Connected apps on Yumina, and its access ends at once.

## How does AI dialogue use hearts, season and weather?

The mod sends them with every line. A turn is one HTTP call. It carries who is speaking, what the player typed, and the facts the game holds at that moment. The kit reads 18 of them without any code from the modder, among them `hearts`, `relationship`, `season`, `day`, `time`, `weather`, `location`, `holding`, `gifted_today`, `your_birthday_today` and `festival_today`.

The villager reads these facts and cannot change them. The manifest template for Stardew tells every villager how to use them: polite or guarded at 0 to 2 hearts, warm at 6 and up, and one to three sentences per reply, about 60 words at most, like the game's own dialogue.

One value goes the other way. Each line returns `friendship_delta`, a number from -20 to 20 that the villager sets by its own personality. The kit caps the total per day, and the player can change the cap.

## What happens when a villager wants to give a gift?

The villager asks, and the game decides. The manifest lists what a villager may ask for. The Stardew template has three actions:

| Action | What it does | On offer from | Limit |
| --- | --- | --- | --- |
| `give_item` | Hands the player an item from a list of 12, such as Coffee or Parsnip Seeds | 2 hearts | Once per period |
| `give_gold` | Gives or lends 50 to 500 gold | 5 hearts | Once per period |
| `invite` | Asks the player to meet later that day, at one of 6 places | 3 hearts | Once per conversation |

Yumina checks every request before the mod sees it: the action exists, the parameters are in range, the hearts condition holds, the limit is not spent. An action that fails a condition is not offered that turn, and the villager is told why. At one heart, Abigail turns you down in her own words, with the manifest's reason behind it: "you barely know the player yet".

Then the game applies its own rules. Gifts, items, gold and plans to meet follow Stardew's rules, and the mod reports the result back. A villager who asked you to the Saloon waits there, and remembers if you did not come.

The docs name one failure, called "said, not done". A small model sometimes writes "take it" and proposes no action. Yumina reads such a line once more with a small model. If the line promised an item, the mod gets the action back as rejected and applies nothing.

## Does the villager remember, and what if I load an older save?

Memory lives in the save. Every turn returns a memory id, and the mod stores the newest one in the save file. Load an older save and the villagers know only what happened up to that day. A day you never saved is not mixed in.

Limits count the same way, so an older save gives back that day's gift. The settings have a page per villager that shows what they remember, newest first, in the save's own dates.

## What does a Stardew Valley AI chat mod cost?

The modder pays nothing. There is no AI bill and no key in the build.

The player has two ways to pay. Signed in to Yumina, each turn is charged to the player's own Yumina wallet in mushies, Yumina's credits, at the model's real cost, and only when a reply arrived. Accounts get free mushies every month and more from daily quests. With their own key, the player pays their provider and Yumina charges nothing. On a local Ollama model the turn runs on the player's PC.

## How do you build it?

1. Register the mod at [yumina.io/app/developer](https://yumina.io/app/developer): kind "mod", game `steam:413150`.
2. Start the manifest from the template "Stardew Valley (Yumina kit)" and change what you like.
3. Talk to a villager under Try it, before any code.
4. Download the starter project and run `dotnet build <Project>`. It needs the .NET 6 SDK and installs into the game's Mods folder.
5. Submit for review. Until then only you and up to 50 testers can sign in.

The starter's `ModEntry.cs` is short because the kit does the rest. You write code only for inputs and actions the kit does not know:

```csharp
var valley = Valley.Start(this, new ValleyOptions { ClientId = "ym_…", Name = "My Mod" });
valley.Input("quest_board", npc => Game1.player.questLog.Count);          // an input of your own
valley.Action("teach_recipe", ctx =>                                      // an action of your own
{
    string recipe = ctx.Action.Text("recipe");
    Game1.player.cookingRecipes.TryAdd(recipe, 0);
    ctx.Report(true, "the player learned " + recipe);
});
```

Rules such as "from 2 hearts" belong in the manifest, where Yumina checks them every turn. A `packs` block in the manifest also lets players make a content pack with no code: who villagers are, what the town knows, which actions are on. A pack can only narrow what your manifest allows.

Yumina itself is free to play, build and publish. It gives every account free models with no message limit, and you can bring your own key. Memory is unlimited, up to what the model can hold. The SDK packages are Apache-2.0.

## FAQ

### Is there a Stardew Valley AI mod from Yumina on Nexus?

No. As of 4 December 2026 Yumina has published a Stardew kit, a manifest template and a starter project for mod makers, not a finished mod. A modder builds the mod, submits it for review on Yumina, and publishes it where they choose.

### Can a Stardew Valley AI chat mod run on a local model?

Yes, with the Yumina Stardew kit. The player picks a local Ollama or any OpenAI-compatible API in the mod's settings, and turns then run on the player's PC with the manifest file that ships with the mod.

### Does a Stardew Valley AI dialogue mod work with modded villagers?

A mod built on the Yumina Stardew kit does. The kit builds each villager's card from the player's installed game at runtime, so villagers added by other mods can talk too.

### What languages does the Stardew kit support?

The kit's own menus and help text are in English and Simplified Chinese, picked by the game's language. Villager cards are built in the game's language.

## Sources

- Yumina developer docs, read 4 December 2026: [Stardew Valley example](https://docs.yumina.io/developers/example-stardew), [How it works](https://docs.yumina.io/developers/concepts), [C# SDK](https://docs.yumina.io/developers/dotnet), [Any game](https://docs.yumina.io/developers/any-game), [Yumina Link](https://docs.yumina.io/developers/link).
- The Stardew manifest template and starter project in Yumina's source, and the kit's API notes shipped with `Yumina.Games.Stardew.dll`.
- [smapi.io](https://smapi.io), checked 4 December 2026: "The mod loader for Stardew Valley."
- Not verified: what other Stardew AI mods on Nexus do. This page covers only Yumina's kit.
