Difference between revisions of "Modding:Items"

From Stardew Valley Wiki
Jump to navigation Jump to search
(merge Modding:Furniture data into page as-is (content author: Margotbean, with data updates by Metalax + Pathoschild and fireplace/torch/sconce IDs from DiscipleOfEris))
m (→‎Basic info: fix typo)
 
(117 intermediate revisions by 15 users not shown)
Line 9: Line 9:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! item type
+
! type
! data asset
 
! texture name
 
 
! summary
 
! summary
 
|-
 
|-
| <samp>Object</samp>
+
| [[#Objects|objects]]
| <samp>Data/ObjectInformation</samp>
 
| <samp>Maps/springobjects</samp>
 
 
| The default type for items in inventories or placed in the world.
 
| The default type for items in inventories or placed in the world.
 
|-
 
|-
| <samp>Object</samp> (big craftable)
+
| [[#Big craftables|big craftables]]
| <samp>Data/BigCraftablesInformation</samp>
+
| Craftable items which can be placed in the world and are two tiles tall.
| <samp>TileSheets/Craftables</samp>
 
| Craftable items which can be placed in the world and are two tiles tall (instead of one like objects).
 
 
|-
 
|-
| <Samp>Boots</samp>
+
| [[#Boots|boots]]
| <samp>Data/Boots</samp>
+
| Items that can be equipped in the player's [[footwear]] slot.
| item sprite: <samp>Maps/springobjects</samp><br />shoe color: <samp>Characters/Farmer/shoeColors</samp>
 
| Equippable boots.
 
 
|-
 
|-
| <samp>Clothing</samp>
+
| [[#Clothing|clothing]]
| <samp>Data/ClothingInformation</samp>
+
| Cosmetic items that can be equipped in the player's [[Tailoring|pants and shirt]] slots.
| <samp>Characters/Farmer/pants</samp><br /><samp>Characters/Farmer/shirts</samp>
 
| Equippable pants and shirts.
 
 
|-
 
|-
| <samp>Furniture</samp>
+
| [[#Furniture|furniture]]
| <samp>Data/Furniture</samp>
+
| Decorative items which can be placed in the world, including chairs which the player can sit on.
| <samp>TileSheets/furniture</samp>
 
| Decorative furniture items, including chairs which the player can sit on.
 
 
|-
 
|-
| <samp>Hat</samp>
+
| [[#Hats|hats]]
| <samp>Data/Hats</samp>
+
| Items that can be equipped in the player's [[hats|hat]] slot.
| <samp>Characters/Farmer/hats</samp>
 
| Equippable hat items.
 
 
|-
 
|-
| <samp>Tool</samp>
+
| [[#Tools|tools]]
| &mdash;
+
| Items that can be swung or used by the player to perform some effect.
| <samp>TileSheets/Tools</samp>
 
| Tools that can be used by the player.
 
 
|-
 
|-
| <samp>MeleeWeapon</samp>
+
| [[#Weapons|weapons]]
| <samp>Data/Weapons</samp>
+
| Tools that can be used by the player to damage monsters.
| <samp>TileSheets/weapons</samp>
 
| Weapons that can be used by the player to damage monsters.
 
 
|}
 
|}
  
The game has two files in its <samp>Content</samp> folder (which can be [[Modding:Editing XNB files#unpacking|unpacked for editing]]) for each item type:
+
For each item type, the game has two files in its <samp>Content</samp> folder (which can be [[Modding:Editing XNB files#unpacking|unpacked for editing]]):
 
* a ''data asset'' for the text data for its items (names, descriptions, prices, etc);
 
* a ''data asset'' for the text data for its items (names, descriptions, prices, etc);
 
* and a ''spritesheet'' for the in-game item icons.
 
* and a ''spritesheet'' for the in-game item icons.
  
Each item has a <samp>ParentSheetIndex</samp> 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 <samp>Characters/Farmer/hats</samp>. The <samp>ParentSheetIndex</samp> 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 <code>item is Weapon weapon && weapon.ParentSheetIndex == 4</code>.
+
Each item has a <samp>ParentSheetIndex</samp> 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 <samp>Characters/Farmer/hats</samp>. The <samp>ParentSheetIndex</samp> 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 <code>item is Weapon weapon && weapon.ParentSheetIndex == 4</code>.
 +
 
 +
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.
 
See the sections below for details on each item type.
 +
 +
===Get a list of items===
 +
With [[Modding:Player Guide/Getting Started|SMAPI installed]], you can [[Modding:Console commands#Console commands|run the <samp>list_items</samp> console command]] in-game to view/search items and their IDs.
 +
 +
===Define a custom item===
 +
Every item must be assigned a unique <samp>ParentSheetIndex</samp> 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 {{nexus mod|1720|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:
 +
 +
{| class="wikitable"
 +
|-
 +
! quality
 +
! value
 +
! constant
 +
|-
 +
| normal
 +
| <samp>0</samp>
 +
| <samp>Object.lowQuality</samp>
 +
|-
 +
| silver
 +
| <samp>1</samp>
 +
| <samp>Object.medQuality</samp>
 +
|-
 +
| gold
 +
| <samp>2</samp>
 +
| <samp>Object.highQuality</samp>
 +
|-
 +
| iridium
 +
| <samp>4</samp>
 +
| <samp>Object.bestQuality</samp>
 +
|}
  
 
===Categories===
 
===Categories===
Line 70: Line 89:
 
! value
 
! value
 
! internal constant
 
! internal constant
 +
! [[#Context tags|context tag]]
 
! English translation
 
! English translation
 +
! Properties
 
|-
 
|-
 
| -2
 
| -2
 
| <samp>Object.GemCategory</samp>
 
| <samp>Object.GemCategory</samp>
 +
| <samp>category_gem</samp>
 
| Mineral
 
| Mineral
 +
| Affected by [[Skills#Mining|Gemologist]] profession
 
|-
 
|-
 
| -4
 
| -4
 
| <samp>Object.FishCategory</samp>
 
| <samp>Object.FishCategory</samp>
 +
| <samp>category_fish</samp>
 
| Fish
 
| Fish
 +
| Affected by [[Skills#Fishing|Fisher]] and [[Skills#Fishing|Angler]] professions
 
|-
 
|-
 
| -5
 
| -5
 
| <samp>Object.EggCategory</samp>
 
| <samp>Object.EggCategory</samp>
 +
| <samp>category_egg</samp>
 
| Animal Product
 
| Animal Product
 +
| Affected by [[Skills#Farming|Rancher]] profession, can be used in a slingshot
 
|-
 
|-
 
| -6
 
| -6
 
| <samp>Object.MilkCategory</samp>
 
| <samp>Object.MilkCategory</samp>
 +
| <samp>category_milk</samp>
 
| Animal Product
 
| Animal Product
 +
| Affected by [[Skills#Farming|Rancher]] profession
 
|-
 
|-
 
| -7
 
| -7
 
| <samp>Object.CookingCategory</samp>
 
| <samp>Object.CookingCategory</samp>
 +
| <samp>category_cooking</samp>
 
| Cooking
 
| Cooking
 +
|
 
|-
 
|-
 
| -8
 
| -8
 
| <samp>Object.CraftingCategory</samp>
 
| <samp>Object.CraftingCategory</samp>
 +
| <samp>category_crafting</samp>
 
| Crafting
 
| Crafting
 +
| Is Placeable
 
|-
 
|-
 
| -9
 
| -9
 
| <samp>Object.BigCraftableCategory</samp>
 
| <samp>Object.BigCraftableCategory</samp>
 +
| <samp>category_big_craftable</samp>
 
|  
 
|  
 +
| Is Placeable
 
|-
 
|-
 
| -12
 
| -12
 
| <samp>Object.mineralsCategory</samp>
 
| <samp>Object.mineralsCategory</samp>
 +
| <samp>category_minerals</samp>
 
| Mineral
 
| Mineral
 +
| Affected by [[Skills#Mining|Gemologist]] profession
 
|-
 
|-
 
| -14
 
| -14
 
| <samp>Object.meatCategory</samp>
 
| <samp>Object.meatCategory</samp>
 +
| <samp>category_meat</samp>
 
| Animal Product
 
| Animal Product
 +
|
 
|-
 
|-
 
| -15
 
| -15
 
| <samp>Object.metalResources</samp>
 
| <samp>Object.metalResources</samp>
 +
| <samp>category_metal_resources</samp>
 
| Resource
 
| Resource
 +
|
 
|-
 
|-
 
| -16
 
| -16
 
| <samp>Object.buildingResources</samp>
 
| <samp>Object.buildingResources</samp>
 +
| <samp>category_building_resources</samp>
 
| Resource
 
| Resource
 +
|
 
|-
 
|-
 
| -17
 
| -17
 
| <samp>Object.sellAtPierres</samp>
 
| <samp>Object.sellAtPierres</samp>
 +
| <samp>category_sell_at_pierres</samp>
 
|  
 
|  
 +
|
 
|-
 
|-
 
| -18
 
| -18
 
| <samp>Object.sellAtPierresAndMarnies</samp>
 
| <samp>Object.sellAtPierresAndMarnies</samp>
 +
| <samp>category_sell_at_pierres_and_marnies</samp>
 
| Animal Product
 
| Animal Product
 +
| Affected by [[Skills#Farming|Rancher]] profession
 
|-
 
|-
 
| -19
 
| -19
 
| <samp>Object.fertilizerCategory</samp>
 
| <samp>Object.fertilizerCategory</samp>
 +
| <samp>category_fertilizer</samp>
 
| Fertilizer
 
| Fertilizer
 +
| Is Placeable, is always passable
 
|-
 
|-
 
| -20
 
| -20
 
| <samp>Object.junkCategory</samp>
 
| <samp>Object.junkCategory</samp>
 +
| <samp>category_junk</samp>
 
| Trash
 
| Trash
 +
|
 
|-
 
|-
 
| -21
 
| -21
 
| <samp>Object.baitCategory</samp>
 
| <samp>Object.baitCategory</samp>
 +
| <samp>category_bait</samp>
 
| Bait
 
| Bait
 +
| Can be attached to a fishing rod
 
|-
 
|-
 
| -22
 
| -22
 
| <samp>Object.tackleCategory</samp>
 
| <samp>Object.tackleCategory</samp>
 +
| <samp>category_tackle</samp>
 
| Fishing Tackle
 
| Fishing Tackle
 +
| Can be attached to a fishing rod, cannot stack
 
|-
 
|-
 
| -23
 
| -23
 
| <samp>sellAtFishShopCategory</samp>
 
| <samp>sellAtFishShopCategory</samp>
 +
| <samp>category_sell_at_fish_shop</samp>
 
|  
 
|  
 +
|
 
|-
 
|-
 
| -24
 
| -24
 
| <samp>Object.furnitureCategory</samp>
 
| <samp>Object.furnitureCategory</samp>
 +
| <samp>category_furniture</samp>
 
| Decor
 
| Decor
 +
|
 
|-
 
|-
 
| -25
 
| -25
 
| <samp>Object.ingredientsCategory</samp>
 
| <samp>Object.ingredientsCategory</samp>
 +
| <samp>category_ingredients</samp>
 
| Cooking
 
| Cooking
 +
|
 
|-
 
|-
 
| -26
 
| -26
 
| <samp>Object.artisanGoodsCategory</samp>
 
| <samp>Object.artisanGoodsCategory</samp>
 +
| <samp>category_artisan_goods</samp>
 
| Artisan Goods
 
| Artisan Goods
 +
| Affected by [[Skills#Farming|Artisan]] profession
 
|-
 
|-
 
| -27
 
| -27
 
| <samp>Object.syrupCategory</samp>
 
| <samp>Object.syrupCategory</samp>
 +
| <samp>category_syrup</samp>
 
| Artisan Goods
 
| Artisan Goods
 +
| Affected by [[Skills#Foraging|Tapper]] profession
 
|-
 
|-
 
| -28
 
| -28
 
| <samp>Object.monsterLootCategory</samp>
 
| <samp>Object.monsterLootCategory</samp>
 +
| <samp>category_monster_loot</samp>
 
| Monster Loot
 
| Monster Loot
 +
|
 
|-
 
|-
 
| -29
 
| -29
 
| <samp>Object.equipmentCategory</samp>
 
| <samp>Object.equipmentCategory</samp>
 +
| <samp>category_equipment</samp>
 
|  
 
|  
 +
|
 
|-
 
|-
 
| -74
 
| -74
 
| <samp>Object.SeedsCategory</samp>
 
| <samp>Object.SeedsCategory</samp>
 +
| <samp>category_seeds</samp>
 
| Seed
 
| Seed
 +
| Is Placeable, is always passable
 
|-
 
|-
 
| -75
 
| -75
 
| <samp>Object.VegetableCategory</samp>
 
| <samp>Object.VegetableCategory</samp>
 +
| <samp>category_vegetable</samp>
 
| Vegetable
 
| Vegetable
 +
| Affected by [[Skills#Farming|Tiller]] profession, can be used in a slingshot
 
|-
 
|-
 
| -79
 
| -79
 
| <samp>Object.FruitsCategory</samp>
 
| <samp>Object.FruitsCategory</samp>
 +
| <samp>category_fruits</samp>
 
| Fruit
 
| Fruit
 +
| Affected by [[Skills#Farming|Tiller]] profession (if not foraged), can be used in a slingshot
 
|-
 
|-
 
| -80
 
| -80
 
| <samp>Object.flowersCategory</samp>
 
| <samp>Object.flowersCategory</samp>
 +
| <samp>category_flowers</samp>
 
| Flower
 
| Flower
 +
| Affected by [[Skills#Farming|Tiller]] profession
 
|-
 
|-
 
| -81
 
| -81
 
| <samp>Object.GreensCategory</samp>
 
| <samp>Object.GreensCategory</samp>
 +
| <samp>category_greens</samp>
 
| Forage
 
| Forage
 +
|
 
|-
 
|-
 
| -95
 
| -95
 
| <samp>Object.hatCategory</samp>
 
| <samp>Object.hatCategory</samp>
 +
| <samp>category_hat</samp>
 
|  
 
|  
 +
|
 
|-
 
|-
 
| -96
 
| -96
 
| <samp>Object.ringCategory</samp>
 
| <samp>Object.ringCategory</samp>
 +
| <samp>category_ring</samp>
 
|  
 
|  
 +
|
 
|-
 
|-
 
| -98
 
| -98
 
| <samp>Object.weaponCategory</samp>
 
| <samp>Object.weaponCategory</samp>
 +
| <samp>category_weapon</samp>
 
|  
 
|  
 +
|
 
|-
 
|-
 
| -99
 
| -99
 
| <samp>Object.toolCategory</samp>
 
| <samp>Object.toolCategory</samp>
 +
| <samp>category_tool</samp>
 
|  
 
|  
 +
|
 
|}
 
|}
  
Line 208: Line 295:
 
With the {{nexus mod|3101|Console Code}} mod installed, you can run this command in the SMAPI console to see a list of objects by category:
 
With the {{nexus mod|3101|Console Code}} mod installed, you can run this command in the SMAPI console to see a list of objects by category:
  
<pre>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))}`));</pre>
+
<pre>cs return string.Join(`\n`, Game1.objectData.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))}`));</pre>
 
}}
 
}}
  
===Get a list of items===
+
===Context tags===
With [[Modding:Player Guide/Getting Started|SMAPI installed]], you can [[Modding:Console commands#Console commands|run the <samp>list_items</samp> console command]] in-game to view/search items and their IDs.
+
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 <samp>Data/ObjectContextTags</samp> data asset (which consists of a string→string dictionary, where the key is the item's internal name ''or'' the alternative ID matching the <samp>id_{{t|type}}_{{t|identifier}}</samp> 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.
 +
 
 +
<dl style="margin-left: 2em;">
 +
<dt>Added automatically for all items:</dt>
 +
<dd>
 +
{| class="wikitable"
 +
|-
 +
! context tag
 +
! effect
 +
|-
 +
| <samp>category_{{t|category}}</samp>
 +
| Added automatically based on the item category. See the 'context tag' column in the [[#Categories|item category list]] for possible values.
 +
|-
 +
| <samp>fish_{{t|metadata}}</samp>
 +
| Added automatically for a fish item based on [[Modding:Fish data|its metadata in <samp>Data/Fish</samp>]].
 +
 
 +
For [[Crab Pot|crab pot]] fish (''i.e.'' those with type <samp>trap</samp>):
 +
 
 +
{| class="wikitable"
 +
|-
 +
! context tag
 +
! notes
 +
|-
 +
| <samp>fish_trap_location_{{t|water type}}</samp>
 +
| Based on field 2 ('darting randomness'). For example, <samp>fish_trap_location_ocean</samp>.
 +
|}
 +
 
 +
For fishing rod fish (''i.e.'' those whose type is ''not'' <samp>trap</samp>):
 +
{| class="wikitable"
 +
|-
 +
! context tag
 +
! notes
 +
|-
 +
| <samp>fish_difficulty_{{t|difficulty}}</samp>
 +
| Based on field 1 ('chance to dart'), where {{t|difficulty}} is one of <samp>easy</samp> (0–33), <samp>medium</samp> (34–66), <samp>hard</samp> (67–100), or <samp>extremely_hard</samp> (101+). For example, <samp>fish_difficulty_hard</samp>.
 +
|-
 +
| <samp>fish_motion_{{t|motion}}</samp>
 +
| Based on field 4 ('location'). For example, <samp>fish_motion_floater</samp>.
 +
|-
 +
| <samp>fish_favor_weather_{{t|weather}}</samp>
 +
| Based on field 7 ('weather'). For example, <samp>fish_favor_weather_sunny</samp>.
 +
|}
 +
|-
 +
| <samp>id_{{t|type}}_{{t|identifier}}</samp>
 +
| Added automatically as an alternative ID. The {{t|type}} is one of <samp>B</samp> (boots), <samp>BBL</samp> (big craftable recipe), <samp>BL</samp> (object recipe), <samp>BO</samp> (big craftable), <samp>C</samp> (clothing), <samp>F</samp> (furniture), <samp>H</samp> (hat), <samp>O</samp> (object), <samp>R</samp> (ring), <samp>W</samp> (melee weapon), else blank. The {{t|identifier}} is the item's parent sheet index. For example, [[pufferfish]] has value <samp>id_o_128</samp> (object #128).
 +
|-
 +
| <samp>item_{{t|name}}</samp>
 +
| 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 <samp>item_1000_years_from_now</samp>.
 +
|}
 +
</dd>
 +
 
 +
<dt>Added automatically for [[#Objects|object-type]] items:</dt>
 +
<dd>
 +
{| class="wikitable"
 +
|-
 +
! context tag
 +
! effect
 +
|-
 +
| <samp>jelly_item</samp><br /><samp>juice_item</samp><br /><samp>pickle_item</samp><br /><samp>wine_item</samp>
 +
| For items produced by the [[keg]] or [[Preserves Jar|preserves jar]], the preserved item type.
 +
|-
 +
| <samp>preserve_sheet_index_{{t|id}}</samp>
 +
| For items produced by the [[keg]] or [[Preserves Jar|preserves jar]], the parent sheet index for the original item that was produced. For example, blueberry [[wine]] has <samp>preserve_sheet_index_258</samp>, where 258 is the [[blueberry]] item's index.
 +
|-
 +
| <samp>quality_none</samp><br /><samp>quality_silver</samp><br /><samp>quality_gold</samp><br /><samp>quality_iridium</samp>
 +
| Added automatically based on the item quality.
 +
|-
 +
| <samp>quality_qi</samp>
 +
| Added automatically for items cooked while the [[Quests|''Qi's Cuisine'' special order]] is active.
 +
|}
 +
</dd>
 +
 
 +
<dt>Context tags from <samp>Data/ObjectContextTags</samp>:</dt>
 +
<dd>
 +
{| class="wikitable"
 +
|-
 +
! context tag
 +
! effect
 +
|-
 +
| <samp>color_*</samp>
 +
| The color produced by this item when the player [[Dyeing#Dye Pots|dyes clothing]] at [[2 Willow Lane|Emily's house]]. The context tag only affects which of the six color dye pots it can be placed in; for example, <samp>color_red</samp> and <samp>color_dark_red</samp> are both placed in the red pot, but they don't produce different colors.
 +
 
 +
{| class="wikitable"
 +
|-
 +
! dye pot
 +
! context tags
 +
|-
 +
| red
 +
| <samp>color_red</samp>, <samp>color_salmon</samp>, <samp>color_dark_red</samp>, <samp>color_pink</samp>
 +
|-
 +
| orange
 +
| <samp>color_orange</samp>, <samp>color_dark_orange</samp>, <samp>color_dark_brown</samp>, <samp>color_brown</samp>, <samp>color_copper</samp>
 +
|-
 +
| yellow
 +
| <samp>color_yellow</samp>, <samp>color_dark_yellow</samp>, <samp>color_gold</samp>, <samp>color_sand</samp>
 +
|-
 +
| green
 +
| <samp>color_green</samp>, <samp>color_dark_green</samp>, <samp>color_lime</samp>, <samp>color_yellow_green</samp>, <samp>color_jade</samp>
 +
|-
 +
| blue
 +
| <samp>color_blue</samp>, <samp>color_dark_blue</samp>, <samp>color_dark_cyan</samp>, <samp>color_light_cyan</samp>, <samp>color_cyan</samp>, <samp>color_aquamarine</samp>
 +
|-
 +
| purple
 +
| <samp>color_purple</samp>, <samp>color_dark_purple</samp>, <samp>color_dark_pink</samp>, <samp>color_pale_violet_red</samp>, <samp>color_poppyseed</samp>, <samp>color_iridium</samp>
 +
|}
 +
|}
 +
</dd>
 +
</dl>
 +
 
 +
Some game data also references context tags in a generic way. For example, you can add custom tags for an item to <samp>Data/ObjectContextTags</samp>, then reference them in the fish pond data. Specifically:
 +
 
 +
{| class="wikitable"
 +
|-
 +
! game data
 +
! effects
 +
|-
 +
| [[Modding:Fish Pond data|fish ponds]]
 +
| In <samp>Data/FishPondData</samp>, used to match fish that can be placed in the pond (see [[Modding:Fish Pond data#RequiredTags|<samp>RequiredTags</samp> in the fish pond data]]).
 +
|-
 +
| [[Modding:Special orders|special orders]]
 +
| In <samp>Data/SpecialOrders</samp>, used to match items that meet the quest objectives (see [[Modding:Special orders#Context tags|<samp>AcceptedContextTags</samp> in the special order data]]).
 +
|-
 +
| tailoring
 +
| In <samp>Data/TailoringRecipes</samp>, used to match items that are needed for a recipe.
 +
|-
 +
| [[Modding:Gift taste data|gift tastes]]
 +
| In <samp>Data/NPCGiftTastes</samp>, used to set character likes and dislike for every item using the context tag.
 +
|}
 +
 
  
===Define a custom item===
+
The <samp>debug listtags</samp> [[Modding:Console commands|console command]] lists all the tags of the item being held.
Every item must be assigned a unique <samp>ParentSheetIndex</samp> 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 {{nexus mod|1720|Json Assets}}, which coordinates dynamic item ID assignment so multiple custom item mods can work together.
+
{{collapse|raw tag dump|content=Here's a list of context tags extracted from <samp>Data/ObjectContextTags</samp> that aren't listed above yet: <samp>alcohol_item</samp>, <samp>algae_item</samp>, <samp>ancient_item</samp>, <samp>beach_item</samp>, <samp>bomb_item</samp>, <samp>bone_item</samp>, <samp>book_item</samp>, <samp>ceramic_item</samp>, <samp>chicken_item</samp>, <samp>color_black</samp>, <samp>color_dark_gray</samp>, <samp>color_gray</samp>, <samp>color_iron</samp>, <samp>color_prismatic</samp>, <samp>color_white</samp>, <samp>cooking_item</samp>, <samp>cow_milk_item</samp>, <samp>cowboy_item</samp>, <samp>crop_year_2</samp>, <samp>dinosaur_item</samp>, <samp>doll_item</samp>, <samp>drink_item</samp>, <samp>dwarvish_item</samp>, <samp>dye_medium</samp>, <samp>dye_strong</samp>, <samp>egg_item</samp>, <samp>elvish_item</samp>, <samp>fertilizer_item</samp>, <samp>fish_bug_lair</samp>, <samp>fish_carnivorous</samp>, <samp>fish_crab_pot</samp>, <samp>fish_desert</samp>, <samp>fish_freshwater</samp>, <samp>fish_lake</samp>, <samp>fish_legendary</samp>, <samp>fish_mines</samp>, <samp>fish_night_market</samp>, <samp>fish_nonfish</samp>, <samp>fish_ocean</samp>, <samp>fish_pond</samp>, <samp>fish_river</samp>, <samp>fish_secret_pond</samp>, <samp>fish_semi_rare</samp>, <samp>fish_sewers</samp>, <samp>fish_swamp</samp>, <samp>fish_talk_demanding</samp>, <samp>fish_talk_rude</samp>, <samp>fish_talk_stiff</samp>, <samp>fish_upright</samp>, <samp>flower_item</samp>, <samp>food_bakery</samp>, <samp>food_breakfast</samp>, <samp>food_cake</samp>, <samp>food_party</samp>, <samp>food_pasta</samp>, <samp>food_salad</samp>, <samp>food_sauce</samp>, <samp>food_seafood</samp>, <samp>food_soup</samp>, <samp>food_spicy</samp>, <samp>food_sushi</samp>, <samp>food_sweet</samp>, <samp>forage_item</samp>, <samp>forage_item_beach</samp>, <samp>forage_item_cave</samp>, <samp>forage_item_desert</samp>, <samp>forage_item_mines</samp>, <samp>forage_item_secret</samp>, <samp>fossil_item</samp>, <samp>fruit_item</samp>, <samp>fruit_tree_item</samp>, <samp>furnace_item</samp>, <samp>ginger_item</samp>, <samp>goat_milk_item</samp>, <samp>golden_relic_item</samp>, <samp>honey_item</samp>, <samp>hunting_item</samp>, <samp>instrument_item</samp>, <samp>jelly_item</samp>, <samp>juice_item</samp>, <samp>large_egg_item</samp>, <samp>large_milk_item</samp>, <samp>light_source</samp>, <samp>machine_item</samp>, <samp>marine_item</samp>, <samp>mayo_item</samp>, <samp>medicine_item</samp>, <samp>milk_item</samp>, <samp>noble_item</samp>, <samp>ore_item</samp>, <samp>pickle_item</samp>, <samp>potion_item</samp>, <samp>prehistoric_item</samp>, <samp>quality_fertilizer_item</samp>, <samp>scroll_item</samp>, <samp>season_all</samp>, <samp>season_fall</samp>, <samp>season_spring</samp>, <samp>season_summer</samp>, <samp>season_winter</samp>, <samp>slime_egg_item</samp>, <samp>slime_item</samp>, <samp>statue_item</samp>, <samp>strange_doll_1</samp>, <samp>strange_doll_2</samp>, <samp>syrup_item</samp>, <samp>totem_item</samp>, <samp>toy_item</samp>, <samp>trash_item</samp>, <samp>tree_seed_item</samp>, <samp>wood_item</samp>.}}
  
 
==Objects==
 
==Objects==
 
Objects are the default type for items in inventories or placed in the world.
 
Objects are the default type for items in inventories or placed in the world.
  
They have their data in <samp>Data/ObjectInformation</samp>, their icon sprites in <samp>Maps/springobjects</samp>, and their code in <samp>StardewValley.Object</samp>. See [[Modding:Items/Object sprites|a table of sprites and their corresponding indexes]].
+
They have their data in <samp>Data/Objects</samp> (<samp>Data/ObjectInformation</samp> prior to 1.6), their icon sprites in <samp>Maps/springobjects</samp>, and their code in <samp>StardewValley.Object</samp>. See [[Modding:Items/Object sprites|a table of sprites and their corresponding indexes]].
 +
 
 +
===Data format===
 +
The object data in <samp>Data/Objects</samp> consists of a string→ObjectData dictionary (where ObjectData is defined in the game code in <samp>GameData.Objects.ObjectData</samp>). It has entries like this<ref>See <samp>Data/Objects.xnb</ref>:
 +
<syntaxhighlight lang="json">
 +
"201": {
 +
  "Name": "Complete Breakfast",
 +
  "DisplayName": "[LocalizedText Strings\\Objects:CompleteBreakfast_Name]",
 +
  "Description": "[LocalizedText Strings\\Objects:CompleteBreakfast_Description]",
 +
  "Type": "Cooking",
 +
  "Category": -7,
 +
  "Price": 350,
 +
  "Texture": null,
 +
  "SpriteIndex": 201,
 +
  "Edibility": 80,
 +
  "IsDrink": false,
 +
  "Buffs": [
 +
    {
 +
      "Id": "Food",
 +
      "BuffId": null,
 +
      "IconTexture": null,
 +
      "IconSpriteIndex": 0,
 +
      "Duration": 600,
 +
      "IsDebuff": false,
 +
      "GlowColor": null,
 +
      "CustomAttributes": {
 +
        "FarmingLevel": 2.0,
 +
        "FishingLevel": 0.0,
 +
        "MiningLevel": 0.0,
 +
        "LuckLevel": 0.0,
 +
        "ForagingLevel": 0.0,
 +
        "MaxStamina": 50.0,
 +
        "MagneticRadius": 0.0,
 +
        "Speed": 0.0,
 +
        "Defense": 0.0,
 +
        "Attack": 0.0
 +
      },
 +
      "CustomFields": null
 +
    }
 +
  ],
 +
  "GeodeDropsDefaultItems": false,
 +
  "GeodeDrops": null,
 +
  "ArtifactSpotChances": null,
 +
  "ExcludeFromFishingCollection": false,
 +
  "ExcludeFromShippingCollection": false,
 +
  "ExcludeFromRandomSale": false,
 +
  "ContextTags": [
 +
    "color_yellow",
 +
    "food_breakfast"
 +
  ],
 +
  "CustomFields": null
 +
  }
 +
</syntaxhighlight>
 +
 
 +
For each entry in the data asset:
 +
* The key (before the colon) is the unqualified item ID and its sprite index within the [[Modding:Items/Object sprites|object spritesheet]] (saved as <samp>ParentSheetIndex</samp> in-code).
 +
* The value (after the colon) is the data pertaining to that object, with the fields listed below. The objects with keys 516–534 (<samp>Ring.ringLowerIndexRange</samp> through <samp>Ring.ringUpperIndexRange</samp>) and 801 (wedding ring) are hardcoded as rings.
 +
 
 +
Field values are described below (Copied from [[Modding:Migrate to Stardew Valley 1.6]]):
 +
 
 +
====Basic info====
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! purpose
 +
|-
 +
| <samp>Name</samp>
 +
| The internal item name.
 +
|-
 +
| <samp>DisplayName</samp><br /><samp>Description</samp>
 +
| A [[Modding:Tokenizable strings|tokenizable string]] for the item's in-game display name and description.
 +
|-
 +
| <samp>Type</samp>
 +
| The item's general type, like <samp>Arch</samp> (artifact) or <samp>Minerals</samp>.  The vanilla types are: Litter, Basic, Minerals, Quest, asdf, Crafting, Arch, fish, Cooking, Seeds, Ring, interactive
 +
|-
 +
| <samp>Category</samp>
 +
| The [[Modding:Items#Categories|item category]].
 +
|-
 +
| <samp>Price</samp>
 +
| ''(Optional)'' The price when sold by the player. This is not the price when bought from a shop. Default 0.
 +
|}
 +
 
 +
====Appearance====
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! purpose
 +
|-
 +
| <samp>Texture</samp>
 +
| The asset name for the texture containing the item's sprite. Defaults to <samp>Maps/springobjects</samp>.
 +
|-
 +
| <samp>SpriteIndex</samp>
 +
| The sprite's index within the <samp>Texture</samp>, where 0 is the top-left sprite.
 +
|}
 +
 
 +
====Edibility====
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! purpose
 +
|-
 +
| <samp>Edibility</samp>
 +
| ''(Optional)'' A numeric value that determines how much energy (edibility × 2.5) and health (edibility × 1.125) is restored when this item is eaten. An item with an edibility of -300 can't be eaten, values from -299 to -1 reduce health and energy, and zero can be eaten but doesn't change health/energy. Default -300.
 +
|-
 +
| <samp>IsDrink</samp>
 +
| ''(Optional)'' Whether to drink the item instead of eating it. Default false.
 +
|-
 +
| <samp>Buffs</samp>
 +
| ''(Optional)'' The buffs to apply to the player when this item is eaten, if any. Default none.
 +
 
 +
This consists of a list of models with these fields:
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! purpose
 +
|-
 +
| <samp>Id</samp>
 +
| The [[Modding:Common data field types#Unique string ID|unique string ID]] for this entry within the list.
 +
|-
 +
| <samp>Duration</samp>
 +
| ''(Optional if <samp>BuffId</samp> is set)'' The buff duration measured in in-game minutes. This can be set to <samp>-2</samp> for a buff that should last for the rest of the day.
 +
|-
 +
| <samp>BuffId</samp>
 +
| ''(Optional)'' The unique ID of a buff from [[#Custom buffs|<samp>Data/Buffs</samp>]] to apply, or <samp>null</samp> to ignore <samp>Data/Buffs</samp> and set the ID to <samp>food</samp> or <samp>drink</samp> depending on the item's <samp>IsDrink</samp> field.
 +
 
 +
If a buff from <samp>Data/Buffs</samp> is applied and you also specify other fields, here's how the buff data is combined:
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! result
 +
|-
 +
| <samp>Duration</samp><br /><samp>IconTexture</samp><br /><samp>SpriteIndex</samp><br /><samp>GlowColor</samp>
 +
| If specified, the value in <samp>Data/Objects</samp> is used instead of the one in <samp>Data/Buffs</samp>. If omitted, defaults to the value from <samp>Data/Buffs</samp>.
 +
|-
 +
| <samp>CustomAttributes</samp>
 +
| The values from both entries are combined (e.g. +1 speed in <samp>Data/Objects</samp> and +1 speed in <samp>Data/Buffs</samp> results in +2 speed).
 +
|-
 +
| <samp>IsDebuff</samp>
 +
| The value in <samp>Data/Objects</samp> is used.
 +
|}
 +
|-
 +
| <samp>IsDebuff</samp>
 +
| ''(Optional)'' Whether this buff counts as a debuff, so its duration should be halved when wearing a Sturdy Ring. Default false.
 +
|-
 +
| <samp>IconTexture</samp>
 +
| ''(Optional)'' The asset name for the icon texture to load. This must contain one or more 16x16 icons in a grid of any size. If omitted, the game will draw a default icon based on the <samp>BuffId</samp> and <samp>CustomAttributes</samp> fields.
 +
|-
 +
| <samp>SpriteIndex</samp>
 +
| ''(Optional)'' The buff's icon index within the <samp>IconTexture</samp>, where 0 is the top-left icon. Default 0.
 +
|-
 +
| <samp>GlowColor</samp>
 +
| ''(Optional)'' The glow color to apply to the player. See [[#Color fields|color format]]. Default none.
 +
|-
 +
| <samp>CustomAttributes</samp>
 +
| The custom buff attributes to apply, if any.
 +
 
 +
This consists of a model with any combination of these fields:
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! purpose
 +
|-
 +
| <samp>FarmingLevel</samp><br /><samp>FishingLevel</samp><br /><samp>ForagingLevel</samp><br /><samp>LuckLevel</samp><br /><samp>MiningLevel</samp>
 +
| ''(Optional)'' An amount applied to the matching [[Skills|skill level]] while the buff is active. This can be negative for a debuff. Default 0.
 +
|-
 +
| <samp>Attack</samp><br /><samp>Defense</samp><br /><samp>MagneticRadius</samp><br /><samp>MaxStamina</samp><br /><samp>Speed</samp>
 +
| ''(Optional)'' An amount applied to the player's [[attack]], [[defense]], [[Magnetism|magnetic radius]], maximum [[Energy|stamina]], or [[speed]] while the buff is active. This can be negative for a debuff. Default 0.
 +
|}
 +
|-
 +
| <samp>CustomFields</samp>
 +
| ''(Optional)'' The [[#Custom data fields|custom fields]] for this entry.
 +
|}
 +
|}
 +
 
 +
 
 +
===Notes===
 +
* Prior to 1.6, items that have a number in index 6 (the "Crafting" field) showed buggy information in-game (''e.g.,'' Bean Hotpot prior to version 1.4). Items that had a number in the "Attack" field displayed the Attack icon and a number, but no description. It's unclear how these buffs work (if at all).
 +
* '''Adding custom items with the <samp>Arch</samp> 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 [[Buffs#Tipsy|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 <samp>Data/BigCraftables</samp> (<samp>Data/BigCraftablesInformation</samp> prior to 1.6), their in-game sprites in <samp>TileSheets/Craftables</samp>, and their code in <samp>StardewValley.Object</samp> (with the <code>bigCraftable.Value = true</code> flag).
 +
 
 +
===Data format===
 +
The big craftables data in <samp>Data/BigCraftables</samp> consists of a string → model lookup, where...
 +
* The key is the unqualified [[#Custom items|item ID]].
 +
* The value is a model with the fields listed below.
 +
 
 +
<syntaxhighlight lang="json">
 +
  "19": {
 +
    "Name": "Oil Maker",
 +
    "DisplayName": "[LocalizedText Strings\\BigCraftables:OilMaker_Name]",
 +
    "Description": "[LocalizedText Strings\\BigCraftables:OilMaker_Description]",
 +
    "Price": 50,
 +
    "Fragility": 0,
 +
    "CanBePlacedOutdoors": true,
 +
    "CanBePlacedIndoors": true,
 +
    "IsLamp": false,
 +
    "Texture": null,
 +
    "SpriteIndex": 19,
 +
    "ContextTags": null,
 +
    "CustomFields": null
 +
  }
 +
</syntaxhighlight>
 +
 
 +
Field values are described below (Copied from [[Modding:Migrate to Stardew Valley 1.6]]):
 +
 
 +
====Basic info====
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! purpose
 +
|-
 +
| <samp>Name</samp>
 +
| The internal item name.
 +
|-
 +
| <samp>DisplayName</samp><br /><samp>Description</samp>
 +
| A [[Modding:Tokenizable strings|tokenizable string]] for the item's in-game display name and description.
 +
|-
 +
| <samp>Price</samp>
 +
| ''(Optional)'' The price when sold by the player. This is not the price when bought from a shop. Default 0.
 +
|}
 +
 
 +
====Behavior====
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! purpose
 +
|-
 +
| <samp>Fragility</samp>
 +
| ''(Optional)'' How the item can be picked up. The possible values are 0 (pick up with any tool), 1 (destroyed if hit with an axe/hoe/pickaxe, or picked up with any other tool), or 2 (can't be removed once placed). Default 0.
 +
|-
 +
| <samp>CanBePlacedIndoors</samp><br /><samp>CanBePlacedOutdoors</samp>
 +
| ''(Optional)'' Whether the item can be placed indoors or outdoors. Default true.
 +
|-
 +
| <samp>IsLamp</samp>
 +
| ''(Optional)'' Whether this is a lamp and should produce light when dark. Default false.
 +
|}
 +
 
 +
====Appearance====
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! purpose
 +
|-
 +
| <samp>Texture</samp>
 +
| ''(Optional)'' The asset name for the texture containing the item's sprite. Defaults to <samp>TileSheets/Craftables</samp>.
 +
|-
 +
| <samp>SpriteIndex</samp>
 +
| ''(Optional)'' The sprite's index within the <samp>Texture</samp>, where 0 is the top-left sprite.
 +
|}
 +
 
 +
====Context tags====
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! purpose
 +
|-
 +
| <samp>ContextTags</samp>
 +
| ''(Optional)'' The custom [[Modding:Items#Context tags|context tags]] to add for this item (in addition to the tags added automatically based on the other object data). This is formatted as a list; for example:
 +
<syntaxhighlight lang="json">
 +
"ContextTags": [ "light_source", "torch_item" ]
 +
</syntaxhighlight>
 +
|}
 +
 
 +
====Advanced====
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! purpose
 +
|-
 +
| <samp>CustomFields</samp>
 +
| ''(Optional)'' The [[Modding:Migrate_to_Stardew_Valley_1.6#Custom_data_fields|custom fields]] for this entry.
 +
|}
 +
 
 +
===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 [[#Objects|object data]] or [[#Furniture|furniture data]].
 +
 
 +
==Boots==
 +
Boots are items that can be equipped in the player's [[footwear]] slot.
 +
 
 +
They have their data in <samp>Data/Boots</samp>, their in-game sprites in <samp>Maps/springobjects</samp> (item sprite) and <samp>Characters/Farmer/shoeColors</samp> (shoe color), and their code in <samp>StardewValley.Objects.Boots</samp>.
  
 
===Data format===
 
===Data format===
The object data in <samp>Data/ObjectInformation</samp> consists of an integer→string dictionary with entries like this:
+
The boots data in <samp>Data/Boots</samp> consists of an integer→string dictionary with entries like this:
 +
 
 
<syntaxhighlight lang="json">
 
<syntaxhighlight lang="json">
   "18": "Daffodil/30/0/Basic -81/Daffodil/A traditional spring flower that makes a nice gift."
+
   "511": "Dark Boots/Made from thick black leather./250/4/2/7"
 
</syntaxhighlight>
 
</syntaxhighlight>
  
For each entry in the data asset, the key is the item's <samp>ParentSheetIndex</samp> and the value is a slash-delimited string with the fields listed below. Fields 0–5 are used by rings and most other objects; fields 6–11 are only used for food buffs. The objects with keys 516–534 (<samp>Ring.ringLowerIndexRange</samp> through <samp>Ring.ringUpperIndexRange</samp>) and 801 (wedding ring) are hardcoded as rings.
+
For each entry in the data asset, the key is the item's <samp>ParentSheetIndex</samp> and the value is a slash-delimited string with these fields:
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 237: Line 740:
 
! field
 
! field
 
! effect
 
! effect
|-
 
!style="text-align: left;" colspan="3"| all objects
 
 
|-
 
|-
 
| 0
 
| 0
Line 245: Line 746:
 
|-
 
|-
 
| 1
 
| 1
| price
+
| description
| The gold price of the item when sold by the player.
+
| The translated item description shown in-game.
 
|-
 
|-
 
| 2
 
| 2
| edibility
+
| price
| A numeric value that determines how much health (edibility × 2.5) and energy (edibility × 1.125) is restored. An item with an edibility of -300 can't be eaten.
+
| '''Unused.''' The actual price is calculated as <samp>(''added defence'' × 100) + (''added immunity'' × 100)</samp>.
 
 
This is ignored for rings.
 
 
|-
 
|-
 
| 3
 
| 3
| type and category
+
| added defense
| &#32;
+
| A [[defense]] bonus applied to the player while equipped.
* For a ring: the value <samp>Ring</samp>. Rings have a hardcoded category of -96 (<samp>Object.ringCategory</samp>).
 
* For other objects: the item's type (string) and category (negative integer), separated by a space like <samp>Fish -4</samp>.
 
 
|-
 
|-
 
| 4
 
| 4
 +
| added immunity
 +
| An [[immunity]] bonus applied to the player while equipped.
 +
|-
 +
| 5
 +
| color index
 +
| The index of the boot color in the <samp>Characters/Farmer/shoeColors</samp> 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 [[Tailoring|pants and shirt]] slots.
 +
 +
They have their data in <samp>Data/ClothingInformation</samp>, their in-game sprites in <samp>Characters/Farmer/pants</samp> & <samp>Characters/Farmer/shirts</samp>, and their code in <samp>StardewValley.Objects.Clothing</samp>.
 +
 +
===Data format===
 +
The clothing data in <samp>Data/ClothingInformation</samp> consists of an integer→string dictionary with entries like this:
 +
 +
<syntaxhighlight lang="json">
 +
  "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"
 +
</syntaxhighlight>
 +
 +
For each entry in the data asset, the key is the item's <samp>ParentSheetIndex</samp> (offset by 1000 for shirts) and the value is a slash-delimited string with these fields:
 +
 +
{| class="wikitable"
 +
|-
 +
! index
 +
! field
 +
! effect
 +
|-
 +
| 0
 +
| name
 +
| The internal item name (and display name in English).
 +
|-
 +
| 1
 
| display name
 
| display name
| The translated item name.
+
| The translated item name shown in-game.
 
|-
 
|-
| 5
+
| 2
 
| description
 
| description
| The translated item 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 <samp>-1</samp> to use the male index.
 
|-
 
|-
!style="text-align: left;" colspan="3"| food & drink only
+
| 5
 +
| price
 +
| The price when purchased from shops.
 
|-
 
|-
 
| 6
 
| 6
| miscellaneous
+
| default color
| &#32;
+
| The default color, specified in space-delimited RGB with each channel being an integer from 0 (no color) to 255 (full color). For example, <samp>255 0 0</samp> for full red.
* For a food or drink item, set this to <samp>food</samp> or <samp>drink</samp> respectively. This enables the remaining fields, and changes which animation/sound is played when the player consumes the item. Any other value is ignored.
 
* For a geode item ([[Geode|535]], [[Frozen Geode|536]], [[Magma Geode|537]], or [[Omni Geode|749]]) is broken, a space-delimited list of object IDs. There's a roughly 50% chance that the geode item will drop one of these items (the other drops are hardcoded).
 
 
|-
 
|-
 
| 7
 
| 7
| buffs
+
| dyeable
| The bonuses to apply to the player's attribute when the item is consumed. This consists of a space-delimited list of these numbers:
+
| Whether the clothing can be [[Dyeing|dyed]] (<samp>true</samp> or <samp>false</samp>).
{|class="wikitable"
+
|-
 +
| 8
 +
| Type
 +
| The clothing type. One of <samp>Pants</samp>, <samp>Shirt</samp>, or <s><samp>Accessory</samp></s> (unimplemented).
 +
|-
 +
| 9
 +
| extra data
 +
| A comma-delimited list of tags attached to the item (unrelated to [[#Context tags|context tags]]). The values recognized by the game are <samp>Prismatic</samp> (adds a shifting rainbow effect) and <samp>Sleeveless</samp> (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 <samp>Data/Furniture</samp>, their in-game sprites in <samp>TileSheets/furniture</samp>, and their code in <samp>StardewValley.Objects.Furniture</samp>.
 +
 
 +
===Data format===
 +
The furniture data in <samp>Data/Furniture</samp> consists of an integer→string dictionary with entries like this:
 +
 
 +
<syntaxhighlight lang="json">
 +
  "18": "Country Chair/chair/-1/-1/4/750"
 +
</syntaxhighlight>
 +
 
 +
For each entry in the data asset, the key is the item's <samp>ParentSheetIndex</samp> and the value is a slash-delimited string with these fields:
 +
 
 +
{| class="wikitable"
 
|-
 
|-
 
! index
 
! index
! buff
+
! field
 +
! effect
 +
|-
 +
| 0
 +
| name
 +
| The internal item name (and display name in English).
 +
|-
 +
| 1
 +
| type
 +
| The furniture type. Possible values:
 +
{| class="wikitable sortable"
 +
|-
 +
! type
 +
! meaning
 
|-
 
|-
 
| 0
 
| 0
| [[Skills#Farming|farming]]
+
| chair
 
|-
 
|-
 
| 1
 
| 1
| [[Skills#Fishing|fishing]]
+
| bench
 
|-
 
|-
 
| 2
 
| 2
| [[Skills#Mining|mining]]
+
| couch
 
|-
 
|-
 
| 3
 
| 3
| ''unused''
+
| armchair
 
|-
 
|-
 
| 4
 
| 4
| [[Luck|luck]]
+
| dresser
 
|-
 
|-
 
| 5
 
| 5
| [[Skills#Foraging|foraging]]
+
| long table
 
|-
 
|-
 
| 6
 
| 6
| ''unused''
+
| painting
 
|-
 
|-
 
| 7
 
| 7
| max [[energy]]
+
| lamp
 
|-
 
|-
 
| 8
 
| 8
| [[magnetism]]
+
| decor
 
|-
 
|-
 
| 9
 
| 9
| [[speed]]
+
| other
 
|-
 
|-
 
| 10
 
| 10
| [[defense]]
+
| bookcase
 
|-
 
|-
 
| 11
 
| 11
| [[attack]]
+
| table
 +
|-
 +
| 12
 +
| rug
 +
|-
 +
| 13
 +
| window
 +
|-
 +
| 14
 +
| fireplace
 +
|-
 +
| 15
 +
| bed
 +
|-
 +
| 16
 +
| torch
 +
|-
 +
| 17
 +
| sconce
 
|}
 
|}
 
|-
 
|-
| 8
+
| 2
| buff duration
+
| tilesheet size
| How long the buffs provided by the previous field last. This is converted into in-game minutes using the formula <samp>(''duration'' × 0.7) / 60</samp>. The buff duration number shown in-game will always be one second less than the calculated value.
+
| The furniture sprite size on the tilesheet, measured in tiles. This can be <samp>{{t|width}} {{t|height}}</samp> (e.g. <samp>1 2</samp>), or <samp>-1</samp> 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 <samp>{{t|width}} {{t|height}}</samp> (e.g. <samp>1 2</samp>), or <samp>-1</samp> 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
 +
| placement restriction
 +
| Where the furniture can be placed.
 +
{| class="wikitable sortable"
 +
|-
 +
! value
 +
! meaning
 +
|-
 +
| -1
 +
| default (uses furniture type)
 +
|-
 +
| 0
 +
| indoors-only
 +
|-
 +
| 1
 +
| outdoors-only
 +
|-
 +
| 2
 +
| indoors or outdoors
 +
|}
 +
|-
 +
| 7
 +
| display name
 +
| The translated furniture name (in non-English data assets only).
 
|}
 
|}
  
===Notes===
+
==Hats==
* Items that have a number in 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).
+
Hats are items that can be equipped in the player's [[hats|hat]] slot.
* 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.
 
 
 
==Objects (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 <samp>Data/BigCraftableInformation</samp>, their in-game sprites in <samp>TileSheets/Craftables</samp>, and their code in <samp>StardewValley.Object</samp> (with the <code>bigCraftable.Value = true</code> flag).
+
They have their data in <samp>Data/Hats</samp>, their in-game sprites in <samp>Characters/Farmer/hats</samp>, and their code in <samp>StardewValley.Objects.Hat</samp>.
  
 
===Data format===
 
===Data format===
The big craftables data in <samp>Data/BigCraftableInformation</samp> consists of an integer→string dictionary with entries like this:
+
The hat data in <samp>Data/Hats</samp> consists of an integer→string dictionary with entries like this:
  
 
<syntaxhighlight lang="json">
 
<syntaxhighlight lang="json">
   "19": "Oil Maker/50/-300/Crafting -9/Makes gourmet truffle oil./true/true/0/Oil Maker"
+
   "5": "Official Cap/Looks like it belonged to a postman or policeman. Either way, it's still very soft and smells okay./false/true"
 
</syntaxhighlight>
 
</syntaxhighlight>
  
For each entry in the data asset, the key is the item's <samp>ParentSheetIndex</samp> and the value is a slash-delimited string with these fields:
+
Hats from the base game use the hat's <samp>ParentSheetIndex</samp> as its item ID.
 +
For each entry in the data asset, the key is the hat's item ID, and the value is a slash-delimited string with these fields:
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 353: Line 983:
 
| 0
 
| 0
 
| name
 
| name
| The internal item name (and display name in English).
+
| The internal item name.
 
|-
 
|-
 
| 1
 
| 1
| price
+
| description
| The gold price when sold by the player.
+
| The translated item description shown in-game.
 
|-
 
|-
 
| 2
 
| 2
| edibility
+
| show real hair
| See edibility for [[#Objects|object data]]. Always set to <samp>-300</samp> (inedible) for vanilla items.
+
| Whether to show the player's hairstyle as-is when the hat is worn (<samp>true</samp>), or change the hairstyle to fit the hat (<samp>false</samp>).
 
|-
 
|-
 
| 3
 
| 3
| type and category
+
| skip hairstyle offset
| See type and category for [[#Objects|object data]]. Always set to <samp>Crafting -9</samp> for vanilla items.
+
| Whether to ignore the current style when positioning the hat (one of <samp>true</samp> or <samp>false</samp>). For example, the [[Eye Patch|eye patch]] sets <samp>true</samp> since its position isn't affected by the hair, but the [[Butterfly Bow|butterfly bow]] sets <samp>false</samp> to adjust its position on top of your hair.
 
|-
 
|-
 
| 4
 
| 4
 +
| tags
 +
| A space-separated list of "tags". These are separate from context tags, and used to contain miscellaneous information. Currently, the only tag used by the game is <samp>Prismatic</samp>, which marks a hat as prismatic and causes it to cycle through colors.
 +
|-
 +
| 5
 +
| display name
 +
| The translated item name shown in-game.
 +
|-
 +
| 6
 +
| sprite index
 +
| The index in the hat spritesheet used to display this hat.
 +
|-
 +
| 7
 +
| texture name
 +
| The name of the game texture to use for the hat. If empty, the game will use the default hat sheet <samp>Characters/Farmer/hats</samp>
 +
|}
 +
 +
Hats have a hard-coded category of -95 (<samp>HatDataDefinition.cs::GetData</samp>)
 +
 +
==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 <samp>TileSheets/Tools</samp>, and their code in <samp>StardewValley.Tool</samp> and various subclasses like <samp>StardewValley.Tools.Axe</samp>.
 +
 +
===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 <samp>Data/Weapons</samp>, their in-game sprites in <samp>TileSheets/weapons</samp>, and their code in <samp>StardewValley.Tools.MeleeWeapon</samp> and <samp>StardewValley.Tools.Slingshot</samp>.
 +
 +
===Data format===
 +
The weapon data in <samp>Data/Weapons</samp> consists of an integer→string dictionary with entries like this:
 +
 +
<syntaxhighlight lang="json">
 +
  "12": "Wooden Blade/Not bad for a piece of carved wood./3/7/1/0/0/0/0/3/-1/0/.02/3"
 +
</syntaxhighlight>
 +
 +
For each entry in the data asset, the key is the item's <samp>ParentSheetIndex</samp> and the value is a slash-delimited string with these fields:
 +
 +
; Melee weapons
 +
: {| class="wikitable"
 +
|-
 +
! index
 +
! field
 +
! effect
 +
|-
 +
| 0
 +
| name
 +
| The internal weapon name (and display name in English).
 +
|-
 +
| 1
 
| description
 
| description
 
| The translated item description shown in-game.
 
| The translated item description shown in-game.
 +
|-
 +
| 2<br />3
 +
| min damage<br />max damage
 +
| The 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. <samp>1.5</samp> for 150% of Rusty Sword's weight).
 
|-
 
|-
 
| 5
 
| 5
| outdoors
+
| speed
| Whether the item can be placed outdoors (<samp>true</samp> or <samp>false</samp>).
+
| 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 [[speed|player's weapon speed]].
 
|-
 
|-
 
| 6
 
| 6
| indoors
+
| added precision
| Whether the item can be placed indoors (<samp>true</samp> or <samp>false</samp>).
+
| Reduces the chance that a strike will miss.
 
|-
 
|-
 
| 7
 
| 7
| fragility
+
| added defence
| How the item is removed by tools. Possible values:
+
| Reduces damage received by the player.
{| class="wikitable"
+
|-
 +
| 8
 +
| type
 +
| The weapon type. One of <samp>0</samp> (stabbing sword), <samp>1</samp> (dagger), <samp>2</samp> (club or hammer), or <samp>3</samp> (slashing sword).
 +
|-
 +
| 9<br />10
 +
| base mine level<br />min mine level
 +
| The base and minimum mine level, which affect [[#Mine container drops|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
 +
: {| class="wikitable"
 
|-
 
|-
! fragility
+
! index
 +
! field
 
! effect
 
! effect
 
|-
 
|-
| <samp>0</samp>
+
| 0
| Pick up with any tool.
+
| name
 +
| The internal weapon name (and display name in English).
 +
|-
 +
| 1
 +
| description
 +
| The translated item description shown in-game (for non-English assets only).
 
|-
 
|-
| <samp>1</samp>
+
| 2&ndash;8
| Destroyed if hit with an [[axe]], [[hoe]], or [[pickaxe]]. Any other tool will pick it up.
+
| ''unused''
 +
|
 
|-
 
|-
| <samp>2</samp>
+
| 9<br />10
| Indestructible. The item can't be removed once placed.
+
| base mine level<br />min mine level
|}
+
| The base and minimum mine level, which affect [[#Mine container drops|mine container drops]].
 
|-
 
|-
| 8
+
| 11&ndash;13
| is lamp
+
| ''unused''
| Whether the item is a lamp and produces light when it's dark. This can be <samp>true</samp> (mark as lamp) or any other value (ignored).
+
|
 
|-
 
|-
| 9
+
| 14
 
| display name
 
| display name
| The translated display name (in non-English assets only).
+
| The translated item description shown in-game (for non-English assets only).
 
|}
 
|}
  
===Notes===
+
Weapons have a hardcoded category of -98 (<samp>Object.weaponCategory</samp>).
* 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 [[#Objects|object data]] or [[Modding:Furniture data|Furniture data]].
 
 
 
=Furniture=
 
This page explains how the game stores and parses Furniture data. This is an advanced guide for mod developers.
 
  
==Raw data==
+
===Slingshot notes===
Furniture is stored in <samp>Content\Data\Furniture.xnb</samp>, which can be [[Modding:Editing XNB files#unpacking|unpacked for editing]]. Here's the raw data as of {{version|1.5.1}} for reference:
+
* The base [[slingshot]] has <samp>ParentSheetIndex</samp> 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 [[Slingshot#Ammunition|calculated dynamically]] regardless of the weapon data.
  
{{collapse|Data|content=<syntaxhighlight lang="json">
+
===Mine container drops===
{
+
When the player breaks a container in [[The Mines|the mines]], there's a chance it will drop a weapon. Here's how the weapon to drop is chosen<ref>See <samp>Utility.getUncommonItemForThisMineLevel</samp> in the game code.</ref>:
  "0": "Oak Chair/chair/-1/-1/4/350",
 
  "3": "Walnut Chair/chair/-1/-1/4/350",
 
  "6": "Birch Chair/chair/-1/-1/4/350",
 
  "9": "Mahogany Chair/chair/-1/-1/4/1000",
 
  "12": "Red Diner Chair/chair/-1/-1/4/750",
 
  "15": "Blue Diner Chair/chair/-1/-1/4/750",
 
  "18": "Country Chair/chair/-1/-1/4/750",
 
  "21": "Breakfast Chair/chair/-1/-1/4/750",
 
  "24": "Pink Office Chair/chair/-1/-1/4/500",
 
  "27": "Purple Office Chair/chair/-1/-1/4/500",
 
  "30": "Green Office Stool/chair/-1/-1/1/350",
 
  "31": "Orange Office Stool/chair/-1/-1/1/350",
 
  "64": "Dark Throne/chair/-1/-1/4/2000",
 
  "67": "Dining Chair/chair/-1/-1/4/1200",
 
  "70": "Dining Chair/chair/-1/-1/4/1200",
 
  "73": "Green Plush Seat/chair/-1/-1/4/750",
 
  "76": "Pink Plush Seat/chair/-1/-1/4/750",
 
  "79": "Winter Chair/chair/-1/-1/4/750",
 
  "82": "Groovy Chair/chair/-1/-1/4/750",
 
  "85": "Cute Chair/chair/-1/-1/4/1200",
 
  "88": "Stump Seat/chair/-1/-1/4/2000",
 
  "91": "Metal Chair/chair/-1/-1/4/800",
 
  "94": "Green Stool/chair/-1/-1/1/350",
 
  "95": "Blue Stool/chair/-1/-1/1/350",
 
  "128": "King Chair/chair/-1/-1/4/3000",
 
  "131": "Crystal Chair/chair/-1/-1/4/3000",
 
  "192": "Oak Bench/bench/-1/-1/4/750",
 
  "197": "Walnut Bench/bench/-1/-1/4/750",
 
  "202": "Birch Bench/bench/-1/-1/4/750",
 
  "207": "Mahogany Bench/bench/-1/-1/4/2000",
 
  "212": "Modern Bench/bench/-1/-1/4/2000",
 
  "288": "Blue Armchair/armchair/-1/-1/4/1000",
 
  "294": "Red Armchair/armchair/-1/-1/4/1000",
 
  "300": "Green Armchair/armchair/-1/-1/4/1000",
 
  "306": "Yellow Armchair/armchair/-1/-1/4/1000",
 
  "312": "Brown Armchair/armchair/-1/-1/4/1000",
 
  "416": "Blue Couch/couch/-1/-1/4/1750",
 
  "424": "Red Couch/couch/-1/-1/4/1750",
 
  "432": "Green Couch/couch/-1/-1/4/1750",
 
  "440": "Yellow Couch/couch/-1/-1/4/1750",
 
  "512": "Brown Couch/couch/-1/-1/4/1750",
 
  "520": "Dark Couch/couch/-1/-1/4/2500",
 
  "528": "Wizard Couch/couch/-1/-1/4/4000",
 
  "536": "Woodsy Couch/couch/-1/-1/4/3000",
 
  "704": "Oak Dresser/dresser/-1/-1/4/5000",
 
  "709": "Walnut Dresser/dresser/-1/-1/4/5000",
 
  "714": "Birch Dresser/dresser/-1/-1/4/5000",
 
  "719": "Mahogany Dresser/dresser/-1/-1/4/7500",
 
  "724": "Coffee Table/table/2 2/2 1/2/1250",
 
  "727": "Stone Slab/table/2 2/2 1/2/1000",
 
  "800": "Winter Dining Table/long table/-1/-1/2/3500",
 
  "807": "Festive Dining Table/long table/-1/-1/2/3500",
 
  "814": "Mahogany Dining Table/long table/-1/-1/2/3000",
 
  "821": "Modern Dining Table/long table/-1/-1/2/2700",
 
  "1120": "Oak Table/table/-1/-1/1/750",
 
  "1122": "Walnut Table/table/-1/-1/1/750",
 
  "1124": "Birch Table/table/-1/-1/1/750",
 
  "1126": "Mahogany Table/table/-1/-1/1/1500",
 
  "1128": "Sun Table/table/-1/-1/1/2500",
 
  "1130": "Moon Table/table/-1/-1/1/2500",
 
  "1132": "Modern Table/table/-1/-1/1/1250",
 
  "1134": "Pub Table/table/-1/-1/1/800",
 
  "1136": "Luxury Table/table/-1/-1/1/2000",
 
  "1138": "Diviner Table/table/-1/-1/1/2250",
 
  "1140": "Neolithic Table/table/-1/-1/1/1800",
 
  "1142": "Puzzle Table/table/-1/-1/1/1500",
 
  "1144": "Winter Table/table/-1/-1/1/1250",
 
  "1146": "Candy Table/table/-1/-1/1/1000",
 
  "1148": "Luau Table/table/-1/-1/1/1000",
 
  "1150": "Dark Table/table/-1/-1/1/2000",
 
  "1216": "Oak Tea-Table/table/2 2/-1/1/750",
 
  "1218": "Walnut Tea-Table/table/2 2/-1/1/750",
 
  "1220": "Birch Tea-Table/table/2 2/-1/1/750",
 
  "1222": "Mahogany Tea-Table/table/2 2/-1/1/1500",
 
  "1224": "Modern Tea-Table/table/2 2/-1/1/1000",
 
  "1226": "Furniture Catalogue/table/2 2/-1/1/200000",
 
  "1280": "China Cabinet/other/3 3/3 1/1/6000",
 
  "1283": "Artist Bookcase/bookcase/-1/-1/1/1200",
 
  "1285": "Luxury Bookcase/bookcase/-1/-1/1/2000",
 
  "1287": "Modern Bookcase/bookcase/-1/-1/1/1600",
 
  "1289": "Dark Bookcase/bookcase/-1/-1/1/2000",
 
  "1291": "Ceramic Pillar/decor/1 3/1 1/1/250",
 
  "1292": "Gold Pillar/decor/1 3/1 1/1/450",
 
  "1293": "Industrial Pipe/decor/1 3/1 1/1/300",
 
  "1294": "Indoor Palm/decor/1 3/1 1/1/600",
 
  "1295": "Totem Pole/decor/1 3/1 1/1/750",
 
  "1296": "Manicured Pine/decor/1 3/1 1/1/500",
 
  "1297": "Topiary Tree/decor/1 3/1 1/1/500",
 
  "1298": "Standing Geode/decor/1 2/1 1/1/500",
 
  "1299": "Obsidian Vase/decor/1 2/1 1/1/500",
 
  "1300": "Singing Stone/decor/1 2/1 1/1/500",
 
  "1301": "Sloth Skeleton L/decor/1 2/1 1/1/500",
 
  "1302": "Sloth Skeleton M/decor/1 2/1 1/1/500",
 
  "1303": "Sloth Skeleton R/decor/1 2/1 1/1/500",
 
  "1304": "Skeleton/decor/1 2/1 1/1/500",
 
  "1305": "Chicken Statue/decor/1 2/1 1/1/500",
 
  "1306": "Leah's Sculpture/decor/1 2/1 1/1/500",
 
  "1307": "Dried Sunflowers/decor/1 2/1 1/1/500",
 
  "1308": "Catalogue/decor/1 2/1 1/1/30000",
 
  "1309": "Sam's Boombox/decor/1 2/1 1/1/500",
 
  "1362": "Small Plant/decor/1 1/1 1/1/250",
 
  "1363": "Table Plant/decor/1 1/1 1/1/250",
 
  "1364": "Decorative Bowl/decor/1 1/1 1/1/250",
 
  "1365": "Futan Bear/decor/1 1/1 1/1/1500",
 
  "1366": "Globe/decor/1 1/1 1/1/750",
 
  "1367": "Model Ship/decor/1 1/1 1/1/750",
 
  "1368": "Small Crystal/decor/1 1/1 1/1/750",
 
  "1369": "Decorative Lantern/decor/1 1/1 1/1/500",
 
  "1376": "House Plant/decor/1 2/1 1/1/250",
 
  "1377": "House Plant/decor/1 2/1 1/1/250",
 
  "1378": "House Plant/decor/1 2/1 1/1/250",
 
  "1379": "House Plant/decor/1 2/1 1/1/250",
 
  "1380": "House Plant/decor/1 2/1 1/1/250",
 
  "1381": "House Plant/decor/1 2/1 1/1/250",
 
  "1382": "House Plant/decor/1 2/1 1/1/250",
 
  "1383": "House Plant/decor/1 2/1 1/1/250",
 
  "1384": "House Plant/decor/1 2/1 1/1/250",
 
  "1385": "House Plant/decor/1 2/1 1/1/250",
 
  "1386": "House Plant/decor/1 2/1 1/1/250",
 
  "1387": "House Plant/decor/1 2/1 1/1/250",
 
  "1388": "House Plant/decor/1 2/1 1/1/250",
 
  "1389": "House Plant/decor/1 2/1 1/1/250",
 
  "1390": "House Plant/decor/1 2/1 1/1/250",
 
  "1391": "Oak End Table/table/1 2/1 1/2/500",
 
  "1393": "Walnut End Table/table/1 2/1 1/2/500",
 
  "1395": "Birch End Table/table/1 2/1 1/2/500",
 
  "1397": "Mahogany End Table/table/1 2/1 1/2/1000",
 
  "1399": "Modern End Table/table/1 2/1 1/1/800",
 
  "1400": "Grandmother End Table/table/1 2/1 1/1/1000",
 
  "1401": "Winter End Table/table/1 2/1 1/1/800",
 
  "1402": "Calendar/painting/1 2/1 2/1/2000",
 
  "1440": "Tree of the Winter Star/decor/3 5/3 2/1/5000",
 
  "1443": "Country Lamp/lamp/-1/-1/1/500",
 
  "1445": "Box Lamp/lamp/-1/-1/1/750",
 
  "1447": "Modern Lamp/lamp/-1/-1/1/750",
 
  "1449": "Classic Lamp/lamp/-1/-1/1/1000",
 
  "1451": "Red Rug/rug/-1/-1/2/1000",
 
  "1456": "Patchwork Rug/rug/-1/-1/2/800",
 
  "1461": "Dark Rug/rug/-1/-1/2/2000",
 
  "1466": "Budget TV/decor/2 3/2 2/1/750",
 
  "1468": "Plasma TV/decor/3 3/3 1/1/4500",
 
  "1539": "'The Muzzamaroo'/painting/-1/-1/1/1000",
 
  "1541": "'A Night On Eco-Hill'/painting/-1/-1/1/1000",
 
  "1543": "'Pathways'/painting/-1/-1/1/750",
 
  "1545": "'Burnt Offering'/painting/-1/-1/1/1000",
 
  "1547": "'Queen of the Gem Sea'/painting/3 2/3 2/1/1200",
 
  "1550": "'Vanilla Villa'/painting/-1/-1/1/500",
 
  "1552": "'Primal Motion'/painting/-1/-1/1/1500",
 
  "1554": "'Jade Hills'/painting/3 2/3 2/1/1750",
 
  "1557": "'Sun #44'/painting/-1/-1/1/800",
 
  "1559": "Wallflower Pal/painting/-1/-1/1/500",
 
  "1561": "'Spires'/painting/-1/-1/1/800",
 
  "1563": "'Highway 89'/painting/-1/-1/1/800",
 
  "1565": "Calico Falls/painting/-1/-1/1/750",
 
  "1567": "Needlepoint Flower/painting/1 2/1 2/1/500",
 
  "1600": "Skull Poster/painting/1 2/1 2/1/500",
 
  "1601": "'Sun #45'/painting/1 2/1 2/1/350",
 
  "1602": "'Little Tree'/painting/1 2/1 2/1/350",
 
  "1603": "'Blueberries'/painting/1 2/1 2/1/250",
 
  "1604": "'Blue City'/painting/1 2/1 2/1/250",
 
  "1605": "Little Photos/painting/1 2/1 2/1/250",
 
  "1606": "'Dancing Grass'/painting/1 2/1 2/1/400",
 
  "1607": "'VGA Paradise'/painting/2 2/2 2/1/1200",
 
  "1609": "J. Cola Light/painting/3 2/3 2/1/1000",
 
  "1612": "'Kitemaster '95'/painting/-1/-1/1/600",
 
  "1614": "Basic Window/window/-1/-1/1/300",
 
  "1616": "Small Window/window/-1/-1/1/300",
 
  "1618": "Red Cottage Rug/rug/-1/-1/2/750",
 
  "1623": "Green Cottage Rug/rug/-1/-1/2/750",
 
  "1628": "Monster Rug/rug/2 2/2 2/1/1250",
 
  "1630": "Boarded Window/painting/1 2/1 2/1/400",
 
  "1664": "Mystic Rug/rug/-1/-1/2/1250",
 
  "1669": "Lg. Futan Bear/decor/2 2/2 1/1/4000",
 
  "1733": "Junimo Plush/decor/2 2/2 1/1/4000",
 
  "1671": "Bear Statue/decor/2 4/2 1/1/4000",
 
  "1673": "Porthole/window/-1/-1/1/700",
 
  "1675": "Anchor/painting/1 2/1 2/1/750",
 
  "1676": "World Map/painting/-1/-1/1/500",
 
  "1678": "Ornate Window/window/-1/-1/1/900",
 
  "1680": "Floor TV/decor/2 2/2 1/1/700",
 
  "1682": "Carved Window/window/-1/-1/1/900",
 
  "1737": "Nautical Rug/rug/-1/-1/2/1250",
 
  "1742": "Burlap Rug/rug/2 2/2 2/1/350",
 
  "1744": "Tree Column/decor/1 3/1 1/1/1000",
 
  "1745": "L. Light String/painting/2 1/2 1/1/400",
 
  "1747": "S. Pine/decor/1 2/1 1/1/500",
 
  "1748": "Bonsai Tree/decor/1 2/1 1/1/800",
 
  "1749": "Metal Window/window/-1/-1/1/800",
 
  "1751": "Candle Lamp/lamp/-1/-1/1/1000",
 
  "1753": "Miner's Crest/painting/2 2/2 2/1/1000",
 
  "1755": "Bamboo Mat/rug/2 1/2 1/2/250",
 
  "1758": "Ornate Lamp/lamp/-1/-1/1/1050",
 
  "1777": "Woodcut Rug/rug/2 2/2 2/1/800",
 
  "1811": "Hanging Shield/painting/1 1/1 1/1/500",
 
  "1812": "Monster Danglers/painting/2 1/2 1/1/1000",
 
  "1814": "Ceiling Flags/painting/1 1/1 1/1/50",
 
  "1838": "'Red Eagle'/painting/-1/-1/1/1000",
 
  "1840": "'Portrait Of A Mermaid'/painting/-1/-1/1/1000",
 
  "1842": "'Solar Kingdom'/painting/-1/-1/1/1000",
 
  "1844": "'Clouds'/painting/-1/-1/1/1000",
 
  "1846": "'1000 Years From Now'/painting/-1/-1/1/1000",
 
  "1848": "'Three Trees'/painting/-1/-1/1/1000",
 
  "1850": "'The Serpent'/painting/-1/-1/1/1000",
 
  "1852": "'Tropical Fish #173'/painting/-1/-1/1/1000",
 
  "1854": "'Land Of Clay'/painting/-1/-1/1/1000",
 
  "1792": "Brick Fireplace/fireplace/-1/-1/1/1000",
 
  "1794": "Stone Fireplace/fireplace/-1/-1/1/1500",
 
  "1796": "Iridium Fireplace/fireplace/-1/-1/1/15000",
 
  "1798": "Stove Fireplace/fireplace/-1/-1/1/3000",
 
  "1800": "Monster Fireplace/fireplace/-1/-1/1/25000",
 
  "1802": "My First Painting/painting/-1/-1/1/500",
 
  "1866": "Elegant Fireplace/fireplace/-1/-1/1/4000",
 
  "1900": "Pirate Flag/painting/-1/-1/1/4000",
 
  "1902": "Pirate Rug/rug/-1/-1/2/4000",
 
  "1964": "Bone Rug/rug/-1/-1/2/1000",
 
  "1971": "Butterfly Hutch/decor/2 3/2 1/1/50000/2",
 
  "1907": "Strawberry Decal/painting/-1/-1/1/2500",
 
  "1909": "Fruit Salad Rug/rug/-1/-1/2/4000",
 
  "1914": "Night Sky Decal #1/painting/1 2/1 2/1/750",
 
  "1978": "Snowy Rug/rug/-1/-1/2/1000",
 
  "1915": "Night Sky Decal #2/painting/1 2/1 2/1/750",
 
  "1916": "Night Sky Decal #3/painting/1 2/1 2/1/750",
 
  "1952": "'The Brave Little Sapling'/painting/1 2/1 2/1/400",
 
  "1953": "'Mysterium'/painting/1 2/1 2/1/400",
 
  "1954": "'Journey Of The Prairie King: The Motion Picture'/painting/1 2/1 2/1/400",
 
  "1955": "'Wumbus'/painting/1 2/1 2/1/400",
 
  "1956": "'The Zuzu City Express'/painting/1 2/1 2/1/400",
 
  "1957": "'The Miracle At Coldstar Ranch'/painting/1 2/1 2/1/400",
 
  "1958": "'Natural Wonders: Exploring Our Vibrant World'/painting/1 2/1 2/1/400",
 
  "1959": "'It Howls In The Rain'/painting/1 2/1 2/1/400",
 
  "1960": "Indoor Hanging Basket/painting/1 2/1 2/1/400",
 
  "1961": "Winter Tree Decal/painting/1 2/1 2/1/400",
 
  "1760": "Small Junimo Plush/decor/1 1/1 1/1/1500",
 
  "1761": "Small Junimo Plush/decor/1 1/1 1/1/1500",
 
  "1762": "Small Junimo Plush/decor/1 1/1 1/1/1500",
 
  "1763": "Small Junimo Plush/decor/1 1/1 1/1/1500",
 
  "1764": "Futan Rabbit/decor/1 1/1 1/1/1500",
 
  "1371": "Wumbus Statue/decor/2 3/2 1/1/500",
 
  "1373": "Bobo Statue/decor/2 3/2 1/1/500",
 
  "1375": "Purple Serpent Statue/decor/1 3/1 1/1/500",
 
  "1471": "Green Serpent Statue/decor/1 3/1 1/1/500",
 
  "985": "Long Palm/decor/1 4/1 1/1/500",
 
  "984": "Long Cactus/decor/1 3/1 1/1/500",
 
  "986": "Exotic Tree/decor/3 5/3 1/1/500",
 
  "989": "Deluxe Tree/decor/3 5/3 1/1/500",
 
  "1917": "Wall Pumpkin/painting/1 2/1 2/1/750",
 
  "1918": "Small Wall Pumpkin/painting/1 2/1 2/1/750",
 
  "2048": "Bed/bed/2 4/2 3/1/5000",
 
  "2052": "Double Bed/bed double/3 4/3 3/1/5000",
 
  "2058": "Starry Double Bed/bed double/3 4/3 3/1/5000",
 
  "2064": "Strawberry Double Bed/bed double/3 4/3 3/1/5000",
 
  "2070": "Pirate Double Bed/bed double/3 4/3 3/1/5000",
 
  "2076": "Child Bed/bed child/2 4/2 3/1/5000",
 
  "2176": "Tropical Bed/bed/2 4/2 3/1/5000",
 
  "2180": "Tropical Double Bed/bed double/3 4/3 3/1/5000",
 
  "2186": "Deluxe Red Double Bed/bed double/3 4/3 3/1/6000",
 
  "2192": "Modern Double Bed/bed double/3 4/3 3/1/6000",
 
  "2304": "Large Fish Tank/fishtank/4 3/4 1/1/5000",
 
  "2312": "Deluxe Fish Tank/fishtank/5 3/5 1/1/10000",
 
  "2322": "Small Fish Tank/fishtank/2 3/2 1/1/1000",
 
  "1228": "Oceanic Rug/rug/-1/-1/1/1250",
 
  "2326": "Tropical TV/decor/3 3/3 1/1/4500",
 
  "2329": "'Volcano' Photo/painting/-1/-1/1/500",
 
  "2331": "Jungle Torch/torch/-1/-1/1/500",
 
  "2393": "Palm Wall Ornament/painting/1 1/1 1/2/500",
 
  "134": "Tropical Chair/chair/-1/-1/4/3000",
 
  "2400": "Aquatic Sanctuary/fishtank/7 3/7 1/1/10000",
 
  "2414": "Modern Fish Tank/fishtank/2 3/2 1/1/10000",
 
  "2496": "Wild Double Bed/bed double/3 4/3 3/1/6000",
 
  "2502": "Fisher Double Bed/bed double/3 4/3 3/1/6000",
 
  "2508": "Birch Double Bed/bed double/3 4/3 3/1/6000",
 
  "2514": "Exotic Double Bed/bed double/3 4/3 3/1/6000",
 
  "2418": "Lifesaver/painting/1 2/1 2/1/1000",
 
  "2419": "Foliage Print/painting/2 2/2 2/1/10000",
 
  "2421": "'Boat'/painting/2 2/2 2/1/10000",
 
  "2423": "'Vista'/painting/2 2/2 2/1/10000",
 
  "2425": "Wall Basket/painting/2 2/2 2/1/10000",
 
  "2427": "Decorative Trash Can/decor/1 2/1 1/1/500",
 
  "2396": "Iridium Krobus/decor/1 3/1 1/1/5000",
 
  "2332": "Gourmand Statue/decor/2 2/2 1/1/500",
 
  "2334": "Pyramid Decal/painting/2 2/2 2/1/10000",
 
  "2397": "Plain Torch/torch/-1/-1/1/500",
 
  "2398": "Stump Torch/torch/-1/-1/1/500",
 
  "1973": "Wall Flower/painting/1 3/1 3/1/500",
 
  "1974": "S. Wall Flower/painting/1 3/1 3/1/500",
 
  "1975": "Clouds Banner/painting/1 3/1 3/1/500",
 
  "1684": "Colorful Set/painting/1 2/1 2/1/500",
 
  "2624": "Pastel Banner/painting/1 3/1 3/1/500",
 
  "2625": "Winter Banner/painting/1 3/1 3/1/500",
 
  "2626": "Moonlight Jellies Banner/painting/1 3/1 3/1/500",
 
  "2627": "Jungle Decal/painting/1 3/1 3/1/500",
 
  "2628": "Jungle Decal/painting/1 3/1 3/1/500",
 
  "2629": "Jungle Decal/painting/1 3/1 3/1/500",
 
  "2630": "Jungle Decal/painting/1 3/1 3/1/500",
 
  "2631": "Starport Decal/painting/1 3/1 3/1/500",
 
  "2632": "Decorative Pitchfork/painting/1 3/1 3/1/500",
 
  "2633": "Wood Panel/painting/1 3/1 3/1/500",
 
  "2634": "Decorative Axe/painting/1 3/1 3/1/500",
 
  "2635": "Log Panel/painting/1 3/1 3/1/500",
 
  "2636": "Log Panel/painting/1 3/1 3/1/500",
 
  "1817": "Ceiling Leaves/painting/1 1/1 1/1/50",
 
  "1818": "Ceiling Leaves/painting/1 1/1 1/1/50",
 
  "1819": "Ceiling Leaves/painting/1 1/1 1/1/50",
 
  "1820": "Ceiling Leaves/painting/1 1/1 1/1/50",
 
  "1821": "Ceiling Leaves/painting/1 1/1 1/1/50",
 
  "1687": "Cloud Decal/painting/2 2/2 2/1/500",
 
  "1692": "Cloud Decal/painting/2 2/2 2/1/500",
 
  "2637": "Floor Divider R/rug/1 2/1 1/1/50",
 
  "2638": "Floor Divider L/rug/1 2/1 1/1/50",
 
  "2639": "Floor Divider R/rug/1 2/1 1/1/50",
 
  "2640": "Floor Divider L/rug/1 2/1 1/1/50",
 
  "2641": "Floor Divider R/rug/1 2/1 1/1/50",
 
  "2642": "Floor Divider L/rug/1 2/1 1/1/50",
 
  "2643": "Floor Divider R/rug/1 2/1 1/1/50",
 
  "2644": "Floor Divider L/rug/1 2/1 1/1/50",
 
  "2645": "Floor Divider R/rug/1 2/1 1/1/50",
 
  "2646": "Floor Divider L/rug/1 2/1 1/1/50",
 
  "2647": "Floor Divider R/rug/1 2/1 1/1/50",
 
  "2648": "Floor Divider L/rug/1 2/1 1/1/50",
 
  "2649": "Floor Divider R/rug/1 2/1 1/1/50",
 
  "2650": "Floor Divider L/rug/1 2/1 1/1/50",
 
  "2651": "Floor Divider R/rug/1 2/1 1/1/50",
 
  "2652": "Floor Divider L/rug/1 2/1 1/1/50",
 
  "2488": "Light Green Rug/rug/3 2/3 2/2/10000",
 
  "2584": "'Jade Hills Extended'/painting/4 2/4 2/1/6750",
 
  "2720": "Large Brown Couch/couch/4 2/4 1/4/5750",
 
  "2784": "Large Green Rug/rug/4 3/4 3/1/10000",
 
  "2790": "Icy Rug/rug/4 3/4 3/1/10000",
 
  "2794": "Old World Rug/rug/4 3/4 3/1/10000",
 
  "2798": "Large Red Rug/rug/4 3/4 3/1/10000",
 
  "2730": "'Frozen Dreams'/painting/2 2/2 2/1/6750",
 
  "2653": "Icy Banner/painting/1 3/1 3/1/500",
 
  "2654": "Wall Palm/painting/1 3/1 3/1/500",
 
  "2655": "Wall Cactus/painting/1 3/1 3/1/500",
 
  "2802": "Large Cottage Rug/rug/4 3/4 3/1/10000",
 
  "2732": "'Physics 101'/painting/2 2/2 2/1/6750",
 
  "2734": "Wall Sconce/sconce/-1/-1/1/500",
 
  "2736": "Wall Sconce/sconce/-1/-1/1/500",
 
  "2738": "Wall Sconce/sconce/-1/-1/1/1000",
 
  "2740": "Wall Sconce/sconce/-1/-1/1/500",
 
  "2748": "Wall Sconce/sconce/-1/-1/1/500",
 
  "2812": "Wall Sconce/sconce/-1/-1/1/500",
 
  "2750": "Wall Sconce/sconce/-1/-1/1/500",
 
  "2742": "Blossom Rug/rug/6 4/6 4/1/10000",
 
  "2870": "Funky Rug/rug/5 4/5 4/1/10000",
 
  "2875": "Modern Rug/rug/5 4/5 4/1/10000",
 
  "2814": "Squirrel Figurine/decor/1 1/1 1/1/500"
 
}
 
}
 
</syntaxhighlight>}}
 
  
==Format==
+
<ol>
 +
<li>Match weapons whose minimum mine level ([[#Format|field 10]]) is less than the current mine level.</li>
 +
<li>From that list, match weapons with a probability check based on the gap between the base mine level ([[#Format|field 9]]) and current mine level. The probability is a bell curve centered on the base mine level:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! Index
+
! level difference
! Field
+
! probability
! Example Value
 
 
|-
 
|-
|0
+
| 0
|Name
+
| 100%
|''S. Pine''
 
 
|-
 
|-
|1
+
| 5
|Type
+
| 92%
|''decor''
 
 
|-
 
|-
|2
+
| 10
|source rectangle (width &times; height)
+
| 71%
|''1 2''
 
 
|-
 
|-
|3
+
| 15
|Bounding Box (width &times; height)
+
| 46%
|''1 1''
 
 
|-
 
|-
|4
+
| 20
|Rotations
+
| 25%
|''1''
 
 
|-
 
|-
|5
+
| 25
|Price
+
| 4%
|''500''
 
|-
 
|6
 
|Name (in language files other than English)
 
|''Minipino''
 
 
|}
 
|}
 
+
The difference applies in both directions; for example, two weapons whose base levels are 5 below and 5 above the current level both have a 92% chance. (The probability is calculated with a [[wikipedia:Gaussian function|Gaussian function]] <code>e<sup>-(current mine level - base mine level)<sup>2</sup> / (2 * 12<sup>2</sup>)</sup></code>.)</li>
Values of "-1" in the <samp>Source Rectangle</samp> and <samp>Bounding Box</samp> fields correspond to the default values for the furniture type, calculated in <samp>Furniture.cs::getDefaultSourceRectForType()</samp> and <samp>Furniture.cs::getDefaultBoundingBoxForType()</samp>.  These functions use numbers that correspond to furniture type, also defined in <samp>Furniture.cs</samp>:
+
<li>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.)</li>
*chair = 0
+
<li>From the remaining list of weapons, randomly choose one to drop.</li>
*bench = 1
+
</ol>
*couch = 2
 
*armchair = 3
 
*dresser = 4
 
*long table = 5
 
*painting = 6
 
*lamp = 7
 
*decor = 8
 
*other = 9
 
*bookcase = 10
 
*table = 11
 
*rug = 12
 
*window = 13
 
*fireplace = 14
 
*bed = 15
 
*torch = 16
 
*sconce = 17
 
  
 
==See also==
 
==See also==
 
* [[Modding:Index]] for related content like [[Modding:Crop data|crops]], [[Modding:Fish data|fish]], [[Modding:Gift taste data|gift tastes]], and [[Modding:Recipe data|recipes]]
 
* [[Modding:Index]] for related content like [[Modding:Crop data|crops]], [[Modding:Fish data|fish]], [[Modding:Gift taste data|gift tastes]], and [[Modding:Recipe data|recipes]]
 +
 +
==References==
 +
<references />
  
 
[[Category:Modding]]
 
[[Category:Modding]]
  
 
[[ru:Модификации:Объекты]]
 
[[ru:Модификации:Объекты]]
 +
 +
==History==
 +
{{History|1.6|Objects are now stored in <samp>Data/Objects</samp> rather than <samp>Data/ObjectInformation</samp> and have a new format.}}
 +
{{History|1.6|Field 4 of hats is now used for tags, rather than displayName.}}
 +
{{History|1.6|Display name field is now used for all languages.}}
 +
{{History|1.6|Added Texture & texture index fields to all object data.}}
 +
{{History|1.6|All types of items now use string IDs.}}

Latest revision as of 05:00, 20 April 2024

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.objectData.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_item
For 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_iridium
Added 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/Objects (Data/ObjectInformation prior to 1.6), 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/Objects consists of a string→ObjectData dictionary (where ObjectData is defined in the game code in GameData.Objects.ObjectData). It has entries like this[1]:

"201": {
  "Name": "Complete Breakfast",
  "DisplayName": "[LocalizedText Strings\\Objects:CompleteBreakfast_Name]",
  "Description": "[LocalizedText Strings\\Objects:CompleteBreakfast_Description]",
  "Type": "Cooking",
  "Category": -7,
  "Price": 350,
  "Texture": null,
  "SpriteIndex": 201,
  "Edibility": 80,
  "IsDrink": false,
  "Buffs": [
    {
      "Id": "Food",
      "BuffId": null,
      "IconTexture": null,
      "IconSpriteIndex": 0,
      "Duration": 600,
      "IsDebuff": false,
      "GlowColor": null,
      "CustomAttributes": {
        "FarmingLevel": 2.0,
        "FishingLevel": 0.0,
        "MiningLevel": 0.0,
        "LuckLevel": 0.0,
        "ForagingLevel": 0.0,
        "MaxStamina": 50.0,
        "MagneticRadius": 0.0,
        "Speed": 0.0,
        "Defense": 0.0,
        "Attack": 0.0
      },
      "CustomFields": null
    }
  ],
  "GeodeDropsDefaultItems": false,
  "GeodeDrops": null,
  "ArtifactSpotChances": null,
  "ExcludeFromFishingCollection": false,
  "ExcludeFromShippingCollection": false,
  "ExcludeFromRandomSale": false,
  "ContextTags": [
    "color_yellow",
    "food_breakfast"
  ],
  "CustomFields": null
  }

For each entry in the data asset:

  • The key (before the colon) is the unqualified item ID and its sprite index within the object spritesheet (saved as ParentSheetIndex in-code).
  • The value (after the colon) is the data pertaining to that object, with the fields listed below. The objects with keys 516–534 (Ring.ringLowerIndexRange through Ring.ringUpperIndexRange) and 801 (wedding ring) are hardcoded as rings.

Field values are described below (Copied from Modding:Migrate to Stardew Valley 1.6):

Basic info

field purpose
Name The internal item name.
DisplayName
Description
A tokenizable string for the item's in-game display name and description.
Type The item's general type, like Arch (artifact) or Minerals. The vanilla types are: Litter, Basic, Minerals, Quest, asdf, Crafting, Arch, fish, Cooking, Seeds, Ring, interactive
Category The item category.
Price (Optional) The price when sold by the player. This is not the price when bought from a shop. Default 0.

Appearance

field purpose
Texture The asset name for the texture containing the item's sprite. Defaults to Maps/springobjects.
SpriteIndex The sprite's index within the Texture, where 0 is the top-left sprite.

Edibility

field purpose
Edibility (Optional) A numeric value that determines how much energy (edibility × 2.5) and health (edibility × 1.125) is restored when this item is eaten. An item with an edibility of -300 can't be eaten, values from -299 to -1 reduce health and energy, and zero can be eaten but doesn't change health/energy. Default -300.
IsDrink (Optional) Whether to drink the item instead of eating it. Default false.
Buffs (Optional) The buffs to apply to the player when this item is eaten, if any. Default none.

This consists of a list of models with these fields:

field purpose
Id The unique string ID for this entry within the list.
Duration (Optional if BuffId is set) The buff duration measured in in-game minutes. This can be set to -2 for a buff that should last for the rest of the day.
BuffId (Optional) The unique ID of a buff from Data/Buffs to apply, or null to ignore Data/Buffs and set the ID to food or drink depending on the item's IsDrink field.

If a buff from Data/Buffs is applied and you also specify other fields, here's how the buff data is combined:

field result
Duration
IconTexture
SpriteIndex
GlowColor
If specified, the value in Data/Objects is used instead of the one in Data/Buffs. If omitted, defaults to the value from Data/Buffs.
CustomAttributes The values from both entries are combined (e.g. +1 speed in Data/Objects and +1 speed in Data/Buffs results in +2 speed).
IsDebuff The value in Data/Objects is used.
IsDebuff (Optional) Whether this buff counts as a debuff, so its duration should be halved when wearing a Sturdy Ring. Default false.
IconTexture (Optional) The asset name for the icon texture to load. This must contain one or more 16x16 icons in a grid of any size. If omitted, the game will draw a default icon based on the BuffId and CustomAttributes fields.
SpriteIndex (Optional) The buff's icon index within the IconTexture, where 0 is the top-left icon. Default 0.
GlowColor (Optional) The glow color to apply to the player. See color format. Default none.
CustomAttributes The custom buff attributes to apply, if any.

This consists of a model with any combination of these fields:

field purpose
FarmingLevel
FishingLevel
ForagingLevel
LuckLevel
MiningLevel
(Optional) An amount applied to the matching skill level while the buff is active. This can be negative for a debuff. Default 0.
Attack
Defense
MagneticRadius
MaxStamina
Speed
(Optional) An amount applied to the player's attack, defense, magnetic radius, maximum stamina, or speed while the buff is active. This can be negative for a debuff. Default 0.
CustomFields (Optional) The custom fields for this entry.


Notes

  • Prior to 1.6, items that have a number in index 6 (the "Crafting" field) showed buggy information in-game (e.g., Bean Hotpot prior to version 1.4). Items that had a number in the "Attack" field displayed 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/BigCraftables (Data/BigCraftablesInformation prior to 1.6), 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/BigCraftables consists of a string → model lookup, where...

  • The key is the unqualified item ID.
  • The value is a model with the fields listed below.
  "19": {
    "Name": "Oil Maker",
    "DisplayName": "[LocalizedText Strings\\BigCraftables:OilMaker_Name]",
    "Description": "[LocalizedText Strings\\BigCraftables:OilMaker_Description]",
    "Price": 50,
    "Fragility": 0,
    "CanBePlacedOutdoors": true,
    "CanBePlacedIndoors": true,
    "IsLamp": false,
    "Texture": null,
    "SpriteIndex": 19,
    "ContextTags": null,
    "CustomFields": null
  }

Field values are described below (Copied from Modding:Migrate to Stardew Valley 1.6):

Basic info

field purpose
Name The internal item name.
DisplayName
Description
A tokenizable string for the item's in-game display name and description.
Price (Optional) The price when sold by the player. This is not the price when bought from a shop. Default 0.

Behavior

field purpose
Fragility (Optional) How the item can be picked up. The possible values are 0 (pick up with any tool), 1 (destroyed if hit with an axe/hoe/pickaxe, or picked up with any other tool), or 2 (can't be removed once placed). Default 0.
CanBePlacedIndoors
CanBePlacedOutdoors
(Optional) Whether the item can be placed indoors or outdoors. Default true.
IsLamp (Optional) Whether this is a lamp and should produce light when dark. Default false.

Appearance

field purpose
Texture (Optional) The asset name for the texture containing the item's sprite. Defaults to TileSheets/Craftables.
SpriteIndex (Optional) The sprite's index within the Texture, where 0 is the top-left sprite.

Context tags

field purpose
ContextTags (Optional) The custom context tags to add for this item (in addition to the tags added automatically based on the other object data). This is formatted as a list; for example:
"ContextTags": [ "light_source", "torch_item" ]

Advanced

field purpose
CustomFields (Optional) The custom fields for this entry.

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 Accessory (unimplemented).
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:
type meaning
0 chair
1 bench
2 couch
3 armchair
4 dresser
5 long table
6 painting
7 lamp
8 decor
9 other
10 bookcase
11 table
12 rug
13 window
14 fireplace
15 bed
16 torch
17 sconce
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 placement restriction Where the furniture can be placed.
value meaning
-1 default (uses furniture type)
0 indoors-only
1 outdoors-only
2 indoors or outdoors
7 display name The translated furniture name (in non-English data assets only).

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"

Hats from the base game use the hat's ParentSheetIndex as its item ID. For each entry in the data asset, the key is the hat's item ID, and the value is a slash-delimited string with these fields:

index field effect
0 name The internal item name.
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 tags A space-separated list of "tags". These are separate from context tags, and used to contain miscellaneous information. Currently, the only tag used by the game is Prismatic, which marks a hat as prismatic and causes it to cycle through colors.
5 display name The translated item name shown in-game.
6 sprite index The index in the hat spritesheet used to display this hat.
7 texture name The name of the game texture to use for the hat. If empty, the game will use the default hat sheet Characters/Farmer/hats

Hats have a hard-coded category of -95 (HatDataDefinition.cs::GetData)

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
3
min damage
max damage
The 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
10
base mine level
min mine level
The 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
10
base mine level
min mine level
The 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[2]:

  1. Match weapons whose minimum mine level (field 10) is less than the current mine level.
  2. 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%
    The difference applies in both directions; for example, two weapons whose base levels are 5 below and 5 above the current level both have a 92% chance. (The probability is calculated with a Gaussian function e-(current mine level - base mine level)2 / (2 * 122).)
  3. 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.)
  4. From the remaining list of weapons, randomly choose one to drop.

See also

References

  1. See Data/Objects.xnb
  2. See Utility.getUncommonItemForThisMineLevel in the game code.

History

  • 1.6: Objects are now stored in Data/Objects rather than Data/ObjectInformation and have a new format.
  • 1.6: Field 4 of hats is now used for tags, rather than displayName.
  • 1.6: Display name field is now used for all languages.
  • 1.6: Added Texture & texture index fields to all object data.
  • 1.6: All types of items now use string IDs.