Buildings & Locations

Field Office

Access the Island Field Office fossil collection and donation data with typed reward and grouping information using the FieldOfficeQuery and FieldOfficeDonationQuery APIs.

Quick Start

import { fieldOffice, fieldOfficeDonations } from 'stardew-valley-data'

// Get all fossil collections
const allCollections = fieldOffice().get()

// Get a specific collection
const snake = fieldOffice().byCollection('snake').first()

// Get all individual donation items
const allDonations = fieldOfficeDonations().get()

// Get donations for a specific collection
const snakeBones = fieldOfficeDonations().byCollection('snake').get()

Type Definitions

FieldOfficeCollectionData

Each collection conforms to the FieldOfficeCollectionData interface:

FieldTypeDescription
idFieldOfficeCollectionCollection identifier (see below).
namestringDisplay name of the collection.
rewardFieldOfficeRewardReward for completing the collection (see below).
donationsFieldOfficeDonation[]Array of donation items in this collection.

FieldOfficeCollection

'large-animal' | 'snake' | 'mummified-frog' | 'mummified-bat'

FieldOfficeReward

FieldTypeDescription
goldenWalnutsnumberNumber of Golden Walnuts awarded.
item{ id: string; name: string; image: string } | undefinedOptional bonus item reward.

FieldOfficeDonation

Each individual donation item conforms to the FieldOfficeDonation interface:

FieldTypeDescription
idstringUnique identifier for the donation item.
namestringDisplay name of the fossil.
descriptionstringIn-game description of the fossil.
imagestringPath to the fossil image.
collectionFieldOfficeCollectionWhich collection this fossil belongs to.
quantitynumberNumber of this item needed for the donation.

Query Methods

FieldOfficeQuery

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

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

Filter Methods

MethodReturnsDescription
byCollection(id)FieldOfficeQueryFilter to a specific collection by ID.

Sort Methods

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

FieldOfficeDonationQuery

FieldOfficeDonationQuery extends QueryBase and inherits the same five terminal methods.

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

Filter Methods

MethodReturnsDescription
byCollection(id)FieldOfficeDonationQueryFilter to donations belonging to the specified collection.

Sort Methods

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

Examples

List all collections and their rewards

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

const collections = fieldOffice().get()

collections.forEach((c) => {
  const reward = c.reward.item
    ? `${c.reward.goldenWalnuts} walnuts + ${c.reward.item.name}`
    : `${c.reward.goldenWalnuts} walnuts`
  console.log(`${c.name}: ${reward}`)
})

View donations for a specific collection

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

const largeAnimal = fieldOfficeDonations().byCollection('large-animal').get()

largeAnimal.forEach((d) => {
  console.log(`${d.name} (x${d.quantity})`)
})

Count total donation items needed

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

const all = fieldOfficeDonations().get()
const totalItems = all.reduce((sum, d) => sum + d.quantity, 0)

console.log(`Total fossil items needed: ${totalItems}`)

Wrap a pre-filtered array

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

import { fieldOffice, fieldOfficeDonations } from 'stardew-valley-data'

const myCollections = fieldOffice().get()
const sorted = fieldOffice(myCollections).sortByName().get()

const myDonations = fieldOfficeDonations().byCollection('snake').get()
const sortedDonations = fieldOfficeDonations(myDonations).sortByName().get()
Previous
Golden walnuts