Parses Stardew Valley data files and extracts the crop data as JSON for use in web apps
-
Copy
Data/Crops.xnb
andData/ObjectInformation.xnb
from the Stardew Valley game folder, into this folder- macOS:
~/Library/Application Support/Steam/steamapps/common/Stardew Valley/Contents/Resources/Content
- Linux:
~/.steam/steam/steamapps/common/Stardew Valley/Content
- Windows:
C:\Programs Files\Steam\SteamApps\common\Stardew Valley\Content
- macOS:
-
Install dependencies
npm install
-
Parse the data
npm start
The parsed data is saved to
parsed-crop-data.json
The data for Parsnip is given as an example of the structure created.
{
"24": {
"name": "Parsnip",
"description": "A spring tuber closely related to the carrot. It has an earthy taste and is full of nutrients.",
"id": 24,
"category": "Basic -75",
"sellPrice": 35,
"edibility": 10,
"rowInSpriteSheet": 0,
"seasonsToGrowIn": [
"spring"
],
"phaseDays": [
1,
1,
1,
1
],
"regrowAfterHarvest": -1,
"scythe": false,
"trellis": false,
"canBeGiant": false,
"harvest": {},
"seed": {
"name": "Parsnip Seeds",
"description": "Plant these in the spring. Takes 4 days to mature.",
"id": 472,
"category": "Seeds -74",
"sellPrice": 10,
"edibility": -300,
"vendor": {
"generalStore": {
"price": 20,
"yearAvailable": 1
},
"jojaMart": {
"price": 25
},
"travelingCart": {
"minPrice": 100,
"maxPrice": 1000
}
}
},
"flowerColors": []
}
}
Crops with edibility === -300
are not consumable and thus do not restore any health or energy.
The amount of health restored by a crop is (edibility > 0) ? edibility : 0
. It is never negative.
The amount of energy restored by a crop is 2.5 * edibility
. It can sometimes be negative and remove energy.
- Basic -17: (no name displayed in game interface [Sweet Gem Berry is the only crop with this category])
- Basic -75: Vegetable
- Basic -79: Fruit
- Basic -80: Flower
- Basic -81: Forage
- Seeds -74: Seed
Category names could be added with something like the following code snippet:
const CATEGORY_NAMES = {
'Basic -17': '',
'Basic -75': 'Vegetable',
'Basic -79': 'Fruit',
'Basic -80': 'Flower',
'Basic -81': 'Forage',
'Seeds -74': 'Seed',
};
categoryName = CATEGORY_NAMES[category];
With a JojaMart membership seed prices become the same as Pierre's General Store*, which is seed.sellPrice * 2
.
* Except for Sunflower Seeds which are 125g without membership and 100g with membership, compared to 200g at the General Store