Fishing & Mining

Minerals

Access all mineral-related data in Stardew Valley including donatable minerals, geode containers, ores, smelted bars, mining nodes, and resources.

Quick Start

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

// All mineral-related items
const all = minerals().get()

// Donatable minerals only
const gems = minerals().mineralItems().get()

// Ores sorted by sell price
const ores = minerals().ores().sortBySellPrice().get()

// Items found in Frozen Geodes
const frozen = minerals().fromGeode('Frozen Geode').get()

Type Definition

Minerals use a discriminated union with six variants based on the kind field:

type Mineral =
  | MineralItem
  | GeodeContainer
  | OreItem
  | BarItem
  | NodeItem
  | ResourceItem

MineralItem

Donatable gems and geode minerals.

interface MineralItem {
  id: string
  name: string
  kind: 'mineral'
  description: string
  sellPrice: number
  gemologistPrice: number
  locations: string[]
  image: string
}
FieldTypeDescription
kind'mineral'Discriminator.
sellPricenumberBase sell price.
gemologistPricenumberSell price with the Gemologist profession.
locationsstring[]Where this mineral can be found.

GeodeContainer

Geode items that can be cracked open at the Blacksmith.

interface GeodeContainer {
  id: string
  name: string
  kind: 'geode'
  description: string
  sellPrice: number
  locations: string[]
  image: string
}

OreItem

Raw ore items found in the mines.

interface OreItem {
  id: string
  name: string
  kind: 'ore'
  description: string
  sellPrice: number
  locations: string[]
  image: string
}

BarItem

Smelted bars produced in a furnace.

interface BarItem {
  id: string
  name: string
  kind: 'bar'
  description: string
  sellPrice: number
  smeltRecipes: SmeltRecipe[]
  image: string
}

interface SmeltRecipe {
  ore: string
  oreQty: number
  coalQty: number
  timeMinutes: number
  outputQty?: number
}
FieldTypeDescription
smeltRecipesSmeltRecipe[]Smelting recipes with ore/coal quantities and time.

NodeItem

Mining nodes found in the mines and caves.

interface NodeItem {
  id: string
  name: string
  kind: 'node'
  description: string | null
  drops: NodeDrop[]
  miningXP: number
  locations: string[]
  image: string
}

interface NodeDrop {
  item: string
  quantity: string
  chance?: string
}
FieldTypeDescription
dropsNodeDrop[]Items dropped when the node is broken, with quantity and optional drop chance.
miningXPnumberMining XP gained from breaking this node.

ResourceItem

Raw materials like Coal.

interface ResourceItem {
  id: string
  name: string
  kind: 'resource'
  description: string
  sellPrice: number
  locations: string[]
  image: string
}

Common Fields

All mineral variants share these fields:

FieldTypeDescription
idstringUnique identifier.
namestringDisplay name.
kindstringDiscriminator: 'mineral', 'geode', 'ore', 'bar', 'node', or 'resource'.
imagestringPath to the image asset.

Query Methods

The minerals() function returns a MineralQuery instance. All methods return a new MineralQuery for chaining.

Inherited Methods

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

Filter Methods

MethodSignatureDescription
mineralItemsmineralItems()Filter to donatable minerals only (gems and geode minerals).
geodesgeodes()Filter to geode containers only.
oresores()Filter to ore items only.
barsbars()Filter to smelted bar items only.
nodesnodes()Filter to mining node entries only.
resourcesresources()Filter to resource items (Coal, etc.).
fromGeodefromGeode(geodeType: string)Filter to items found in a specific geode type (case-insensitive substring match).

Sort Methods

MethodSignatureDefaultDescription
sortByNamesortByName(order?: 'asc' | 'desc')'asc'Sort alphabetically by name.
sortBySellPricesortBySellPrice(order?: 'asc' | 'desc')'desc'Sort by sell price (highest first). Items without a sell price (nodes) sort as 0.

Examples

Most valuable donatable minerals

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

const valuable = minerals().mineralItems().sortBySellPrice().get().slice(0, 10)

valuable.forEach((m) => {
  console.log(
    `${m.name}: ${m.sellPrice}g (${m.gemologistPrice}g with Gemologist)`,
  )
})

Smelting recipes for all bars

const bars = minerals().bars().get()

bars.forEach((bar) => {
  bar.smeltRecipes.forEach((recipe) => {
    console.log(
      `${bar.name}: ${recipe.oreQty} ${recipe.ore} + ${recipe.coalQty} Coal (${recipe.timeMinutes} min)`,
    )
  })
})

Items from Omni Geodes

const omniItems = minerals().fromGeode('Omni Geode').sortByName().get()
console.log(`${omniItems.length} items from Omni Geodes`)

Mining node drops

const nodes = minerals().nodes().get()

nodes.forEach((node) => {
  console.log(`${node.name} (${node.miningXP} XP):`)
  node.drops.forEach((d) => {
    console.log(`  ${d.item} x${d.quantity}${d.chance ? ` (${d.chance})` : ''}`)
  })
})
Previous
Bait & tackle