Characters & Social

Villagers

Access the complete dataset of Stardew Valley villagers with typed gift preferences, birthday information, and relationship details using the chainable VillagerQuery API.

Quick Start

import { villagers } from 'stardew-valley-data'

// Get all villagers
const all = villagers().get()

// Find a specific villager by name
const penny = villagers().findByName('Penny')

// Get all marriageable villagers sorted by name
const singles = villagers().marriageable().sortByName().get()

// Get villagers with birthdays in spring
const springBirthdays = villagers().byBirthdaySeason('spring').get()

Type Definition

Each villager record conforms to the Villager interface:

FieldTypeDescription
idstringUnique identifier for the villager.
namestringDisplay name of the villager.
birthday{ day: number; season: 'spring' | 'summer' | 'fall' | 'winter' }The villager's birthday, with season and day of month (1--28).
addressstringWhere the villager lives.
occupationstringThe villager's job or role.
marriageablebooleanWhether the villager can be married or become a roommate.
imagestringPath to the villager's portrait image.
spouseImagestring | undefinedPath to the spouse-specific portrait image (only present for marriageable villagers).
hearts{ max: number; bouquetIncrease: number; spouseIncrease: number }Heart progression details: maximum hearts, bonus from bouquet, and bonus from marriage.
lovesstring[]Items the villager loves receiving as gifts.
likesstring[]Items the villager likes receiving as gifts.
neutralsstring[]Items the villager is neutral about.
dislikesstring[]Items the villager dislikes receiving.
hatesstring[]Items the villager hates receiving.

Query Methods

VillagerQuery extends QueryBase and inherits five terminal methods shared by all query builders:

MethodReturnsDescription
get()Villager[]Return all results as an array.
first()Villager | undefinedReturn the first result.
find(id)Villager | undefinedFind a villager by exact ID.
findByName(name)Villager | undefinedFind a villager by name (case-insensitive).
count()numberReturn the number of results.

Filter Methods

MethodReturnsDescription
marriageable()VillagerQueryFilter to villagers who can be married or become roommates.
byBirthdaySeason(season)VillagerQueryFilter to villagers with a birthday in the given season. Accepts 'spring', 'summer', 'fall', or 'winter'.

Sort Methods

MethodReturnsDescription
sortByName(order?)VillagerQuerySort alphabetically by name. Pass 'asc' (default) or 'desc'.
sortByBirthday()VillagerQuerySort by birthday in calendar order (spring through winter, day 1 through 28).

Examples

List all marriage candidates

import { villagers } from 'stardew-valley-data'

const candidates = villagers().marriageable().sortByName().get()

candidates.forEach((v) => {
  console.log(`${v.name} — Birthday: ${v.birthday.season} ${v.birthday.day}`)
})

Find loved gifts for a villager

import { villagers } from 'stardew-valley-data'

const abigail = villagers().findByName('Abigail')

if (abigail) {
  console.log(`${abigail.name} loves: ${abigail.loves.join(', ')}`)
}

Get a birthday calendar for a season

import { villagers } from 'stardew-valley-data'

const winterBirthdays = villagers()
  .byBirthdaySeason('winter')
  .sortByBirthday()
  .get()

winterBirthdays.forEach((v) => {
  console.log(`${v.birthday.season} ${v.birthday.day}: ${v.name}`)
})

Chain filters and sorts

import { villagers } from 'stardew-valley-data'

// Marriageable villagers with spring birthdays, sorted by birthday
const results = villagers()
  .marriageable()
  .byBirthdaySeason('spring')
  .sortByBirthday()
  .get()

Wrap a pre-filtered array

You can pass an existing Villager[] array into the villagers() function to create a new query from it:

import { villagers } from 'stardew-valley-data'

const myList = villagers().marriageable().get()
const sorted = villagers(myList).sortByName('desc').get()
Previous
Artifacts