Buildings & Locations

Golden Walnuts

Access the complete dataset of Ginger Island Golden Walnuts with typed location, hint, and tracking information using the chainable GoldenWalnutQuery API.

Quick Start

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

// Get all golden walnut sources
const all = goldenWalnuts().get()

// Find walnuts at a specific location
const volcanoWalnuts = goldenWalnuts().byLocation('Volcano').get()

// Get the total walnut count
const total = goldenWalnuts().totalAmount()

// Get walnuts sorted by amount (most first)
const byAmount = goldenWalnuts().sortByAmount('desc').get()

Type Definition

Each golden walnut record conforms to the GoldenWalnut interface:

FieldTypeDescription
idstringUnique identifier for the walnut source.
namestringDescription of how to obtain the walnut(s).
amountnumberNumber of walnuts awarded from this source.
locationstringWhere the walnut(s) can be found on Ginger Island.
hintstringIn-game hint for finding the walnut(s).
trackingTypeGoldenWalnutTrackingTypeHow the game tracks collection (see below).

GoldenWalnutTrackingType

ValueDescription
'all-at-once'All walnuts from this source are collected at once.
'limited'Walnuts are collected individually up to a limit.
'extra'Extra walnuts beyond the standard collection.

Query Methods

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

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

Filter Methods

MethodReturnsDescription
byLocation(location)GoldenWalnutQueryFilter by location (case-insensitive substring match).
byTrackingType(type)GoldenWalnutQueryFilter by tracking type. Accepts 'all-at-once', 'limited', or 'extra'.

Sort Methods

MethodReturnsDescription
sortByLocation(order?)GoldenWalnutQuerySort alphabetically by location. Pass 'asc' (default) or 'desc'.
sortByAmount(order?)GoldenWalnutQuerySort by walnut amount. Pass 'desc' (default) or 'asc'.

Aggregate Methods

MethodReturnsDescription
totalAmount()numberTotal number of walnuts across all entries in the current query.

Examples

Get the total walnut count on the island

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

const total = goldenWalnuts().totalAmount()
console.log(`Total Golden Walnuts: ${total}`)

List walnuts by location

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

const volcano = goldenWalnuts().byLocation('Volcano').get()

volcano.forEach((w) => {
  console.log(`${w.name}${w.amount} walnut(s)`)
})

Find all limited-tracking walnuts

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

const limited = goldenWalnuts()
  .byTrackingType('limited')
  .sortByAmount('desc')
  .get()

limited.forEach((w) => {
  console.log(`${w.name}: ${w.amount} (${w.location})`)
})

Get a summary by tracking type

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

const types = ['all-at-once', 'limited', 'extra']

types.forEach((type) => {
  const query = goldenWalnuts().byTrackingType(type)
  console.log(
    `${type}: ${query.count()} sources, ${query.totalAmount()} walnuts`,
  )
})

Wrap a pre-filtered array

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

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

const myList = goldenWalnuts().byLocation('Dig Site').get()
const sorted = goldenWalnuts(myList).sortByAmount('desc').get()
Previous
Maps