Farming & Foraging

Trees

Access fruit tree and wild tree data including produce, tapper products, sapling prices, and growth stages.

Quick Start

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

// Get all trees
const allTrees = trees().get()

// Only fruit trees
const fruitTrees = trees().fruitTrees().get()

// Wild trees you can tap
const tappable = trees().tappable().get()

Type Definition

Trees use a discriminated union based on the type field. The top-level type is Tree = FruitTree | WildTree.

FruitTree

interface FruitTree {
  type: 'fruit-tree'
  id: string
  name: string
  saplingId: string
  saplingName: string
  saplingBuyPrices: SeedBuyPrice[]
  saplingSellPrice: number
  seasons: Season[]
  daysToMature: number
  description: string
  image: string
  saplingImage: string
  stages: Stage[]
  produce: FruitTreeProduce
}

interface FruitTreeProduce {
  id: string
  name: string
  sellPrice: number
  image: string
  energyHealth?: EnergyHealth
}
FieldTypeDescription
type'fruit-tree'Discriminator for fruit trees.
idstringUnique identifier.
namestringTree name (e.g. "Peach Tree").
saplingIdstringID of the sapling item.
saplingNamestringDisplay name of the sapling.
saplingBuyPricesSeedBuyPrice[]Array of { place, price } for sapling purchase locations.
saplingSellPricenumberSell price of the sapling.
seasonsSeason[]Seasons the tree produces fruit.
daysToMaturenumberDays for the sapling to become a mature tree.
descriptionstringIn-game description.
imagestringPath to tree image asset.
saplingImagestringPath to sapling image asset.
stagesStage[]Growth stage images.
produceFruitTreeProduceThe fruit this tree produces, with sell price and optional energy/health data.

WildTree

interface WildTree {
  type: 'wild-tree'
  id: string
  name: string
  seedId: string
  seedName: string
  description: string
  image: string
  seedImage: string
  stages: Stage[]
  tapper?: WildTreeTapper
}

interface WildTreeTapper {
  id: string
  name: string
  sellPrice: number
  image: string
  energyHealth?: EnergyHealth
}
FieldTypeDescription
type'wild-tree'Discriminator for wild trees.
idstringUnique identifier.
namestringTree name (e.g. "Oak Tree").
seedIdstringID of the seed dropped by this tree.
seedNamestringDisplay name of the seed.
descriptionstringIn-game description.
imagestringPath to tree image asset.
seedImagestringPath to seed image asset.
stagesStage[]Growth stage images.
tapperWildTreeTapper | undefinedProduct obtained when a tapper is placed on this tree.

Query Methods

The trees() function returns a TreeQuery instance. All methods return a new TreeQuery for chaining.

Inherited Methods

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

Filter Methods

MethodSignatureDescription
fruitTreesfruitTrees()Filter to fruit trees only.
wildTreeswildTrees()Filter to wild trees only.
bySeasonbySeason(season: Season)Filter fruit trees by producing season. Wild trees are excluded.
tappabletappable()Filter to wild trees that can be tapped.

Sort Methods

MethodSignatureDefaultDescription
sortByProduceSellPricesortByProduceSellPrice(order?: 'asc' | 'desc')'desc'Sort by produce sell price. Uses produce.sellPrice for fruit trees and tapper.sellPrice for wild trees (0 if untappable).

Examples

Most valuable fruit trees

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

const valuable = trees().fruitTrees().sortByProduceSellPrice().get()

valuable.forEach((t) => {
  console.log(`${t.name}: ${t.produce.sellPrice}g per fruit`)
})

Summer-producing fruit trees

const summerFruit = trees().bySeason('summer').get()

All tappable wild trees

const tapped = trees().tappable().get()

tapped.forEach((t) => {
  if (t.type === 'wild-tree' && t.tapper) {
    console.log(`${t.name} produces ${t.tapper.name} (${t.tapper.sellPrice}g)`)
  }
})

Find a tree by name

const oak = trees().findByName('Oak Tree')
Previous
Crops