Changes

Jump to navigation Jump to search
m
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===
 
===Data format===
The object data in <samp>Data/ObjectInformation</samp> consists of an integer→string dictionary with entries like this:
+
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">
 
<syntaxhighlight lang="json">
   "18": "Daffodil/30/0/Basic -81/Daffodil/A traditional spring flower that makes a nice gift."
+
"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>
 
</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 (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"
 
{| class="wikitable"
 
|-
 
|-
! index
   
! field
 
! field
! effect
+
! 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
 
|-
 
|-
!style="text-align: left;" colspan="3"| all objects
+
| <samp>Category</samp>
 +
| The [[Modding:Items#Categories|item category]].
 
|-
 
|-
| 0
+
| <samp>Price</samp>
| name
+
| ''(Optional)'' The price when sold by the player. This is not the price when bought from a shop. Default 0.
| The internal item name (and display name in English).
+
|}
 +
 
 +
====Appearance====
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! purpose
 
|-
 
|-
| 1
+
| <samp>Texture</samp>
| price
+
| The asset name for the texture containing the item's sprite. Defaults to <samp>Maps/springobjects</samp>.
| The gold price of the item when sold by the player.
   
|-
 
|-
| 2
+
| <samp>SpriteIndex</samp>
| edibility
+
| The sprite's index within the <samp>Texture</samp>, where 0 is the top-left sprite.
| 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.
+
|}
   −
This is ignored for rings.
+
====Edibility====
 +
{| class="wikitable"
 
|-
 
|-
| 3
+
! field
| type and category
+
! purpose
| &#32;
+
|-
* For a ring: the value <samp>Ring</samp>. Rings have a hardcoded category of -96 (<samp>Object.ringCategory</samp>).
+
| <samp>Edibility</samp>
* For other objects: the item's type (string) and category (negative integer), separated by a space like <samp>Fish -4</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.
 
|-
 
|-
| 4
+
| <samp>IsDrink</samp>
| display name
+
| ''(Optional)'' Whether to drink the item instead of eating it. Default false.
| The translated item name.
   
|-
 
|-
| 5
+
| <samp>Buffs</samp>
| description
+
| ''(Optional)'' The buffs to apply to the player when this item is eaten, if any. Default none.
| The translated item description.
+
 
 +
This consists of a list of models with these fields:
 +
{| class="wikitable"
 
|-
 
|-
!style="text-align: left;" colspan="3"| food & drink only
+
! field
 +
! purpose
 
|-
 
|-
| 6
+
| <samp>Id</samp>
| miscellaneous
+
| The [[Modding:Common data field types#Unique string ID|unique string ID]] for this entry within the list.
| &#32;
  −
* 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
+
| <samp>Duration</samp>
| buffs
+
| ''(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.
| The bonuses to apply to the player's attribute when the item is consumed. This consists of a space-delimited list of these numbers:
  −
{|class="wikitable"
   
|-
 
|-
! index
+
| <samp>BuffId</samp>
! buff
+
| ''(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"
 
|-
 
|-
| 0
+
! field
| [[Skills#Farming|farming]]
+
! result
 
|-
 
|-
| 1
+
| <samp>Duration</samp><br /><samp>IconTexture</samp><br /><samp>SpriteIndex</samp><br /><samp>GlowColor</samp>
| [[Skills#Fishing|fishing]]
+
| 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>.
 
|-
 
|-
| 2
+
| <samp>CustomAttributes</samp>
| [[Skills#Mining|mining]]
+
| 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).
 
|-
 
|-
| 3
+
| <samp>IsDebuff</samp>
| ''unused''
+
| The value in <samp>Data/Objects</samp> is used.
 +
|}
 
|-
 
|-
| 4
+
| <samp>IsDebuff</samp>
| [[Luck|luck]]
+
| ''(Optional)'' Whether this buff counts as a debuff, so its duration should be halved when wearing a Sturdy Ring. Default false.
 
|-
 
|-
| 5
+
| <samp>IconTexture</samp>
| [[Skills#Foraging|foraging]]
+
| ''(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.
 
|-
 
|-
| 6
+
| <samp>SpriteIndex</samp>
| ''unused''
+
| ''(Optional)'' The buff's icon index within the <samp>IconTexture</samp>, where 0 is the top-left icon. Default 0.
 
|-
 
|-
| 7
+
| <samp>GlowColor</samp>
| max [[energy]]
+
| ''(Optional)'' The glow color to apply to the player. See [[#Color fields|color format]]. Default none.
 
|-
 
|-
| 8
+
| <samp>CustomAttributes</samp>
| [[magnetism]]
+
| The custom buff attributes to apply, if any.
 +
 
 +
This consists of a model with any combination of these fields:
 +
{| class="wikitable"
 
|-
 
|-
| 9
+
! field
| [[speed]]
+
! purpose
 
|-
 
|-
| 10
+
| <samp>FarmingLevel</samp><br /><samp>FishingLevel</samp><br /><samp>ForagingLevel</samp><br /><samp>LuckLevel</samp><br /><samp>MiningLevel</samp>
| [[defense]]
+
| ''(Optional)'' An amount applied to the matching [[Skills|skill level]] while the buff is active. This can be negative for a debuff. Default 0.
 
|-
 
|-
| 11
+
| <samp>Attack</samp><br /><samp>Defense</samp><br /><samp>MagneticRadius</samp><br /><samp>MaxStamina</samp><br /><samp>Speed</samp>
| [[attack]]
+
| ''(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.
 
|}
 
|}
 
|-
 
|-
| 8
+
| <samp>CustomFields</samp>
| buff duration
+
| ''(Optional)'' The [[#Custom data fields|custom fields]] for this entry.  
| 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.
+
|}
 
|}
 
|}
 +
    
===Notes===
 
===Notes===
* 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).
+
* 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).
* Named [[buffs]] (like [[Oil of Garlic]], [[Life Elixir]], or [[Tipsy]]) are implemented in code and can't be set in the food buff fields.
+
* '''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.
 
* 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==
 
Big craftables are objects which can be placed in the world and are two tiles tall (instead of one like objects).
 
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/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 big craftables data in <samp>Data/BigCraftableInformation</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">
   "19": "Oil Maker/50/-300/Crafting -9/Makes gourmet truffle oil./true/true/0/Oil Maker"
+
   "511": "Dark Boots/Made from thick black leather./250/4/2/7"
 
</syntaxhighlight>
 
</syntaxhighlight>
   Line 356: Line 746:  
|-
 
|-
 
| 1
 
| 1
| price
+
| description
| The gold price when sold by the player.
+
| The translated item description shown in-game.
 
|-
 
|-
 
| 2
 
| 2
| edibility
+
| price
| See edibility for [[#Objects|object data]]. Always set to <samp>-300</samp> (inedible) for vanilla items.
+
| '''Unused.''' The actual price is calculated as <samp>(''added defence'' × 100) + (''added immunity'' × 100)</samp>.
 
|-
 
|-
 
| 3
 
| 3
| type and category
+
| added defense
| See type and category for [[#Objects|object data]]. Always set to <samp>Crafting -9</samp> for vanilla items.
+
| A [[defense]] bonus applied to the player while equipped.
 
|-
 
|-
 
| 4
 
| 4
| description
+
| added immunity
| The translated item description shown in-game.
+
| An [[immunity]] bonus applied to the player while equipped.
 
|-
 
|-
 
| 5
 
| 5
| outdoors
+
| color index
| Whether the item can be placed outdoors (<samp>true</samp> or <samp>false</samp>).
+
| The index of the boot color in the <samp>Characters/Farmer/shoeColors</samp> spritesheet.
 
|-
 
|-
 
| 6
 
| 6
| indoors
+
| display name
| Whether the item can be placed indoors (<samp>true</samp> or <samp>false</samp>).
+
| The translated item name shown in-game (for non-English assets only).
|-
+
|}
| 7
+
 
| fragility
+
==Clothing==
| How the item is removed by tools. Possible values:
+
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"
 
{| class="wikitable"
 
|-
 
|-
! fragility
+
! index
 +
! field
 
! effect
 
! effect
 
|-
 
|-
| <samp>0</samp>
+
| 0
| Pick up with any tool.
+
| 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 <samp>-1</samp> to use the male index.
 +
|-
 +
| 5
 +
| price
 +
| The price when purchased from shops.
 
|-
 
|-
| <samp>1</samp>
+
| 6
| Destroyed if hit with an [[axe]], [[hoe]], or [[pickaxe]]. Any other tool will pick it up.
+
| 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, <samp>255 0 0</samp> for full red.
 
|-
 
|-
| <samp>2</samp>
+
| 7
| Indestructible. The item can't be removed once placed.
+
| dyeable
|}
+
| Whether the clothing can be [[Dyeing|dyed]] (<samp>true</samp> or <samp>false</samp>).
 
|-
 
|-
 
| 8
 
| 8
| is lamp
+
| Type
| 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).
+
| The clothing type. One of <samp>Pants</samp>, <samp>Shirt</samp>, or <s><samp>Accessory</samp></s> (unimplemented).
 
|-
 
|-
 
| 9
 
| 9
| display name
+
| extra data
| The translated display name (in non-English assets only).
+
| 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).
 
|}
 
|}
  −
===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]].
      
==Furniture==
 
==Furniture==
Line 513: Line 935:  
|-
 
|-
 
| 6
 
| 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
 
| display name
 
| The translated furniture name (in non-English data assets only).
 
| The translated furniture name (in non-English data assets only).
Line 529: Line 972:  
</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 539: Line 983:  
| 0
 
| 0
 
| name
 
| name
| The internal item name (and display name in English).
+
| The internal item name.
 
|-
 
|-
 
| 1
 
| 1
Line 554: Line 998:  
|-
 
|-
 
| 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
 
| display name
| The translated item name shown in-game (for non-English assets only).
+
| 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>Hats.cs::Load</samp>)
+
Hats have a hard-coded category of -95 (<samp>HatDataDefinition.cs::GetData</samp>)
   −
=Weapons=
+
==Tools==
This page explains how the game stores and parses weapon data. This is an advanced guide for mod developers.
+
[[Tools]] are items that can be swung or used by the player to perform some effect (e.g. dig dirt, chop trees, etc).
   −
==Raw data==
+
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>.
Weapon sprites are in <samp>TileSheets\Weapons.xnb</samp>, and weapon data (parsed by the <samp>MeleeWeapon</samp> constructor) is in <samp>Data\Weapons.xnb</samp>. The files can be [[Modding:Editing XNB files#unpacking|unpacked for editing]]. Here's the raw data as of {{version|1.5.1}} for reference:
     −
{{collapse|Data|content=<syntaxhighlight lang="json">
+
===Data format===
{
+
Tools are currently hardcoded and can't be edited by content packs.
  "0": "Rusty Sword/A rusty, dull old sword./2/5/1/0/0/0/3/-1/-1/0/.02/3",
  −
  "1": "Silver Saber/Plated with silver to deter rust./8/15/1/0/1/1/0/50/45/0/.02/3",
  −
  "2": "Dark Sword/It's glowing with vampire energy./30/45/1.5/-10/0/0/0/-1/-1/2/.04/3",
  −
  "3": "Holy Blade/It feels hopeful to wield./18/24/1.2/0/5/0/3/-1/-1/0/.02/3",
  −
  "4": "Galaxy Sword/It's unlike anything you've ever seen./60/80/1/8/0/0/0/-1/-1/0/.02/3",
  −
  "5": "Bone Sword/A very light piece of sharpened bone./20/30/.8/8/5/0/0/74/50/0/.02/3",
  −
  "6": "Iron Edge/A heavy broadsword./12/25/1.2/-4/0/1/3/44/-1/0/.02/3",
  −
  "7": "Templar's Blade/It once belonged to an honorable knight./22/29/1/0/10/1/3/90/50/0/0/3",
  −
  "8": "Obsidian Edge/It's incredibly sharp./30/45/1/-2/0/0/0/121/100/0/.02/3.2",
  −
  "9": "Lava Katana/A powerful blade forged in a pool of churning lava./55/64/1.2/0/0/3/0/-1/-1/2/.015/3.5",
  −
  "10": "Claymore/It's really heavy./20/32/1.3/-8/0/2/3/86/50/0/.02/3",
  −
  "11": "Steel Smallsword/A standard metal blade./4/8/1/4/0/0/0/26/-1/0/.02/3",
  −
  "12": "Wooden Blade/Not bad for a piece of carved wood./3/7/1/0/0/0/0/3/-1/0/.02/3",
  −
  "13": "Insect Head/Not very pleasant to wield./10/20/1/4/9/0/0/-1/-1/0/.04/3",
  −
  "14": "Neptune's Glaive/An heirloom from beyond the Gem Sea./18/35/1.4/-2/6/2/3/-1/-1/0/.02/3",
  −
  "15": "Forest Sword/Made powerful by forest magic./8/18/1/4/5/1/0/-1/-1/0/.02/3",
  −
  "16": "Carving Knife/A small, light blade./1/3/.5/0/0/0/1/18/-1/0/.04/3",
  −
  "17": "Iron Dirk/A common dagger./2/4/.5/0/0/0/1/62/50/0/.03/3",
  −
  "18": "Burglar's Shank/A weapon of choice for the swift and silent./7/12/.5/0/5/0/1/114/100/0/.04/3.5",
  −
  "19": "Shadow Dagger/When you hold the blade to your ear you can hear 1,000 souls shrieking./10/20/.5/0/0/0/1/80/50/0/.04/3",
  −
  "20": "Elf Blade/Only the nimble hands of an elf could craft this./3/5/.5/0/5/0/1/-1/-1/0/.04/3",
  −
  "21": "Crystal Dagger/The blade is made of purified quartz./4/10/1/0/10/0/1/-1/-1/0/.03/4",
  −
  "22": "Wind Spire/A swift little blade./1/5/1/0/0/0/1/-1/-1/0/.02/3.2",
  −
  "23": "Galaxy Dagger/It's unlike anything you've seen./30/40/1/3/0/0/1/-1/-1/0/.02/3",
  −
  "24": "Wood Club/A solid piece of wood, crudely chiseled into a club shape./9/16/1.5/-8/0/0/2/32/-1/0/.02/3",
  −
  "25": "Alex's Bat/The sweet spot is dented from Alex's famous Grand Slam./1/3/1/-8/0/0/2/-1/-1/0/.02/3",
  −
  "26": "Lead Rod/It's incredibly heavy./18/27/1.5/-16/0/0/2/56/50/1/.02/3",
  −
  "27": "Wood Mallet/The solid head packs a punch. Relatively light for a club./15/24/1.3/-4/1/0/2/68/50/0/.02/3",
  −
  "28": "The Slammer/An extremely heavy gavel that'll send foes flying./40/55/1.5/-12/0/0/2/128/100/2/.02/3",
  −
  "29": "Galaxy Hammer/It's made from an ultra-light material you've never seen before./70/90/1/-4/0/0/2/-1/-1/0/.02/3",
  −
  "30": "Sam's Old Guitar/It's seen better days./1/3/1/-6/0/0/2/-1/-1/0/.02/3",
  −
  "31": "Femur/An old, heavy bone caked in centuries of grime./6/11/1.5/-4/0/0/2/10/-1/0/.02/3",
  −
  "32": "Slingshot/Requires stones for ammo./1/3/1/308/0/0/4/-1/-1/0/.02/3",
  −
  "33": "Master Slingshot/Requires stones for ammo./1/3/1/308/0/0/4/-1/-1/0/.02/3",
  −
  "34": "Galaxy Slingshot/It looks really powerful./1/3/1/308/0/0/4/-1/-1/0/.02/3",
  −
  "35": "Elliott's Pencil/Elliott used this to write his book. It's sharp!/1/3/1/308/0/0/1/-1/-1/0/.02/3",
  −
  "36": "Maru's Wrench/A big, metal wrench. It smells like Maru./1/3/1/308/0/0/2/-1/-1/0/.02/3",
  −
  "37": "Harvey's Mallet/It brings back memories of Harvey's clinic./1/3/1/308/0/0/2/-1/-1/0/.02/3",
  −
  "38": "Penny's Fryer/Penny's favorite frying pan. There's some rubbery gunk stuck to the inside./1/3/1/308/0/0/2/-1/-1/0/.02/3",
  −
  "39": "Leah's Whittler/Leah's favorite tool for shaping driftwood./1/3/1/308/0/0/1/-1/-1/0/.02/3",
  −
  "40": "Abby's Planchette/It's made from fine marblewood./1/3/1/308/0/0/1/-1/-1/0/.02/3",
  −
  "41": "Seb's Lost Mace/One of Sebastian's medieval replicas./1/3/1/308/0/0/2/-1/-1/0/.02/3",
  −
  "42": "Haley's Iron/It's searing hot and smells like Haley's hair./1/3/1/308/0/0/0/-1/-1/0/.02/3",
  −
  "43": "Pirate's Sword/It looks like a pirate owned this once./8/14/1/4/0/0/3/40/-1/0/.02/3",
  −
  "44": "Cutlass/A finely crafted blade./9/17/1/4/0/0/0/-1/-1/0/.02/3",
  −
  "45": "Wicked Kris/The blade is made of an iridium alloy./24/30/.5/0/8/0/1/-1/-1/2/.06/3",
  −
  "46": "Kudgel/A brute's companion./27/40/1.6/-10/0/0/2/107/100/0/.02/3.1",
  −
  "47": "Scythe/It can cut grass into hay, if you've built a silo./1/3/1/0/0/0/0/-1/-1/0/.02/3",
  −
  "48": "Yeti Tooth/It's icy cold to the touch./26/42/1/0/0/4/0/-1/-1/0/.02/3.2",
  −
  "49": "Rapier/An elegant blade./15/25/1/4/0/0/0/100/95/2/.02/3",
  −
  "50": "Steel Falchion/Light and powerful./28/46/1/8/5/0/0/142/100/0/.02/3.4",
  −
  "51": "Broken Trident/It came from the sea, but it's still sharp./15/26/.5/0/8/0/1/-1/-1/2/.02/3",
  −
  "52": "Tempered Broadsword/It looks like it could withstand anything./29/44/1.2/-6/0/3/0/135/100/1/.02/3",
  −
  "53": "Golden Scythe/It's more powerful than a normal scythe./13/13/1/0/0/0/0/-1/-1/2/.02/4",
  −
  "54": "Dwarf Sword/It's ancient, but the blade never dulls./65/75/1/4/0/4/0/-1/-1/0/.02/3",
  −
  "55": "Dwarf Hammer/It emits a very faint whirring sound./75/85/1/-8/0/2/2/-1/-1/0/.02/3",
  −
  "56": "Dwarf Dagger/It's ancient, but the blade never dulls./32/38/1/3/0/6/1/-1/-1/0/.03/3",
  −
  "57": "Dragontooth Cutlass/The blade was forged from a magical tooth./75/90/1/0/0/0/0/-1/-1/0/.02/4",
  −
  "58": "Dragontooth Club/This club was crafted from a magical tooth./80/100/1.3/-8/0/0/2/-1/-1/0/.02/4",
  −
  "59": "Dragontooth Shiv/The blade was forged from a magical tooth./40/50/1/0/0/0/1/-1/-1/0/.05/5",
  −
  "60": "Ossified Blade/A large, sharp blade formed from bone./26/42/1.1/-4/0/1/0/142/100/0/.02/3",
  −
  "61": "Iridium Needle/The point is unbelievably sharp, even down to the atomic level./20/35/.5/0/0/0/1/-1/-1/0/.1/7",
  −
  "62": "Infinity Blade/The true form of the Galaxy Sword./80/100/1/8/0/2/0/-1/-1/0/.02/3",
  −
  "63": "Infinity Gavel/The true form of the Galaxy Hammer./100/120/1/-4/0/1/2/-1/-1/0/.02/3",
  −
  "64": "Infinity Dagger/The true form of the Galaxy Dagger./50/70/1/3/0/3/1/-1/-1/0/.06/3"
  −
}
  −
</syntaxhighlight>}}
     −
==Format==
+
==Weapons==
===Melee weapons===
+
[[Weapons]] are tools that can be used by the player to damage monsters.
The weapon data in <samp>Data\Weapons.xnb</samp> contains fifteen fields for melee weapons:
+
 
308/0/0/4/-1/-1/0/.02/3
+
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>.
{| class="wikitable"
+
 
 +
===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
 
! index
! example value
+
! field
! description
+
! effect
 
|-
 
|-
 
| 0
 
| 0
| ''Bone Sword''
   
| name
 
| name
 +
| The internal weapon name (and display name in English).
 
|-
 
|-
 
| 1
 
| 1
| ''A very light piece of sharpened bone.''
   
| description
 
| description
 +
| The translated item description shown in-game.
 
|-
 
|-
| 2
+
| 2<br />3
| ''20''
+
| min damage<br />max damage
| minimum damage ouput
+
| The minimum and maximum damage caused when hitting a monster with this weapon.
|-
  −
| 3
  −
| ''30''
  −
| maximum damage output
   
|-
 
|-
 
| 4
 
| 4
| ''.8''
+
| knockback
| knockback (weight) - determines how far the target will get pushed away when hit
+
| 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
| ''8''
+
| speed
| speed - determines how fast the user can attack
+
| 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
| ''5''
+
| added precision
| added precision - decreases the chance that a strike will cause no damage
+
| Reduces the chance that a strike will miss.
 
|-
 
|-
 
| 7
 
| 7
| ''0''
+
| added defence
| added defense - affects how much damage the user takes
+
| Reduces damage received by the player.
 
|-
 
|-
 
| 8
 
| 8
| ''0''
+
| type
| type ("0" for stabbing sword, "1" for dagger, "2" for club/hammer, "3" for slashing sword, "4" for slingshot)
+
| 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
+
| 9<br />10
| ''74''
+
| base mine level<br />min mine level
| The base mine level which affects the probability of [[#Mine container drops|mine container drops]].
+
| The base and minimum mine level, which affect [[#Mine container drops|mine container drops]].
|-
  −
| 10
  −
| ''50''
  −
| The minimum mine level for [[#Mine container drops|mine container drops]].
   
|-
 
|-
 
| 11
 
| 11
| ''0''
   
| added area of effect
 
| added area of effect
 +
| Slightly increases the area of effect.
 
|-
 
|-
 
| 12
 
| 12
| ''.02''
   
| critical chance
 
| critical chance
 +
| The chance of a critical hit, as a decimal value between 0 and 1.
 
|-
 
|-
 
| 13
 
| 13
| ''3''
+
| critical damage
| critical multiplier
+
| A multiplier applied to the damage for critical hit.
 
|-
 
|-
 
| 14
 
| 14
|  
+
| display name
| display name (non-English files only)
+
| The translated item name (in non-English assets only).
 
|}
 
|}
   −
Weapons have a hardcoded category of -98 (<samp>Object.weaponCategory</samp>).
+
; Slingshots
 
+
: {| class="wikitable"
===Slingshot===
  −
The [[slingshot]] has initial ID 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). All [[#Melee weapons|weapon fields]] must be specified in the weapon data to avoid errors, but only these are actually used for slingshots:
  −
 
  −
{| class="wikitable"
   
|-
 
|-
 
! index
 
! index
! example value
+
! field
! description
+
! effect
 
|-
 
|-
 
| 0
 
| 0
| ''Master Slingshot''
   
| name
 
| name
 +
| The internal weapon name (and display name in English).
 
|-
 
|-
 
| 1
 
| 1
| ''Requires stones for ammo.''
   
| description
 
| description
 +
| The translated item description shown in-game (for non-English assets only).
 +
|-
 +
| 2&ndash;8
 +
| ''unused''
 +
|
 
|-
 
|-
| 9
+
| 9<br />10
| ''74''
+
| base mine level<br />min mine level
| The base mine level which affects the probability of [[#Mine container drops|mine container drops]].
+
| The base and minimum mine level, which affect [[#Mine container drops|mine container drops]].
 
|-
 
|-
| 10
+
| 11&ndash;13
| ''50''
+
| ''unused''
| The minimum mine level for [[#Mine container drops|mine container drops]].
+
|
 
|-
 
|-
 
| 14
 
| 14
|  
+
| display name
| display name (non-English files only)
+
| The translated item description shown in-game (for non-English assets only).
 
|}
 
|}
   −
Slingshot damage is [[Slingshot#Ammunition|calculated dynamically]] regardless of the weapon data.
+
Weapons have a hardcoded category of -98 (<samp>Object.weaponCategory</samp>).
   −
==Mine container drops==
+
===Slingshot notes===
 +
* 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.
 +
 
 +
===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>:
 
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>:
   Line 774: Line 1,169:  
<li>From the remaining list of weapons, randomly choose one to drop.</li>
 
<li>From the remaining list of weapons, randomly choose one to drop.</li>
 
</ol>
 
</ol>
 +
 +
==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]]
    
==References==
 
==References==
 
<references />
 
<references />
  −
==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]]
      
[[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.}}
translators
8,439

edits

Navigation menu