Buildings & Locations

Farmhouse

Access farmhouse upgrade and renovation data with typed costs, materials, and prerequisite information using the HouseUpgradeQuery and HouseRenovationQuery APIs.

Quick Start

import { houseUpgrades, houseRenovations } from 'stardew-valley-data'

// Get all farmhouse upgrade tiers
const allUpgrades = houseUpgrades().get()

// Get a specific upgrade tier
const tier2 = houseUpgrades().byTier(2).first()

// Get all renovations sorted by name
const allRenovations = houseRenovations().sortByName().get()

// Get free renovations
const freeOnes = houseRenovations().free().get()

Type Definitions

HouseUpgrade

Each farmhouse upgrade conforms to the HouseUpgrade interface:

FieldTypeDescription
idstringUnique identifier for the upgrade.
namestringDisplay name of the upgrade tier.
tiernumberSequential upgrade tier (1 through 4).
costnumberGold cost for the upgrade.
materialsHouseUpgradeMaterial[]Array of materials required (see below).
descriptionstringDescription of what the upgrade adds.
imagestringPath to the upgrade image.
prerequisitestring | nullID of the required prior upgrade, or null for the first tier.

HouseUpgradeMaterial

FieldTypeDescription
itemstringDisplay name of the material.
quantitynumberNumber of this material required.

HouseRenovation

Each renovation conforms to the HouseRenovation interface:

FieldTypeDescription
idstringUnique identifier for the renovation.
namestringDisplay name of the renovation.
costnumberGold cost for the renovation.
descriptionstringDescription of the renovation.
imagestringPath to the renovation image.
prerequisitestring | nullID of a required prior renovation, or null if none.

Query Methods

HouseUpgradeQuery

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

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

Filter Methods

MethodReturnsDescription
byTier(tier)HouseUpgradeQueryFilter to upgrades at the given tier number.

Sort Methods

MethodReturnsDescription
sortByTier(order?)HouseUpgradeQuerySort by tier. Pass 'asc' (default) or 'desc'.

HouseRenovationQuery

HouseRenovationQuery extends QueryBase and inherits the same five terminal methods.

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

Filter Methods

MethodReturnsDescription
free()HouseRenovationQueryFilter to free renovations (cost is 0).
withPrerequisite()HouseRenovationQueryFilter to renovations that require another renovation to be completed first.

Sort Methods

MethodReturnsDescription
sortByPrice(order?)HouseRenovationQuerySort by cost. Pass 'asc' (default) or 'desc'.
sortByName(order?)HouseRenovationQuerySort alphabetically by name. Pass 'asc' (default) or 'desc'.

Examples

List all upgrade tiers in order

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

const tiers = houseUpgrades().sortByTier().get()

tiers.forEach((u) => {
  console.log(`Tier ${u.tier}: ${u.name}${u.cost}g`)
})

View materials for a specific tier

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

const tier3 = houseUpgrades().byTier(3).first()

if (tier3) {
  console.log(`${tier3.name} costs ${tier3.cost}g and requires:`)
  tier3.materials.forEach((m) => {
    console.log(`  ${m.quantity}x ${m.item}`)
  })
}

Get the cheapest renovations

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

const cheapest = houseRenovations().sortByPrice().get()

cheapest.forEach((r) => {
  console.log(`${r.name}: ${r.cost}g`)
})

Find renovations with prerequisites

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

const dependent = houseRenovations().withPrerequisite().get()

dependent.forEach((r) => {
  console.log(`${r.name} requires: ${r.prerequisite}`)
})

Wrap a pre-filtered array

You can pass an existing array into the factory functions to create a new query from it:

import { houseUpgrades, houseRenovations } from 'stardew-valley-data'

const myUpgrades = houseUpgrades().get()
const sorted = houseUpgrades(myUpgrades).sortByTier('desc').get()

const myRenovations = houseRenovations().free().get()
const named = houseRenovations(myRenovations).sortByName().get()
Previous
Buildings