Shops

Wizard's Tower

Access the complete list of the Wizard's magical constructions with build cost and material data using the chainable WizardQuery API.

Quick Start

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

// Get all wizard buildings
const all = wizard().get()

// Sort by build cost
const sorted = wizard().sortByCost().get()

// Find a specific building
const building = wizard().findByName('Junimo Hut')

Type Definitions

WizardBuilding

Each building conforms to the WizardBuilding interface:

FieldTypeDescription
idstringUnique identifier.
namestringDisplay name of the building.
buildCostnumberGold cost to build.
materialsWizardBuildingMaterial[]Array of materials required for construction.
descriptionstringIn-game description text.
imagestringPath to the building's image.
availabilitystring | undefinedSpecial availability condition, if any.

WizardBuildingMaterial

Each material requirement conforms to the WizardBuildingMaterial interface:

FieldTypeDescription
itemIdstringID of the required material item.
itemNamestringDisplay name of the material.
amountnumberQuantity of the material required.
imagestringPath to the material's image.

Query Methods

WizardQuery extends QueryBase and inherits five terminal methods:

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

Filter Methods

MethodReturnsDescription
alwaysAvailable()WizardQueryFilter to buildings with no special availability condition.

Sort Methods

MethodReturnsDescription
sortByCost(order?)WizardQuerySort by build cost. Pass 'asc' (default) or 'desc'.
sortByName(order?)WizardQuerySort alphabetically by name. Pass 'asc' (default) or 'desc'.

Examples

List all buildings with costs and materials

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

wizard()
  .sortByCost()
  .get()
  .forEach((building) => {
    console.log(`${building.name} - ${building.buildCost}g`)
    building.materials.forEach((mat) => {
      console.log(`  ${mat.amount}x ${mat.itemName}`)
    })
  })

Find the cheapest building

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

const cheapest = wizard().sortByCost().first()

if (cheapest) {
  console.log(`${cheapest.name} is the cheapest at ${cheapest.buildCost}g`)
  console.log('Materials needed:')
  cheapest.materials.forEach((mat) => {
    console.log(`  ${mat.amount}x ${mat.itemName}`)
  })
}

Calculate total material costs

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

wizard()
  .get()
  .forEach((building) => {
    const materialList = building.materials
      .map((m) => `${m.amount}x ${m.itemName}`)
      .join(', ')
    console.log(`${building.name}: ${building.buildCost}g + ${materialList}`)
  })
Previous
Willy's fish shop