Difference between revisions of "Modding:Items"
Margotbean (talk | contribs) (space) |
(add some properties of categories based on decompiled source code) |
||
Line 91: | Line 91: | ||
! [[#Context tags|context tag]] | ! [[#Context tags|context tag]] | ||
! English translation | ! English translation | ||
+ | ! Properties | ||
|- | |- | ||
| -2 | | -2 | ||
Line 96: | Line 97: | ||
| <samp>category_gem</samp> | | <samp>category_gem</samp> | ||
| Mineral | | Mineral | ||
+ | | Affected by [[Gemologist]] profession | ||
|- | |- | ||
| -4 | | -4 | ||
Line 101: | Line 103: | ||
| <samp>category_fish</samp> | | <samp>category_fish</samp> | ||
| Fish | | Fish | ||
+ | | Affected by [[Fisher]] and [[Angler]] professions | ||
|- | |- | ||
| -5 | | -5 | ||
Line 106: | Line 109: | ||
| <samp>category_egg</samp> | | <samp>category_egg</samp> | ||
| Animal Product | | Animal Product | ||
+ | | Affected by [[Rancher]] profession, can be used in a slingshot | ||
|- | |- | ||
| -6 | | -6 | ||
Line 111: | Line 115: | ||
| <samp>category_milk</samp> | | <samp>category_milk</samp> | ||
| Animal Product | | Animal Product | ||
+ | | Affected by [[Rancher]] profession | ||
|- | |- | ||
| -7 | | -7 | ||
Line 116: | Line 121: | ||
| <samp>category_cooking</samp> | | <samp>category_cooking</samp> | ||
| Cooking | | Cooking | ||
+ | | | ||
|- | |- | ||
| -8 | | -8 | ||
Line 121: | Line 127: | ||
| <samp>category_crafting</samp> | | <samp>category_crafting</samp> | ||
| Crafting | | Crafting | ||
+ | | Is Placeable | ||
|- | |- | ||
| -9 | | -9 | ||
Line 126: | Line 133: | ||
| <samp>category_big_craftable</samp> | | <samp>category_big_craftable</samp> | ||
| | | | ||
+ | | Is Placeable | ||
|- | |- | ||
| -12 | | -12 | ||
Line 131: | Line 139: | ||
| <samp>category_minerals</samp> | | <samp>category_minerals</samp> | ||
| Mineral | | Mineral | ||
+ | | Affected by [[Gemologist]] profession | ||
|- | |- | ||
| -14 | | -14 | ||
Line 136: | Line 145: | ||
| <samp>category_meat</samp> | | <samp>category_meat</samp> | ||
| Animal Product | | Animal Product | ||
+ | | | ||
|- | |- | ||
| -15 | | -15 | ||
Line 141: | Line 151: | ||
| <samp>category_metal_resources</samp> | | <samp>category_metal_resources</samp> | ||
| Resource | | Resource | ||
+ | | | ||
|- | |- | ||
| -16 | | -16 | ||
Line 146: | Line 157: | ||
| <samp>category_building_resources</samp> | | <samp>category_building_resources</samp> | ||
| Resource | | Resource | ||
+ | | | ||
|- | |- | ||
| -17 | | -17 | ||
Line 151: | Line 163: | ||
| <samp>category_sell_at_pierres</samp> | | <samp>category_sell_at_pierres</samp> | ||
| | | | ||
+ | | | ||
|- | |- | ||
| -18 | | -18 | ||
Line 156: | Line 169: | ||
| <samp>category_sell_at_pierres_and_marnies</samp> | | <samp>category_sell_at_pierres_and_marnies</samp> | ||
| Animal Product | | Animal Product | ||
+ | | Affected by [[Rancher]] profession | ||
|- | |- | ||
| -19 | | -19 | ||
Line 161: | Line 175: | ||
| <samp>category_fertilizer</samp> | | <samp>category_fertilizer</samp> | ||
| Fertilizer | | Fertilizer | ||
+ | | Is Placeable, is always passable | ||
|- | |- | ||
| -20 | | -20 | ||
Line 166: | Line 181: | ||
| <samp>category_junk</samp> | | <samp>category_junk</samp> | ||
| Trash | | Trash | ||
+ | | | ||
|- | |- | ||
| -21 | | -21 | ||
Line 171: | Line 187: | ||
| <samp>category_bait</samp> | | <samp>category_bait</samp> | ||
| Bait | | Bait | ||
+ | | Can be attached to a fishing rod | ||
|- | |- | ||
| -22 | | -22 | ||
Line 176: | Line 193: | ||
| <samp>category_tackle</samp> | | <samp>category_tackle</samp> | ||
| Fishing Tackle | | Fishing Tackle | ||
+ | | Can be attached to a fishing rod, cannot stack | ||
|- | |- | ||
| -23 | | -23 | ||
Line 181: | Line 199: | ||
| <samp>category_sell_at_fish_shop</samp> | | <samp>category_sell_at_fish_shop</samp> | ||
| | | | ||
+ | | | ||
|- | |- | ||
| -24 | | -24 | ||
Line 186: | Line 205: | ||
| <samp>category_furniture</samp> | | <samp>category_furniture</samp> | ||
| Decor | | Decor | ||
+ | | | ||
|- | |- | ||
| -25 | | -25 | ||
Line 191: | Line 211: | ||
| <samp>category_ingredients</samp> | | <samp>category_ingredients</samp> | ||
| Cooking | | Cooking | ||
+ | | | ||
|- | |- | ||
| -26 | | -26 | ||
Line 196: | Line 217: | ||
| <samp>category_artisan_goods</samp> | | <samp>category_artisan_goods</samp> | ||
| Artisan Goods | | Artisan Goods | ||
+ | | Affected by [[Artisan]] profession | ||
|- | |- | ||
| -27 | | -27 | ||
Line 201: | Line 223: | ||
| <samp>category_syrup</samp> | | <samp>category_syrup</samp> | ||
| Artisan Goods | | Artisan Goods | ||
+ | | Affected by [[Tapper]] profession | ||
|- | |- | ||
| -28 | | -28 | ||
Line 206: | Line 229: | ||
| <samp>category_monster_loot</samp> | | <samp>category_monster_loot</samp> | ||
| Monster Loot | | Monster Loot | ||
+ | | | ||
|- | |- | ||
| -29 | | -29 | ||
Line 211: | Line 235: | ||
| <samp>category_equipment</samp> | | <samp>category_equipment</samp> | ||
| | | | ||
+ | | | ||
|- | |- | ||
| -74 | | -74 | ||
Line 216: | Line 241: | ||
| <samp>category_seeds</samp> | | <samp>category_seeds</samp> | ||
| Seed | | Seed | ||
+ | | Is Placeable, is always passable | ||
|- | |- | ||
| -75 | | -75 | ||
Line 221: | Line 247: | ||
| <samp>category_vegetable</samp> | | <samp>category_vegetable</samp> | ||
| Vegetable | | Vegetable | ||
+ | | Affected by [[Tiller]] profession, can be used in a slingshot | ||
|- | |- | ||
| -79 | | -79 | ||
Line 226: | Line 253: | ||
| <samp>category_fruits</samp> | | <samp>category_fruits</samp> | ||
| Fruit | | Fruit | ||
+ | | Affected by [[Tiller]] profession (if not foraged), can be used in a slingshot | ||
|- | |- | ||
| -80 | | -80 | ||
Line 231: | Line 259: | ||
| <samp>category_flowers</samp> | | <samp>category_flowers</samp> | ||
| Flower | | Flower | ||
+ | | Affected by [[Tiller]] profession | ||
|- | |- | ||
| -81 | | -81 | ||
Line 236: | Line 265: | ||
| <samp>category_greens</samp> | | <samp>category_greens</samp> | ||
| Forage | | Forage | ||
+ | | | ||
|- | |- | ||
| -95 | | -95 | ||
Line 241: | Line 271: | ||
| <samp>category_hat</samp> | | <samp>category_hat</samp> | ||
| | | | ||
+ | | | ||
|- | |- | ||
| -96 | | -96 | ||
Line 246: | Line 277: | ||
| <samp>category_ring</samp> | | <samp>category_ring</samp> | ||
| | | | ||
+ | | | ||
|- | |- | ||
| -98 | | -98 | ||
Line 251: | Line 283: | ||
| <samp>category_weapon</samp> | | <samp>category_weapon</samp> | ||
| | | | ||
+ | | | ||
|- | |- | ||
| -99 | | -99 | ||
Line 256: | Line 289: | ||
| <samp>category_tool</samp> | | <samp>category_tool</samp> | ||
| | | | ||
+ | | | ||
|} | |} | ||
Revision as of 21:26, 28 March 2023
← Index
This page explains how the game stores and parses item data. This is an advanced guide for mod developers.
Introduction
Overview
Items are divided into several types:
type | summary |
---|---|
objects | The default type for items in inventories or placed in the world. |
big craftables | Craftable items which can be placed in the world and are two tiles tall. |
boots | Items that can be equipped in the player's footwear slot. |
clothing | Cosmetic items that can be equipped in the player's pants and shirt slots. |
furniture | Decorative items which can be placed in the world, including chairs which the player can sit on. |
hats | Items that can be equipped in the player's hat slot. |
tools | Items that can be swung or used by the player to perform some effect. |
weapons | Tools that can be used by the player to damage monsters. |
For each item type, the game has two files in its Content folder (which can be unpacked for editing):
- a data asset for the text data for its items (names, descriptions, prices, etc);
- and a spritesheet for the in-game item icons.
Each item has a ParentSheetIndex field which is its position in the item type's spritesheet, starting at 0 in the top-left and incrementing by one as you move across and then down. For example, hat #0 is the first sprite in Characters/Farmer/hats. The ParentSheetIndex is also used to identify the item itself; since spritesheet indexes aren't unique (e.g., there's both a hat #10 and object #10), code needs to check the type too like item is Weapon weapon && weapon.ParentSheetIndex == 4
.
Flooring and wallpaper are not in any of these types and are not currently documented in this wiki.
See the sections below for details on each item type.
Get a list of items
With SMAPI installed, you can run the list_items console command in-game to view/search items and their IDs.
Define a custom item
Every item must be assigned a unique ParentSheetIndex within its type, and that index must fit within the item type's spritesheet.
Adding custom items to the data assets and spritesheets directly is not recommended, since it's very easy to conflict with other mods or cause game errors. Instead you should create a content pack for Json Assets, which coordinates dynamic item ID assignment so multiple custom item mods can work together.
Common data
Quality
Each item has a quality level which (depending on the item type) may affect its price, health boost, etc. The valid qualities are:
quality | value | constant |
---|---|---|
normal | 0 | Object.lowQuality |
silver | 1 | Object.medQuality |
gold | 2 | Object.highQuality |
iridium | 4 | Object.bestQuality |
Categories
Each item also has a category (represented by a negative integer). In code, you can get an item's category value from item.Category, and its translated name from item.getCategoryName(). Here are the valid categories:
value | internal constant | context tag | English translation | Properties |
---|---|---|---|---|
-2 | Object.GemCategory | category_gem | Mineral | Affected by Gemologist profession |
-4 | Object.FishCategory | category_fish | Fish | Affected by Fisher and Angler professions |
-5 | Object.EggCategory | category_egg | Animal Product | Affected by Rancher profession, can be used in a slingshot |
-6 | Object.MilkCategory | category_milk | Animal Product | Affected by Rancher profession |
-7 | Object.CookingCategory | category_cooking | Cooking | |
-8 | Object.CraftingCategory | category_crafting | Crafting | Is Placeable |
-9 | Object.BigCraftableCategory | category_big_craftable | Is Placeable | |
-12 | Object.mineralsCategory | category_minerals | Mineral | Affected by Gemologist profession |
-14 | Object.meatCategory | category_meat | Animal Product | |
-15 | Object.metalResources | category_metal_resources | Resource | |
-16 | Object.buildingResources | category_building_resources | Resource | |
-17 | Object.sellAtPierres | category_sell_at_pierres | ||
-18 | Object.sellAtPierresAndMarnies | category_sell_at_pierres_and_marnies | Animal Product | Affected by Rancher profession |
-19 | Object.fertilizerCategory | category_fertilizer | Fertilizer | Is Placeable, is always passable |
-20 | Object.junkCategory | category_junk | Trash | |
-21 | Object.baitCategory | category_bait | Bait | Can be attached to a fishing rod |
-22 | Object.tackleCategory | category_tackle | Fishing Tackle | Can be attached to a fishing rod, cannot stack |
-23 | sellAtFishShopCategory | category_sell_at_fish_shop | ||
-24 | Object.furnitureCategory | category_furniture | Decor | |
-25 | Object.ingredientsCategory | category_ingredients | Cooking | |
-26 | Object.artisanGoodsCategory | category_artisan_goods | Artisan Goods | Affected by Artisan profession |
-27 | Object.syrupCategory | category_syrup | Artisan Goods | Affected by Tapper profession |
-28 | Object.monsterLootCategory | category_monster_loot | Monster Loot | |
-29 | Object.equipmentCategory | category_equipment | ||
-74 | Object.SeedsCategory | category_seeds | Seed | Is Placeable, is always passable |
-75 | Object.VegetableCategory | category_vegetable | Vegetable | Affected by Tiller profession, can be used in a slingshot |
-79 | Object.FruitsCategory | category_fruits | Fruit | Affected by Tiller profession (if not foraged), can be used in a slingshot |
-80 | Object.flowersCategory | category_flowers | Flower | Affected by Tiller profession |
-81 | Object.GreensCategory | category_greens | Forage | |
-95 | Object.hatCategory | category_hat | ||
-96 | Object.ringCategory | category_ring | ||
-98 | Object.weaponCategory | category_weapon | ||
-99 | Object.toolCategory | category_tool |
Console commands |
---|
With the Console Code mod installed, you can run this command in the SMAPI console to see a list of objects by category:
cs return string.Join(`\n`, Game1.objectInformation.Keys.Select(key => new StardewValley.Object(key, 1)).GroupBy(item => item.Category, item => item.Name).OrderByDescending(p => p.Key).Select(p => $`{p.Key}: {string.Join(`, `, p.OrderBy(name => name))}`)); |
Context tags
A context tag is an arbitrary data label attached to items. These can produce various effects in-game, or may be informational only.
The game generates some tags based on the game data (like the item quality), and others are defined in the Data/ObjectContextTags data asset (which consists of a string→string dictionary, where the key is the item's internal name or the alternative ID matching the id_<type>
_<identifier>
tag, and the value is a comma-delimited list of tags to add).
Here's an incomplete list of context tags added or used in the base game. Mods can add custom context tags, which aren't listed here.
- Added automatically for all items:
-
context tag effect category_ <category>
Added automatically based on the item category. See the 'context tag' column in the item category list for possible values. fish_ <metadata>
Added automatically for a fish item based on its metadata in Data/Fish. For crab pot fish (i.e. those with type trap):
context tag notes fish_trap_location_ <water type>
Based on field 2 ('darting randomness'). For example, fish_trap_location_ocean. For fishing rod fish (i.e. those whose type is not trap):
context tag notes fish_difficulty_ <difficulty>
Based on field 1 ('chance to dart'), where <difficulty>
is one of easy (0–33), medium (34–66), hard (67–100), or extremely_hard (101+). For example, fish_difficulty_hard.fish_motion_ <motion>
Based on field 4 ('location'). For example, fish_motion_floater. fish_favor_weather_ <weather>
Based on field 7 ('weather'). For example, fish_favor_weather_sunny. id_ <type>
_<identifier>
Added automatically as an alternative ID. The <type>
is one of B (boots), BBL (big craftable recipe), BL (object recipe), BO (big craftable), C (clothing), F (furniture), H (hat), O (object), R (ring), W (melee weapon), else blank. The<identifier>
is the item's parent sheet index. For example, pufferfish has value id_o_128 (object #128).item_ <name>
Added automatically based on the item name. The name is trimmed, lowercase, with spaces replaced with underscores, and with single quotes removed. For example, '1000 Years From Now' has context tag item_1000_years_from_now. - Added automatically for object-type items:
-
context tag effect jelly_item
juice_item
pickle_item
wine_itemFor items produced by the keg or preserves jar, the preserved item type. preserve_sheet_index_ <id>
For items produced by the keg or preserves jar, the parent sheet index for the original item that was produced. For example, blueberry wine has preserve_sheet_index_258, where 258 is the blueberry item's index. quality_none
quality_silver
quality_gold
quality_iridiumAdded automatically based on the item quality. quality_qi Added automatically for items cooked while the Qi's Cuisine special order is active. - Context tags from Data/ObjectContextTags:
-
context tag effect color_* The color produced by this item when the player dyes clothing at Emily's house. The context tag only affects which of the six color dye pots it can be placed in; for example, color_red and color_dark_red are both placed in the red pot, but they don't produce different colors. dye pot context tags red color_red, color_salmon, color_dark_red, color_pink orange color_orange, color_dark_orange, color_dark_brown, color_brown, color_copper yellow color_yellow, color_dark_yellow, color_gold, color_sand green color_green, color_dark_green, color_lime, color_yellow_green, color_jade blue color_blue, color_dark_blue, color_dark_cyan, color_light_cyan, color_cyan, color_aquamarine purple color_purple, color_dark_purple, color_dark_pink, color_pale_violet_red, color_poppyseed, color_iridium
Some game data also references context tags in a generic way. For example, you can add custom tags for an item to Data/ObjectContextTags, then reference them in the fish pond data. Specifically:
game data | effects |
---|---|
fish ponds | In Data/FishPondData, used to match fish that can be placed in the pond (see RequiredTags in the fish pond data). |
special orders | In Data/SpecialOrders, used to match items that meet the quest objectives (see AcceptedContextTags in the special order data). |
tailoring | In Data/TailoringRecipes, used to match items that are needed for a recipe. |
gift tastes | In Data/NPCGiftTastes, used to set character likes and dislike for every item using the context tag. |
The debug listtags console command lists all the tags of the item being held.
raw tag dump |
---|
Here's a list of context tags extracted from Data/ObjectContextTags that aren't listed above yet: alcohol_item, algae_item, ancient_item, beach_item, bomb_item, bone_item, book_item, ceramic_item, chicken_item, color_black, color_dark_gray, color_gray, color_iron, color_prismatic, color_white, cooking_item, cow_milk_item, cowboy_item, crop_year_2, dinosaur_item, doll_item, drink_item, dwarvish_item, dye_medium, dye_strong, egg_item, elvish_item, fertilizer_item, fish_bug_lair, fish_carnivorous, fish_crab_pot, fish_desert, fish_freshwater, fish_lake, fish_legendary, fish_mines, fish_night_market, fish_nonfish, fish_ocean, fish_pond, fish_river, fish_secret_pond, fish_semi_rare, fish_sewers, fish_swamp, fish_talk_demanding, fish_talk_rude, fish_talk_stiff, fish_upright, flower_item, food_bakery, food_breakfast, food_cake, food_party, food_pasta, food_salad, food_sauce, food_seafood, food_soup, food_spicy, food_sushi, food_sweet, forage_item, forage_item_beach, forage_item_cave, forage_item_desert, forage_item_mines, forage_item_secret, fossil_item, fruit_item, fruit_tree_item, furnace_item, ginger_item, goat_milk_item, golden_relic_item, honey_item, hunting_item, instrument_item, jelly_item, juice_item, large_egg_item, large_milk_item, light_source, machine_item, marine_item, mayo_item, medicine_item, milk_item, noble_item, ore_item, pickle_item, potion_item, prehistoric_item, quality_fertilizer_item, scroll_item, season_all, season_fall, season_spring, season_summer, season_winter, slime_egg_item, slime_item, statue_item, strange_doll_1, strange_doll_2, syrup_item, totem_item, toy_item, trash_item, tree_seed_item, wood_item. |
Objects
Objects are the default type for items in inventories or placed in the world.
They have their data in Data/ObjectInformation, their icon sprites in Maps/springobjects, and their code in StardewValley.Object. See a table of sprites and their corresponding indexes.
Data format
The object data in Data/ObjectInformation consists of an integer→string dictionary with entries like this:
"18": "Daffodil/30/0/Basic -81/Daffodil/A traditional spring flower that makes a nice gift."
For each entry in the data asset:
- The key (before the colon) is the item ID and its sprite index within the object spritesheet (saved as ParentSheetIndex in-code).
- The value (after the colon) is a slash-delimited string with the fields listed below. Fields 0–5 are used by most object; fields 6–11 are only used for a select few items. The objects with keys 516–534 (Ring.ringLowerIndexRange through Ring.ringUpperIndexRange) and 801 (wedding ring) are hardcoded as rings.
index | field | effect | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
all objects | ||||||||||||||||||||||||||||
0 | name | The internal item name (and display name in English). | ||||||||||||||||||||||||||
1 | price | The gold price of the item when sold by the player. This is not the price when bought from a shop. | ||||||||||||||||||||||||||
2 | edibility | A numeric value that determines how much energy (edibility × 2.5) and health (edibility × 1.125) is restored. An item with an edibility of -300 can't be eaten, values from -299 to -1 reduce health & energy, and zero can be eaten but doesn't change health/energy.
This is ignored for rings. | ||||||||||||||||||||||||||
3 | type and category |
This is the item's type (string) and, in most cases, a category (negative integer), separated by a space like Fish -4. For some types the category is omitted. While categories are frequently referenced in other parts of the game, types appear to be apocryphal data from early in the game's development. As such, some of them are not very well understood. The types used in Data/ObjectInformation and their purposes (as is currently understood) are as follows:
| ||||||||||||||||||||||||||
4 | display name | The translated item name (not used when playing in English). | ||||||||||||||||||||||||||
5 | description | The translated item description. | ||||||||||||||||||||||||||
miscellaneous | ||||||||||||||||||||||||||||
6 | miscellaneous |
| ||||||||||||||||||||||||||
7 | miscellaneous 2 |
| ||||||||||||||||||||||||||
8 | buff duration | How long the buffs provided by the previous field last, measured in real seconds (assuming the default time speed). The buff duration number shown in-game will always be one second less than the calculated value. |
Notes
- Items that have a number in index 6 (the "Crafting" field) show buggy information in-game (e.g., Bean Hotpot prior to version 1.4). Items that have a number in the "Attack" field display the Attack icon and a number, but no description. It's unclear how these buffs work (if at all).
- Adding custom items with the Arch type is inadvisable as it often leads to Artifact Spots becoming broken and not giving any items.
- Named buffs (like Oil of Garlic, Life Elixir, or Tipsy) are implemented in code and can't be set in the food buff fields.
- The spritesheet and data have items that can't normally be found in the player inventory (like twigs and lumber), and some sprites have no corresponding item data. There are also multiple entries for weeds and stone corresponding to different sprites, but the player can only normally obtain one stone item (index 390) and no weeds items.
Big craftables
Big craftables are objects which can be placed in the world and are two tiles tall (instead of one like objects).
They have their data in Data/BigCraftableInformation, their in-game sprites in TileSheets/Craftables, and their code in StardewValley.Object (with the bigCraftable.Value = true
flag).
Data format
The big craftables data in Data/BigCraftableInformation consists of an integer→string dictionary with entries like this:
"19": "Oil Maker/50/-300/Crafting -9/Makes gourmet truffle oil./true/true/0/Oil Maker"
For each entry in the data asset, the key is the item's ParentSheetIndex and the value is a slash-delimited string with these fields:
index | field | effect | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
0 | name | The internal item name (and display name in English). | ||||||||
1 | price | The gold price when sold by the player. | ||||||||
2 | edibility | See edibility for object data. Always set to -300 (inedible) for vanilla items. | ||||||||
3 | type and category | See type and category for object data. Always set to Crafting -9 for vanilla items. | ||||||||
4 | description | The translated item description shown in-game. | ||||||||
5 | outdoors | Whether the item can be placed outdoors (true or false). | ||||||||
6 | indoors | Whether the item can be placed indoors (true or false). | ||||||||
7 | fragility | How the item is removed by tools. Possible values:
| ||||||||
8 | is lamp | Whether the item is a lamp and produces light when it's dark. This can be true (mark as lamp) or any other value (ignored). | ||||||||
9 | display name | The translated display name (in non-English assets only). |
Notes
- Many of the items in the data asset aren't implemented in-game. They may be completely absent from the game, or they may be unused as craftables and instead appear in object data or furniture data.
Boots
Boots are items that can be equipped in the player's footwear slot.
They have their data in Data/Boots, their in-game sprites in Maps/springobjects (item sprite) and Characters/Farmer/shoeColors (shoe color), and their code in StardewValley.Objects.Boots.
Data format
The boots data in Data/Boots consists of an integer→string dictionary with entries like this:
"511": "Dark Boots/Made from thick black leather./250/4/2/7"
For each entry in the data asset, the key is the item's ParentSheetIndex and the value is a slash-delimited string with these fields:
index | field | effect |
---|---|---|
0 | name | The internal item name (and display name in English). |
1 | description | The translated item description shown in-game. |
2 | price | Unused. The actual price is calculated as (added defence × 100) + (added immunity × 100). |
3 | added defense | A defense bonus applied to the player while equipped. |
4 | added immunity | An immunity bonus applied to the player while equipped. |
5 | color index | The index of the boot color in the Characters/Farmer/shoeColors spritesheet. |
6 | display name | The translated item name shown in-game (for non-English assets only). |
Clothing
Clothing consists of cosmetic items that can be equipped in the player's pants and shirt slots.
They have their data in Data/ClothingInformation, their in-game sprites in Characters/Farmer/pants & Characters/Farmer/shirts, and their code in StardewValley.Objects.Clothing.
Data format
The clothing data in Data/ClothingInformation consists of an integer→string dictionary with entries like this:
"1282": "Tomato Shirt/Tomato Shirt/A shirt that answers the big question: 'Tomatoes are'... (but the rest is smudged)./282/-1/50/255 0 0/false/Shirt/Sleeveless"
For each entry in the data asset, the key is the item's ParentSheetIndex (offset by 1000 for shirts) and the value is a slash-delimited string with these fields:
index | field | effect |
---|---|---|
0 | name | The internal item name (and display name in English). |
1 | display name | The translated item name shown in-game. |
2 | description | The translated item description shown in-game. |
3 | male index | The sprite index in the clothing spritesheet for male characters. |
4 | female index | The sprite index in the clothing spritesheet for female characters, or -1 to use the male index. |
5 | price | The price when purchased from shops. |
6 | default color | The default color, specified in space-delimited RGB with each channel being an integer from 0 (no color) to 255 (full color). For example, 255 0 0 for full red. |
7 | dyeable | Whether the clothing can be dyed (true or false). |
8 | Type | The clothing type. One of Pants, Shirt, or |
9 | extra data | A comma-delimited list of tags attached to the item (unrelated to context tags). The values recognized by the game are Prismatic (adds a shifting rainbow effect) and Sleeveless (disables drawing the sleeve color over the player's arms). |
Furniture
Furniture are decorative items which can be placed in the world, including chairs which the player can sit on.
They have their data in Data/Furniture, their in-game sprites in TileSheets/furniture, and their code in StardewValley.Objects.Furniture.
Data format
The furniture data in Data/Furniture consists of an integer→string dictionary with entries like this:
"18": "Country Chair/chair/-1/-1/4/750"
For each entry in the data asset, the key is the item's ParentSheetIndex and the value is a slash-delimited string with these fields:
index | field | effect | ||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | name | The internal item name (and display name in English). | ||||||||||||||||||||||||||||||||||||||
1 | type | The furniture type. Possible values:
| ||||||||||||||||||||||||||||||||||||||
2 | tilesheet size | The furniture sprite size on the tilesheet, measured in tiles. This can be <width> <height> (e.g. 1 2), or -1 to use the default size for the type.
| ||||||||||||||||||||||||||||||||||||||
3 | bounding box size | The size of the hitbox when the furniture is placed in-game, measured in tiles. The bounding box will be anchored to the bottom-left corner and extend upwards and rightwards. This can be <width> <height> (e.g. 1 2), or -1 to use the default size for the type.
| ||||||||||||||||||||||||||||||||||||||
4 | rotations | The number of rotations possible (1, 2, or 4). | ||||||||||||||||||||||||||||||||||||||
5 | price | The price when purchased from a shop. | ||||||||||||||||||||||||||||||||||||||
6 | display name | The translated furniture name (in non-English data assets only). | ||||||||||||||||||||||||||||||||||||||
7 | placement restriction | Where the furniture can be placed. This may not work correctly in non-English languages—it may need to be placed before the display name.
|
Hats
Hats are items that can be equipped in the player's hat slot.
They have their data in Data/Hats, their in-game sprites in Characters/Farmer/hats, and their code in StardewValley.Objects.Hat.
Data format
The hat data in Data/Hats consists of an integer→string dictionary with entries like this:
"5": "Official Cap/Looks like it belonged to a postman or policeman. Either way, it's still very soft and smells okay./false/true"
For each entry in the data asset, the key is the item's ParentSheetIndex and the value is a slash-delimited string with these fields:
index | field | effect |
---|---|---|
0 | name | The internal item name (and display name in English). |
1 | description | The translated item description shown in-game. |
2 | show real hair | Whether to show the player's hairstyle as-is when the hat is worn (true), or change the hairstyle to fit the hat (false). |
3 | skip hairstyle offset | Whether to ignore the current style when positioning the hat (one of true or false). For example, the eye patch sets true since its position isn't affected by the hair, but the butterfly bow sets false to adjust its position on top of your hair. |
4 | display name | The translated item name shown in-game (for non-English assets only). |
Hats have a hard-coded category of -95 (Hats.cs::Load)
Tools
Tools are items that can be swung or used by the player to perform some effect (e.g. dig dirt, chop trees, etc).
They have their in-game sprites in TileSheets/Tools, and their code in StardewValley.Tool and various subclasses like StardewValley.Tools.Axe.
Data format
Tools are currently hardcoded and can't be edited by content packs.
Weapons
Weapons are tools that can be used by the player to damage monsters.
They have their data in Data/Weapons, their in-game sprites in TileSheets/weapons, and their code in StardewValley.Tools.MeleeWeapon and StardewValley.Tools.Slingshot.
Data format
The weapon data in Data/Weapons consists of an integer→string dictionary with entries like this:
"12": "Wooden Blade/Not bad for a piece of carved wood./3/7/1/0/0/0/0/3/-1/0/.02/3"
For each entry in the data asset, the key is the item's ParentSheetIndex and the value is a slash-delimited string with these fields:
- Melee weapons
index field effect 0 name The internal weapon name (and display name in English). 1 description The translated item description shown in-game. 2
3min damage
max damageThe minimum and maximum damage caused when hitting a monster with this weapon. 4 knockback How far the target is pushed when hit, as a multiplier relative to a base weapon like the Rusty Sword (e.g. 1.5 for 150% of Rusty Sword's weight). 5 speed How fast the player can swing the weapon. Each point of speed is worth 40ms of swing time relative to 0. This stacks with the player's weapon speed. 6 added precision Reduces the chance that a strike will miss. 7 added defence Reduces damage received by the player. 8 type The weapon type. One of 0 (stabbing sword), 1 (dagger), 2 (club or hammer), or 3 (slashing sword). 9
10base mine level
min mine levelThe base and minimum mine level, which affect mine container drops. 11 added area of effect Slightly increases the area of effect. 12 critical chance The chance of a critical hit, as a decimal value between 0 and 1. 13 critical damage A multiplier applied to the damage for critical hit. 14 display name The translated item name (in non-English assets only).
- Slingshots
index field effect 0 name The internal weapon name (and display name in English). 1 description The translated item description shown in-game (for non-English assets only). 2–8 unused 9
10base mine level
min mine levelThe base and minimum mine level, which affect mine container drops. 11–13 unused 14 display name The translated item description shown in-game (for non-English assets only).
Weapons have a hardcoded category of -98 (Object.weaponCategory).
Slingshot notes
- The base slingshot has ParentSheetIndex 32 in the weapon data, which increases by one for each upgrade level (up to 34 in the weapon data, though only 32 and 33 are obtainable without mods).
- Slingshot damage is calculated dynamically regardless of the weapon data.
Mine container drops
When the player breaks a container in the mines, there's a chance it will drop a weapon. Here's how the weapon to drop is chosen[1]:
- Match weapons whose minimum mine level (field 10) is less than the current mine level.
- From that list, match weapons with a probability check based on the gap between the base mine level (field 9) and current mine level. The probability is a bell curve centered on the base mine level:
level difference probability 0 100% 5 92% 10 71% 15 46% 20 25% 25 4% e-(current mine level - base mine level)2 / (2 * 122)
.) - Find the weapon with the smallest gap between the current and base mine levels, and add it to the list. (If the item was also selected in step 2, it has two chances to drop.)
- From the remaining list of weapons, randomly choose one to drop.
See also
- Modding:Index for related content like crops, fish, gift tastes, and recipes
References
- ↑ See Utility.getUncommonItemForThisMineLevel in the game code.