Changes

Jump to navigation Jump to search
Removing my note about the torch_item context tag as the issue has been fixed in record time in the upcoming 1.6.9 update as per pathos (thank you, pathos!)
Line 6: Line 6:     
===Overview===
 
===Overview===
Stardew Valley 1.6 makes three major changes to how items work in the game:
+
As of Stardew Valley 1.6, there are a few important features of Items in the game.
   −
# Each item now has a string ID (<samp>ItemId</samp>) and a globally unique string ID (<samp>QualifiedItemId</samp>). The <samp>QualifiedItemId</samp> is auto-generated by prefixing the <samp>ItemId</samp> with the item type identifier.<p>For legacy reasons, the <samp>ItemId</samp> for vanilla items may not be globally unique. For example, Pufferfish (object 128) and Mushroom Box (bigcraftable 128) both have <samp>ItemId: 128</samp>. They can be distinguished by their <samp>QualifiedItemId</samp>, which are <samp>(O)128</samp> and <samp>(BC)128</samp> respectively.
+
# Each item as a string ID (<samp>ItemId</samp>) and a globally-unique string ID (<samp>QualifiedItemId</samp>). The <samp>QualifiedItemId</samp> is auto-generated by prefixing the <samp>ItemId</samp> with the item type identifier.<p>For legacy reasons, the <samp>ItemId</samp> for vanilla items may not be globally unique. For example, Pufferfish (object 128) and Mushroom Box (bigcraftable 128) both have <samp>ItemId: 128</samp>. They can be distinguished by their <samp>QualifiedItemId</samp>, which are <samp>(O)128</samp> and <samp>(BC)128</samp> respectively.
# Each item type now has an ''item data definition'' in the game code which tells the game how to handle it. [[#For C# mods|C# mods can add or edit definitions]]. Each definition has a unique prefix which is used in the qualified item IDs. The vanilla types are bigcraftables (<samp>(BC)</samp>), boots (<samp>(B)</samp>), farmhouse flooring (<samp>(FL)</samp>), furniture (<samp>(F)</samp>), hats (<samp>(H)</samp>), objects (<samp>(O)</samp>), pants (<samp>(P)</samp>), shirts (<samp>(S)</samp>), tools (<samp>(T)</samp>), wallpaper (<samp>(WP)</samp>), and weapons (<samp>(W)</samp>).</li>
+
# Each item type has an ''item data definition'' in the game code which tells the game how to handle it. [[#For C# mods|C# mods can add or edit definitions]]. Each definition has a unique prefix which is used in the qualified item IDs. The vanilla types are bigcraftables (<samp>(BC)</samp>), boots (<samp>(B)</samp>), farmhouse flooring (<samp>(FL)</samp>), furniture (<samp>(F)</samp>), hats (<samp>(H)</samp>), objects (<samp>(O)</samp>), pants (<samp>(P)</samp>), shirts (<samp>(S)</samp>), tools (<samp>(T)</samp>), wallpaper (<samp>(WP)</samp>), and weapons (<samp>(W)</samp>).</li>
 
# Custom items can now provide their own item texture, specified in a new field in the item data assets (see below). The item's <samp>ParentSheetIndex</samp> field is the index within that texture.
 
# Custom items can now provide their own item texture, specified in a new field in the item data assets (see below). The item's <samp>ParentSheetIndex</samp> field is the index within that texture.
   Line 59: Line 59:  
* Output: set field 2 to the unqualified item ID, and field 3 to one of <samp>true</samp> (bigcraftable) or <samp>false</samp> (object).
 
* Output: set field 2 to the unqualified item ID, and field 3 to one of <samp>true</samp> (bigcraftable) or <samp>false</samp> (object).
 
|-
 
|-
| [[#Custom fruit trees|<samp>Data/fruitTrees</samp>]]
+
| [[Modding:Fruit_trees|<samp>Data/FruitTrees</samp>]]
 
| &#32;
 
| &#32;
 
* Fruit: both supported.
 
* Fruit: both supported.
Line 77: Line 77:  
! data asset
 
! data asset
 
|-
 
|-
| [[Modding:Items|big craftables]]
+
| [[Modding:Items#Big_craftables|Big craftables]]
 
| <samp>(BC)</samp>
 
| <samp>(BC)</samp>
 
| <samp>Data/BigCraftables</samp><br /><small>Each item can set a custom texture name in the <samp>Texture</samp> field, and sprite index in the <samp>SpriteIndex</samp> field. The default texture is <samp>TileSheets/Craftables</samp>.</small>
 
| <samp>Data/BigCraftables</samp><br /><small>Each item can set a custom texture name in the <samp>Texture</samp> field, and sprite index in the <samp>SpriteIndex</samp> field. The default texture is <samp>TileSheets/Craftables</samp>.</small>
 
|-
 
|-
| boots
+
| [[Modding:Items#Boots|Boots]]
 
| <samp>(B)</samp>
 
| <samp>(B)</samp>
 
| <samp>Data/Boots</samp><br /><small>Each item can set a custom texture name in fields 9 (item) and 7 (shoe color), and sprite index in fields 8 (item) and 5 (shoe color). The default textures are <samp>Maps/springobjects</samp> (item) and <samp>Characters/Farmer/shoeColors</samp> (shoe color).</small>
 
| <samp>Data/Boots</samp><br /><small>Each item can set a custom texture name in fields 9 (item) and 7 (shoe color), and sprite index in fields 8 (item) and 5 (shoe color). The default textures are <samp>Maps/springobjects</samp> (item) and <samp>Characters/Farmer/shoeColors</samp> (shoe color).</small>
 
|-
 
|-
| [[Modding:Crop data|crops]]
+
| [[Modding:Crop data|Crops]]
 
| <small>''not technically an item type''</small>
 
| <small>''not technically an item type''</small>
 
| <samp>Data/Crops</samp><br /><small>Each crop can set a custom texture name and sprite index. The default texture is <samp>TileSheets/crops</samp>.</small>
 
| <samp>Data/Crops</samp><br /><small>Each crop can set a custom texture name and sprite index. The default texture is <samp>TileSheets/crops</samp>.</small>
 
|-
 
|-
| [[Modding:Fish data|fish (in fish tanks)]]
+
| [[Modding:Fish data|Fish (in fish tanks)]]
 
| <small>''not technically an item type''</small>
 
| <small>''not technically an item type''</small>
 
| <samp>Data/AquariumFish</samp><br /><small>Each fish can set a custom aquarium texture name in field 6, and sprite index in field 0. The default texture is <samp>LooseSprites/AquariumFish</samp>.</small>
 
| <samp>Data/AquariumFish</samp><br /><small>Each fish can set a custom aquarium texture name in field 6, and sprite index in field 0. The default texture is <samp>LooseSprites/AquariumFish</samp>.</small>
 
|-
 
|-
| [[Modding:Items|furniture]]
+
| [[Modding:Items#Furniture|Furniture]]
 
| <samp>(F)</samp>
 
| <samp>(F)</samp>
 
| <samp>Data/Furniture</samp><br /><small>Each item can set a custom texture name in field 9, and sprite index in field 8. The default texture is <samp>TileSheets/furniture</samp>.</small>
 
| <samp>Data/Furniture</samp><br /><small>Each item can set a custom texture name in field 9, and sprite index in field 8. The default texture is <samp>TileSheets/furniture</samp>.</small>
 
|-
 
|-
| fruit trees
+
| [[Modding:Fruit_trees|Fruit Trees]]
 
| <small>''not technically an item type''</small>
 
| <small>''not technically an item type''</small>
 
| <samp>Data/FruitTrees</samp><br /><small>Each fruit tree can set a custom texture name and sprite index. The default texture is <samp>TileSheets/fruitTrees</samp>.</small>
 
| <samp>Data/FruitTrees</samp><br /><small>Each fruit tree can set a custom texture name and sprite index. The default texture is <samp>TileSheets/fruitTrees</samp>.</small>
 
|-
 
|-
| [[Modding:Items|hats]]
+
| [[Modding:Items#Hats|Hats]]
 
| <samp>(H)</samp>
 
| <samp>(H)</samp>
 
| <samp>Data/Hats</samp><br /><small>Each item can set a custom texture name in field 7, and sprite index in field 6. The default texture is <samp>Characters/Farmer/hats</samp>.</small>
 
| <samp>Data/Hats</samp><br /><small>Each item can set a custom texture name in field 7, and sprite index in field 6. The default texture is <samp>Characters/Farmer/hats</samp>.</small>
 
|-
 
|-
| [[Modding:Items|objects]]
+
| [[Modding:Items#Objects|Objects]]
 
| <samp>(O)</samp>
 
| <samp>(O)</samp>
 
| <samp>Data/Objects</samp><br /><small>Each item can set a custom texture name in the <samp>Texture</samp> field, and sprite index in the <samp>SpriteIndex</samp> field. The default texture is <samp>Maps/springobjects</samp>.</small>
 
| <samp>Data/Objects</samp><br /><small>Each item can set a custom texture name in the <samp>Texture</samp> field, and sprite index in the <samp>SpriteIndex</samp> field. The default texture is <samp>Maps/springobjects</samp>.</small>
 
|-
 
|-
| [[#Custom pants|pants]]
+
| [[Modding:Items#Pants|Pants]]
 
| <samp>(P)</samp>
 
| <samp>(P)</samp>
 
| <samp>Data/pantsData</samp><br /><small>Each item can set a custom texture name in the <samp>Texture</samp> field, and sprite index in the <samp>SpriteIndex</samp> field. The default texture is <samp>Characters/Farmer/pants</samp>.</small>
 
| <samp>Data/pantsData</samp><br /><small>Each item can set a custom texture name in the <samp>Texture</samp> field, and sprite index in the <samp>SpriteIndex</samp> field. The default texture is <samp>Characters/Farmer/pants</samp>.</small>
 
|-
 
|-
| [[#Custom shirts|shirts]]
+
| [[Modding:Items#Shirts|Shirts]]
 
| <samp>(S)</samp>
 
| <samp>(S)</samp>
 
| <samp>Data/shirtData</samp><br /><small>Each item can set a custom texture name in the <samp>Texture</samp> field, and sprite index in the <samp>SpriteIndex</samp> field. The default texture is <samp>Characters/Farmer/shirts</samp>.</small>
 
| <samp>Data/shirtData</samp><br /><small>Each item can set a custom texture name in the <samp>Texture</samp> field, and sprite index in the <samp>SpriteIndex</samp> field. The default texture is <samp>Characters/Farmer/shirts</samp>.</small>
Line 131: Line 131:  
</pre>
 
</pre>
 
|-
 
|-
| [[#Custom tools|tools]]
+
| [[#Custom tools|Tools]]
 
| <samp>(T)</samp>
 
| <samp>(T)</samp>
 
| <samp>Data/Tools</samp><br /><small>Each item can set a custom texture name in the <samp>Texture</samp> field, and sprite index in the <samp>SpriteIndex</samp> field. The vanilla tools use the <samp>TileSheets/Tools</samp> texture.</small>
 
| <samp>Data/Tools</samp><br /><small>Each item can set a custom texture name in the <samp>Texture</samp> field, and sprite index in the <samp>SpriteIndex</samp> field. The vanilla tools use the <samp>TileSheets/Tools</samp> texture.</small>
 
|-
 
|-
| Wallpaper & floorpaper
+
| Wallpaper & flooring
 
| <samp>(WP)</samp> and <samp>(FL)</samp>
 
| <samp>(WP)</samp> and <samp>(FL)</samp>
 
| <samp>Data/AdditionalWallpaperFlooring</samp><br /><small>See [[Modding:Migrate to Stardew Valley 1.5.5#In the furniture catalogue|format docs]].</small>
 
| <samp>Data/AdditionalWallpaperFlooring</samp><br /><small>See [[Modding:Migrate to Stardew Valley 1.5.5#In the furniture catalogue|format docs]].</small>
 
|-
 
|-
| [[Modding:Items|weapons]]
+
| [[Modding:Items#Weapons|Weapons]]
 
| <samp>(W)</samp>
 
| <samp>(W)</samp>
| <samp>Data/Weapons</samp><br /><small>[[#Custom melee weapons|Completely overhauled]] into a data model.</small>
+
| <samp>Data/Weapons</samp><br />
 
|}
 
|}
   Line 151: Line 151:     
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>.
  −
See the sections below for details on each item type.
      
===Get a list of items===
 
===Get a list of items===
Line 224: Line 222:  
}</nowiki>|lang=javascript}}
 
}</nowiki>|lang=javascript}}
   −
Most item data assets work just like <samp>Data/Objects</samp>. See also specific info for [[#Custom fruit trees|custom fruit trees]], [[#Custom tools|custom tools]], and [[#Custom melee weapon data|melee weapons]].
+
Most item data assets work just like <samp>Data/Objects</samp>. See also specific info for [[Modding:Fruit_trees|custom fruit trees]], [[Modding:Items#Tools|custom tools]], and [[Modding:Items#Weapons|melee weapons]].
 
      
===Error items===
 
===Error items===
In-game items with no underlying data (e.g. because you removed the mod which adds them) would previously cause issues like invisible items, errors, and crashes. This was partly mitigated by the bundled Error Handler mod.
+
Prior to 1.6, in-game items with no underlying data (e.g. because you removed the mod which adds them) would previously cause issues like invisible items, errors, and crashes. This was partly mitigated by the bundled Error Handler mod.
   −
Stardew Valley 1.6 adds comprehensive handling for such items. They'll be shown with a <samp>🛇</samp> sprite in inventory UIs and in-game, the name Error Item, and a description which indicates the missing item ID for troubleshooting.
+
Stardew Valley 1.6 added comprehensive handling for such items. They'll be shown with a <samp>🛇</samp> sprite in inventory UIs and in-game, the name Error Item, and a description which indicates the missing item ID for troubleshooting.
    
===For C# mods===
 
===For C# mods===
Line 264: Line 261:     
<dt>Construct items</dt>
 
<dt>Construct items</dt>
<dd>Creating items works just like before, except that you now specify the item's <samp>ItemId</samp> (''not'' <samp>QualifiedItemId</samp>) instead of its <samp>ParentSheetIndex</samp>. For example:
+
<dd>When constructing items, specify the item's <samp>ItemId</samp> (''not'' <samp>QualifiedItemId</samp>). For example:
    
<syntaxhighlight lang="c#">
 
<syntaxhighlight lang="c#">
Line 271: Line 268:  
</syntaxhighlight>
 
</syntaxhighlight>
   −
You can use a new utility method to construct items from their <samp>QualifiedItemId</samp>:
+
You can use a utility method to construct items from their <samp>QualifiedItemId</samp>:
    
<syntaxhighlight lang="c#">
 
<syntaxhighlight lang="c#">
Line 284: Line 281:     
<dt>New <samp>Is*</samp> methods</dt>
 
<dt>New <samp>Is*</samp> methods</dt>
<dd>1.6 adds some <samp>StardewValley.Object</samp> methods to handle custom items in a generic way (and to let mods patch the logic):
+
<dd>1.6 added some <samp>StardewValley.Object</samp> methods to handle custom items in a generic way (and to let mods patch the logic):
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 324: Line 321:  
<dt>Work with item metadata</dt>
 
<dt>Work with item metadata</dt>
 
<dd>
 
<dd>
1.6 adds an <samp>ItemRegistry</samp> API for working with the new item system. Some of the provided methods are:
+
1.6 added an <samp>ItemRegistry</samp> API for working with the new item system. Some of the provided methods are:
    
{| class="wikitable"
 
{| class="wikitable"
Line 651: Line 648:     
===Context tags===
 
===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.
+
A ''context tag'' is an arbitrary data label attached to items. These can produce various effects in-game, or may be informational only. Context tags are case-insensitive. The game generates some tags based on the game data (like the item quality), and others are defined in <samp>Data/Objects</samp>.
 
  −
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.
 
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.
Line 727: Line 722:  
</dd>
 
</dd>
   −
<dt>Context tags from <samp>Data/ObjectContextTags</samp>:</dt>
+
<dt>Color tags:</dt>
 
<dd>
 
<dd>
 
{| class="wikitable"
 
{| class="wikitable"
Line 735: Line 730:  
|-
 
|-
 
| <samp>color_*</samp>
 
| <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.
+
| Color tags are used by a number of game functions, including when the player [[Dyeing#Dye Pots|dyes clothing]] at [[2 Willow Lane|Emily's house]], when tinting certain machine products such as [[Wine]] and [[Pickles]], and when displaying the [[Books|Book]] reading animation. For tinting purposes, each tag has a specific RGB value that is used, except when using Emily's Dye Pots, in which case they are grouped into one of the following categories.
    
{| class="wikitable"
 
{| class="wikitable"
Line 752: Line 747:  
|-
 
|-
 
| green
 
| green
| <samp>color_green</samp>, <samp>color_dark_green</samp>, <samp>color_lime</samp>, <samp>color_yellow_green</samp>, <samp>color_jade</samp>
+
| <samp>color_green</samp>, <samp>color_dark_green</samp>, <samp>color_lime</samp>, <samp>color_yellow_green</samp>, <samp>color_jade</samp>, <samp>color_sea_green</samp>
 
|-
 
|-
 
| blue
 
| blue
Line 759: Line 754:  
| purple
 
| 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>
 
| <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>
 +
|-
 +
| no color
 +
| <samp>color_black</samp>, <samp>color_gray</samp>, <samp>color_dark_gray</samp>, <samp>color_white</samp>, <samp>color_iron</samp>, <samp>color_prismatic</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:
      +
<dt>Tags added in 1.6:</dt>
 +
<dd>
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! game data
+
! context tag
! effects
+
! effect
 +
|-
 +
| <samp>campfire_item</samp>
 +
| Marks the item as a [[campfire]]. If the item also has the <samp>torch_item</samp> context tag, when it's placed in the world and turned on...
 +
* Campfire flames are drawn over it;
 +
* If the item is [[Modding:Items#Big craftables|big craftable]], light is emitted from its center instead of the top.
 +
|-
 +
| <samp>fish_pond_ignore</samp>
 +
| Prevents players from adding this fish to [[Fish Pond|fish ponds]], even if it would otherwise match an entry in <samp>Data/FishPondData</samp>.
 
|-
 
|-
| [[Modding:Fish Pond data|fish ponds]]
+
| <samp>geode_crusher_ignored</samp>
| 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]]).
+
| Prevents breaking this item open in a [[Geode Crusher|geode crusher]], even if the item has geode fields in [[Modding:Items#Objects|<samp>Data/Objects</samp>]].
 
|-
 
|-
| [[Modding:Special orders|special orders]]
+
| <samp>item_type_{{t|type}}</samp>
| 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]]).
+
| For an [[Modding:Items#Objects|object-type item]], the type value from the 'type and category' field. (Non-object items always have the exact tag <samp>item_type_</samp> with nothing after the last underscore.) This is automatic and shouldn't be set manually. The tag is checked in a few places (''e.g.'' the [[museum]] to check if an item is an artifact or mineral), but most of the game won't be affected.
 
|-
 
|-
| tailoring
+
| <samp>museum_donatable</samp><br /><samp>not_museum_donatable</samp>
| In <samp>Data/TailoringRecipes</samp>, used to match items that are needed for a recipe.
+
| Set whether the item can be donated to the [[museum]], overriding the vanilla logic.
 
|-
 
|-
| [[Modding:Gift taste data|gift tastes]]
+
| <samp>not_giftable</samp>
| In <samp>Data/NPCGiftTastes</samp>, used to set character likes and dislike for every item using the context tag.
+
| Prevents players from gifting this item to NPCs, who'll ignore the item entirely (e.g. as if you were holding a tool).
|}
      +
This only affects gift-giving, it doesn't affect non-gift logic like quest goals or special order objectives. If the NPC also has a <samp>reject_*</samp> dialogue for the item, the dialogue takes priority.
 +
|-
 +
| <samp>not_placeable</samp><br /><samp>placeable</samp>
 +
| Sets whether the item can be placed on the ground.
 +
|-
 +
| <samp>prevent_loss_on_death</samp>
 +
| Indicates the item can't be [[Adventurer's Guild#Item Recovery Service|lost when the player dies]].
 +
|-
 +
| <samp>sign_item</samp>
 +
| Marks the item as a [[Crafting#Signs|sign]], which lets player display items on it or place it on a [[Fish Pond|fish pond]] to show the fish count.
 +
|-
 +
| <samp>torch_item</samp>
 +
| Marks the item as a [[torch]], which lets the player turn it on/off to emit light.
 +
See also <samp>campfire_item</samp>.
 +
|}
 +
</dd>
   −
The <samp>debug listtags</samp> [[Modding:Console commands|console command]] lists all the tags of the item being held.
+
<dt>Context tags which affect [[Modding:Machines|machine processing]]:</dt>
 
+
<dd>
{{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 are the default type for items in inventories or placed in the world.
  −
 
  −
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"
 
{| class="wikitable"
 
|-
 
|-
! field
+
! context tag
! purpose
+
! effect
 
|-
 
|-
| <samp>Name</samp>
+
| <samp>crystalarium_banned</samp>
| The internal item name.
+
| When applied to a gem or mineral item, prevents players from placing it in a [[crystalarium]].
 +
|-
 +
| <samp>keg_juice</samp><br /><samp>keg_wine</samp>
 +
| Allows processing the item in a [[keg]] to produce a juice or wine variant.
 
|-
 
|-
| <samp>DisplayName</samp><br /><samp>Description</samp>
+
| <samp>preserves_jelly</samp><br /><samp>preserves_pickle</samp>
| A [[Modding:Tokenizable strings|tokenizable string]] for the item's in-game display name and description.
+
| Allows processing the item in a [[Preserves Jar|preserves jar]] to produce a jelly or pickled variant.
 
|-
 
|-
| <samp>Type</samp>
+
| <samp>seedmaker_banned</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
+
| When applied to a seed item, prevents players from placing it in a [[Seed Maker|seed maker]].
 
|-
 
|-
| <samp>Category</samp>
+
| <samp>tapper_item</samp>
| The [[Modding:Items#Categories|item category]].
+
| Marks the item as a [[tapper]] or [[Heavy Tapper|heavy tapper]].
 
|-
 
|-
| <samp>Price</samp>
+
| <samp>tapper_multiplier_{{t|multiplier}}</samp>
| ''(Optional)'' The price when sold by the player. This is not the price when bought from a shop. Default 0.
+
| The multiplier applied to the tapper production speed. For example, <samp>2</samp> will make items take half their base time (''i.e.'' each item will finish in <sup>base time</sup>/<sub>speed multiplier</sub>). Defaults to 1 if omitted.
 
|}
 
|}
 +
</dd>
   −
====Appearance====
+
 
 +
<dt>Informational tags which have no effect on the game logic:</dt>
 +
<dd>
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! field
+
! context tag
! purpose
+
! effect
 +
|-
 +
| <samp>fish_legendary</samp><br /><samp>fish_legendary_family</samp>
 +
| Marks the fish as a [[Fish#Legendary Fish|legendary fish]] or [[Quests#Extended Family|legendary fish family]]. These are purely informational; the legendary fish behavior is determined by data fields like <samp>CatchLimit</samp> or <samp>IsBossFish</samp> in [[Modding:Location_data|<samp>Data/Locations</samp>]].
 +
|-
 +
| <samp>geode</samp>
 +
| ''(Added automatically)'' Marks the item as a [[Minerals#Geodes|geode]] item, which can be broken open at [[Blacksmith|Clint's blacksmith shop]] or using a [[Geode Crusher|geode crusher]]. This is added automatically if the geode fields are present in [[Modding:Items#Objects|<samp>Data/Objects</samp>]].
 +
|-
 +
| <samp>id_{{t|item id}}</samp>
 +
| ''(Added automatically)'' The [[Modding:Common_data_field_types#Item_ID|qualified item ID]], like <samp>id_(o)128</samp>. This can be used to match or exclude an item by ID using context tags. Any spaces in the ID are replaced with underscores, and single quotes are removed.
 +
|-
 +
| <samp>is_machine</samp>
 +
| ''(Added automatically)'' Indicates the item has [[Modding:Machines|machine logic]]. This is added automatically based on <samp>Data/Machines</samp>.
 
|-
 
|-
| <samp>Texture</samp>
+
| <samp>machine_input</samp>
| The asset name for the texture containing the item's sprite. Defaults to <samp>Maps/springobjects</samp>.
+
| ''(Added automatically)'' Whether the item is a machine which accepts items from the player. This is added automatically based on the machine's fields in <samp>Data/Machines</samp>:
 +
* if <samp>HasInput</samp> is true;
 +
* ''or'' if any output rules have an <samp>ItemPlacedInMachine</samp> trigger.
 
|-
 
|-
| <samp>SpriteIndex</samp>
+
| <samp>machine_output</samp>
| The sprite's index within the <samp>Texture</samp>, where 0 is the top-left sprite.
+
| ''(Added automatically)'' Whether the item is a machine which produces items for the player to collect. This is added automatically based on the machine's fields in <samp>Data/Machines</samp>:
 +
* if <samp>HasOutput</samp> is true;
 +
* ''or'' if it has any output rules.
 
|}
 
|}
 +
</dd>
 +
</dl>
 +
 +
Some game data also references context tags in a generic way. For example, you can add custom tags to an item, then reference them in the fish pond data. Specifically:
   −
====Edibility====
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! field
+
! game data
! purpose
+
! effects
 
|-
 
|-
| <samp>Edibility</samp>
+
| [[Modding:Fish Pond data|fish ponds]]
| ''(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.
+
| 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]]).
 
|-
 
|-
| <samp>IsDrink</samp>
+
| [[Modding:Special orders|special orders]]
| ''(Optional)'' Whether to drink the item instead of eating it. Default false.
+
| 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]]).
 
|-
 
|-
| <samp>Buffs</samp>
+
| tailoring
| ''(Optional)'' The buffs to apply to the player when this item is eaten, if any. Default none.
+
| In <samp>Data/TailoringRecipes</samp>, used to match items that are needed for a recipe.
 
  −
This consists of a list of models with these fields:
  −
{| class="wikitable"
   
|-
 
|-
! field
+
| [[Modding:Gift taste data|gift tastes]]
! purpose
+
| In <samp>Data/NPCGiftTastes</samp>, used to set character likes and dislike for every item using the context tag.
 +
|}
 +
 
 +
The <samp>debug listtags</samp> [[Modding:Console commands|console command]] lists all the tags of the item being held.
 +
 
 +
{{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>.}}
 +
 
 +
====ItemContextTagManager class====
 +
For C# mods, the <samp>ItemContextTagManager</samp> class simplifies working with item context tags and reduces repeated code.
 +
 
 +
This provides a few utility methods:
 +
{| class="wikitable"
 
|-
 
|-
| <samp>Id</samp>
+
! method
| The [[Modding:Common data field types#Unique string ID|unique string ID]] for this entry within the list.
+
! effect
 
|-
 
|-
| <samp>Duration</samp>
+
| <code>GetBaseContextTags(id)</code>
| ''(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.
+
| Get the base context tags for an item based on its raw data in <samp>Data/Objects</samp> or <samp>Data/BigCraftables</samp>. This doesn't include dynamic tags added that are based on instance info (like quality), which you can get using <code>item.GetContextTags()</code>.
 
|-
 
|-
| <samp>BuffId</samp>
+
| <code>DoesTagQueryMatch(query, tags)</code>
| ''(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.
+
| Get whether a context tag query matches the given tags. For example, <code>ItemContextTagManager.DoesTagQueryMatch("bone_item, !fossil_item", item.GetContextTags())</code> returns true if the item is a bone item but not a fossil (like the [[Bone Flute]]).
 
  −
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
+
| <code>DoAllTagsMatch(requiredTags, actualTags)</code><br /><code>DoAnyTagsMatch(requiredTags, actualTags)</code>
! result
+
| Get whether every (<samp>DoAllTagsMatch</samp>) or at least one (<samp>DoAnyTagsMatch</samp) required tag matches the actual item tags. This supports negated required tags like <samp>"!fossil_item"</samp> too.
 
|-
 
|-
| <samp>Duration</samp><br /><samp>IconTexture</samp><br /><samp>SpriteIndex</samp><br /><samp>GlowColor</samp>
+
| <code>DoesTagMatch(requiredTag, actualTags)</code>
| 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>.
+
| Get whether a single tag matches the actual item tags. This supports negated required tags like <samp>"!fossil_item"</samp> too.
 
|-
 
|-
| <samp>CustomAttributes</samp>
+
| <code>SanitizeContextTag(tag)</code>
| 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).
+
| ''(Specialized)'' Replace characters that may appear in item names so they're valid in context tags. For example, <code>SanitizeContextTag("Sam's Boombox")</code> returns <samp>sams_boombox</samp>.
 +
|}
 +
 
 +
==Objects==
 +
Objects are the default type for items in inventories or placed in the world.
 +
 
 +
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 → model lookup, where...
 +
* The key is the unqualified [[Modding:Common_data_field_types#Item_ID|item ID]].
 +
* The value is a model with the fields listed below.
 +
 
 +
====Basic info====
 +
{| class="wikitable"
 
|-
 
|-
| <samp>IsDebuff</samp>
+
! field
| The value in <samp>Data/Objects</samp> is used.
+
! purpose
|}
   
|-
 
|-
| <samp>IsDebuff</samp>
+
| <samp>Name</samp>
| ''(Optional)'' Whether this buff counts as a debuff, so its duration should be halved when wearing a Sturdy Ring. Default false.
+
| The internal item name.
 
|-
 
|-
| <samp>IconTexture</samp>
+
| <samp>DisplayName</samp><br /><samp>Description</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.
+
| A [[Modding:Tokenizable strings|tokenizable string]] for the item's in-game display name and description.
 
|-
 
|-
| <samp>SpriteIndex</samp>
+
| <samp>Type</samp>
| ''(Optional)'' The buff's icon index within the <samp>IconTexture</samp>, where 0 is the top-left icon. Default 0.
+
| 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
 
|-
 
|-
| <samp>GlowColor</samp>
+
| <samp>Category</samp>
| ''(Optional)'' The glow color to apply to the player. See [[#Color fields|color format]]. Default none.
+
| The [[Modding:Items#Categories|item category]].
 
|-
 
|-
| <samp>CustomAttributes</samp>
+
| <samp>Price</samp>
| The custom buff attributes to apply, if any.
+
| ''(Optional)'' The price when sold by the player. This is not the price when bought from a shop. Default 0.
 +
|}
   −
This consists of a model with any combination of these fields:
+
====Appearance====
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 954: Line 951:  
! purpose
 
! purpose
 
|-
 
|-
| <samp>FarmingLevel</samp><br /><samp>FishingLevel</samp><br /><samp>ForagingLevel</samp><br /><samp>LuckLevel</samp><br /><samp>MiningLevel</samp>
+
| <samp>Texture</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.
+
| The asset name for the texture containing the item's sprite. Defaults to <samp>Maps/springobjects</samp>.
 
|-
 
|-
| <samp>Attack</samp><br /><samp>Defense</samp><br /><samp>MagneticRadius</samp><br /><samp>MaxStamina</samp><br /><samp>Speed</samp>
+
| <samp>SpriteIndex</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.
+
| The sprite's index within the <samp>Texture</samp>, where 0 is the top-left sprite.
 
|}
 
|}
|-
+
 
| <samp>CustomFields</samp>
+
====Edibility====
| ''(Optional)'' The [[#Custom data fields|custom fields]] for this entry.
+
{| class="wikitable"
|}
  −
|}
  −
 
  −
 
  −
===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===
  −
 
  −
This consists of a string → model lookup, where...
  −
* The key is the unqualified [[Modding:Common_data_field_types#Item_ID|item ID]].
  −
* The value is a model with the fields listed below.
  −
 
  −
====Basic info====
  −
{| class="wikitable"
   
|-
 
|-
 
! field
 
! field
 
! purpose
 
! purpose
 
|-
 
|-
| <samp>Name</samp>
+
| <samp>Edibility</samp>
| The internal item name.
+
| ''(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>DisplayName</samp><br /><samp>Description</samp>
+
| <samp>IsDrink</samp>
| A [[Modding:Tokenizable strings|tokenizable string]] for the item's in-game display name and description.
+
| ''(Optional)'' Whether to drink the item instead of eating it. Default false.
 
|-
 
|-
| <samp>Price</samp>
+
| <samp>Buffs</samp>
| ''(Optional)'' The price when sold by the player. This is not the price when bought from a shop. Default 0.
+
| ''(Optional)'' The buffs to apply to the player when this item is eaten, if any. Default none.
|}
     −
====Behavior====
+
This consists of a list of models with these fields:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 1,006: Line 979:  
! purpose
 
! purpose
 
|-
 
|-
| <samp>Fragility</samp>
+
| <samp>Id</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.
+
| The [[Modding:Common data field types#Unique string ID|unique string ID]] for this entry within the list.
 
|-
 
|-
| <samp>CanBePlacedIndoors</samp><br /><samp>CanBePlacedOutdoors</samp>
+
| <samp>Duration</samp>
| ''(Optional)'' Whether the item can be placed indoors or outdoors. Default true.
+
| ''(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>IsLamp</samp>
+
| <samp>BuffId</samp>
| ''(Optional)'' Whether this is a lamp and should produce light when dark. Default false.
+
| ''(Optional)'' The unique ID of a buff from <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.
|}
     −
====Appearance====
+
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"
 
{| class="wikitable"
 
|-
 
|-
 
! field
 
! field
! purpose
+
! 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>Texture</samp>
+
| <samp>CustomAttributes</samp>
| ''(Optional)'' The asset name for the texture containing the item's sprite. Defaults to <samp>TileSheets/Craftables</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>SpriteIndex</samp>
+
| <samp>IsDebuff</samp>
| ''(Optional)'' The sprite's index within the <samp>Texture</samp>, where 0 is the top-left sprite.
+
| The value in <samp>Data/Objects</samp> is used.
 
|}
 
|}
  −
====Context tags====
  −
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>IsDebuff</samp>
! purpose
+
| ''(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>ContextTags</samp>
+
| <samp>SpriteIndex</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:
+
| ''(Optional)'' The buff's icon index within the <samp>IconTexture</samp>, where 0 is the top-left icon. Default 0.
<syntaxhighlight lang="json">
+
|-
"ContextTags": [ "light_source", "torch_item" ]
+
| <samp>GlowColor</samp>
</syntaxhighlight>
+
| ''(Optional)'' The glow color to apply to the player. See [[Modding:Common_data_field_types#Color|color format]]. Default none.
|}
+
|-
 +
| <samp>CustomAttributes</samp>
 +
| The custom buff attributes to apply, if any.
   −
====Advanced====
+
This consists of a model with any combination of these fields:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
 
! field
 
! field
 
! purpose
 
! 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>
 
| <samp>CustomFields</samp>
 
| ''(Optional)'' The [[Modding:Common_data_field_types#Custom_fields|custom fields]] for this entry.  
 
| ''(Optional)'' The [[Modding:Common_data_field_types#Custom_fields|custom fields]] for this entry.  
 +
|}
 
|}
 
|}
   −
===Notes===
+
====Geodes & artifact spots====
* 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]].
+
{| class="wikitable"
 +
|-
 +
! field
 +
! purpose
 +
|-
 +
| <samp>GeodeDrops</samp><br /><samp><samp>GeodeDropsDefaultItems</samp>
 +
| ''(Optional)'' The items that can be dropped when breaking open this item as a [[Minerals#Geodes|geode]]. Specifying either or both fields automatically enables geode behavior for this item.
   −
==Boots==
+
You can specify one or both fields:
Boots are items that can be equipped in the player's [[footwear]] slot.
+
<ul>
 +
<li><samp>GeodeDrops</samp> can be set to the specific items to drop. Default none. This consists of a list of models with these fields:
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! purpose
 +
|-
 +
|-
 +
| ''common fields''
 +
| See [[Modding:Item queries#Item spawn fields|item spawn fields]] for the generic item fields supported by geode drops.
   −
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>.
+
If set to an [[Modding:Item queries|item query]] which returns multiple items, one of them will be selected at random.
 +
|-
 +
| <samp>Chance</samp>
 +
| ''(Optional)'' The probability that the item will be dropped if the other fields match, as a decimal value between 0 (never) and 1 (always). Default 1.
 +
|-
 +
| <samp>SetFlagOnPickup</samp>
 +
| ''(Optional)'' The mail flag to set for the current player when this drop is picked up.
 +
|-
 +
| <samp>Precedence</samp>
 +
| ''(Optional)'' The order in which this entry should be checked, where lower values are checked first. This can be a negative value. Geode drops with the same precedence are checked in the order listed. Default 0.
   −
===Data format===
+
For consistency, vanilla drops mostly use these values:
The boots data in <samp>Data/Boots</samp> consists of an integer→string dictionary with entries like this:
+
* <samp>-1000</samp>: special overrides like the [[Golden Helmet]];
 +
* <samp>0</samp>: normal items.
 +
|}</li>
 +
<li><samp>GeodeDropsDefaultItems</samp> chooses a predefined list of possible geode drops like [[clay]], [[coal]], [[Copper Ore|copper]], [[Iridium Ore|iridium]], etc. Default false.</li>
 +
</ul>
   −
<syntaxhighlight lang="json">
+
If both fields are specified, each geode will choose between them with an equal 50% chance. If <samp>GeodeDrops</samp> is specified but no entries match, the geode will use the <samp>GeodeDropsDefaultItems</samp> regardless of whether it's true.
  "511": "Dark Boots/Made from thick black leather./250/4/2/7"
+
|-
</syntaxhighlight>
+
| <samp>ArtifactSpotChances</samp>
 +
| ''(Optional)'' If this is an artifact (i.e. the <samp>Type</samp> field is <samp>Arch</samp>), the chance that it can be found by digging [[Artifact Spot|artifact spots]] in each location.
   −
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:
+
This consists of a string → model lookup, where:
 +
* the key is the internal location name;
 +
* the value is the probability the item will spawn if checked, as a decimal value between 0 (never) and 1 (always).
 +
|}
    +
====Context tags & exclusions====
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! index
   
! field
 
! field
! effect
+
! purpose
 
|-
 
|-
| 0
+
| <samp>ContextTags</samp>
| name
+
| ''(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:
| The internal item name (and display name in English).
+
<syntaxhighlight lang="json">
 +
"ContextTags": [ "color_yellow", "fish_ocean", "fish_upright", "season_summer" ]
 +
</syntaxhighlight>
 
|-
 
|-
| 1
+
| <samp>ExcludeFromRandomSale</samp>
| description
+
| ''(Optional)'' Whether to exclude this item from shops when selecting random items to sell. Default false.
| The translated item description shown in-game.
   
|-
 
|-
| 2
+
| <samp>ExcludeFromFishingCollection</samp><br /><samp>ExcludeFromShippingCollection</samp>
| price
+
| ''(Optional)'' Whether to exclude this item from the fishing/shipping collection and their respective effect on the [[perfection|perfection score]]. Default false, in which case the normal requirements apply (e.g. artifacts are always excluded from the shipping collection).
| '''Unused.''' The actual price is calculated as <samp>(''added defence'' × 100) + (''added immunity'' × 100)</samp>.
+
|}
 +
 
 +
====Advanced====
 +
{| class="wikitable"
 
|-
 
|-
| 3
+
! field
| added defense
+
! purpose
| A [[defense]] bonus applied to the player while equipped.
   
|-
 
|-
| 4
+
| <samp>CustomFields</samp>
| added immunity
+
| ''(Optional)'' The [[Modding:Common_data_field_types#Custom_fields|custom fields]] for this entry.  
| 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==
+
===Notes===
Clothing consists of cosmetic items that can be equipped in the player's [[Tailoring|pants and shirt]] slots.
+
* 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.
   −
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>.
+
==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===
 
===Data format===
The clothing data in <samp>Data/ClothingInformation</samp> consists of an integer→string dictionary with entries like this:
     −
<syntaxhighlight lang="json">
+
This consists of a string → model lookup, where...
  "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"
+
* The key is the unqualified [[Modding:Common_data_field_types#Item_ID|item ID]].
</syntaxhighlight>
+
* The value is a model with the fields listed below.
 
  −
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:
      +
====Basic info====
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! index
   
! field
 
! field
! effect
+
! purpose
 
|-
 
|-
| 0
+
| <samp>Name</samp>
| name
+
| The internal item name.
| The internal item name (and display name in English).
   
|-
 
|-
| 1
+
| <samp>DisplayName</samp><br /><samp>Description</samp>
| display name
+
| A [[Modding:Tokenizable strings|tokenizable string]] for the item's in-game display name and description.
| The translated item name shown in-game.
   
|-
 
|-
| 2
+
| <samp>Price</samp>
| description
+
| ''(Optional)'' The price when sold by the player. This is not the price when bought from a shop. Default 0.
| The translated item description shown in-game.
+
|}
 +
 
 +
====Behavior====
 +
{| class="wikitable"
 
|-
 
|-
| 3
+
! field
| male index
+
! purpose
| The sprite index in the clothing spritesheet for male characters.
   
|-
 
|-
| 4
+
| <samp>Fragility</samp>
| female index
+
| ''(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.
| The sprite index in the clothing spritesheet for female characters, or <samp>-1</samp> to use the male index.
   
|-
 
|-
| 5
+
| <samp>CanBePlacedIndoors</samp><br /><samp>CanBePlacedOutdoors</samp>
| price
+
| ''(Optional)'' Whether the item can be placed indoors or outdoors. Default true.
| The price when purchased from shops.
   
|-
 
|-
| 6
+
| <samp>IsLamp</samp>
| default color
+
| ''(Optional)'' Whether this is a lamp and should produce light when dark. Default false.
| 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.
+
|}
|-
  −
| 7
  −
| dyeable
  −
| Whether the clothing can be [[Dyeing|dyed]] (<samp>true</samp> or <samp>false</samp>).
  −
|-
  −
| 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:
      +
====Appearance====
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! index
   
! field
 
! field
! effect
+
! purpose
 
|-
 
|-
| 0
+
| <samp>Texture</samp>
| name
+
| ''(Optional)'' The asset name for the texture containing the item's sprite. Defaults to <samp>TileSheets/Craftables</samp>.
| The internal item name (and display name in English).
   
|-
 
|-
| 1
+
| <samp>SpriteIndex</samp>
| type
+
| ''(Optional)'' The sprite's index within the <samp>Texture</samp>, where 0 is the top-left sprite.
| The furniture type. Possible values:
+
|}
{| class="wikitable sortable"
+
 
 +
====Context tags====
 +
{| class="wikitable"
 
|-
 
|-
! type
+
! field
! meaning
+
! purpose
 
|-
 
|-
| 0
+
| <samp>ContextTags</samp>
| chair
+
| ''(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">
| 1
+
"ContextTags": [ "light_source", "torch_item" ]
| bench
+
</syntaxhighlight>
 +
|}
 +
 
 +
====Advanced====
 +
{| class="wikitable"
 
|-
 
|-
| 2
+
! field
| couch
+
! purpose
 
|-
 
|-
| 3
+
| <samp>CustomFields</samp>
| armchair
+
| ''(Optional)'' The [[Modding:Common_data_field_types#Custom_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==
 +
===Data format===
 +
You can create/edit [[Footwear|boots]] by editing the <samp>Data/Boots</samp> asset. This consists of a string → string dictionary, where...
 +
* The key is the unqualified [[Modding:Common_data_field_types#Item_ID|item ID]].
 +
* The value is a slash-delimited string with the fields listed below.
 +
 
 +
{| class="wikitable"
 
|-
 
|-
| 4
+
! index
| dresser
+
! 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 <samp>(''added defence'' × 100) + (''added immunity'' × 100)</samp>.
 +
|-
 +
| 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
 
| 5
| long table
+
| Color Index
 +
| The boots color index within the Color Texture, where 0 is the top-left set, if present, otherwise the <samp>Characters/Farmer/shoeColors</samp> spritesheet.
 
|-
 
|-
 
| 6
 
| 6
| painting
+
| Display Name
 +
| The translated item name shown in-game (for non-English assets only).
 
|-
 
|-
 
| 7
 
| 7
| lamp
+
| Color Texture
 +
| The asset name for the texture containing the boots color sprite.
 
|-
 
|-
 
| 8
 
| 8
| decor
+
| Sprite Index
 +
| The boots sprite index within the Texture, where 0 is the top-left set.
 
|-
 
|-
 
| 9
 
| 9
| other
+
| Texture
|-
+
| The asset name for the texture containing the boots sprite.
| 10
+
|}
| bookcase
+
 
 +
The boots data in <samp>Data/Boots</samp> consists of a string → string dictionary with entries like this:
 +
 
 +
<syntaxhighlight lang="json">
 +
  "511": "Dark Boots/Made from thick black leather./250/4/2/7"
 +
</syntaxhighlight>
 +
 
 +
A custom entry might look something like this:
 +
 
 +
<syntaxhighlight lang="json">
 +
{
 +
  "Format": "2.2.0",
 +
  "Changes": [
 +
    {
 +
      "LogName": "Load boots texture",
 +
      "Action": "Load",
 +
      "Target": "{{ModId}}/Boots, {{ModId}}/BootsColor",
 +
      "FromFile": "assets/{{TargetWithoutPath}}.png"
 +
    },
 +
    {
 +
      "LogName": "Add boots to boots data",
 +
      "Action": "EditData",
 +
      "Target": "Data/Boots",
 +
      "Entries": {
 +
        "{{ModId}}_OPBoots": "Overpowered Boots/These boots are totally broken!/1000000/100/100/8/Overpowered Boots/{{ModId}}\\BootsColor/0/{{ModId}}\\Boots"
 +
      }
 +
    }
 +
  ]
 +
}
 +
</syntaxhighlight>
 +
 
 +
==Pants==
 +
 
 +
===Data format===
 +
 
 +
You can create/edit [[Tailoring#Pants|pants]] by editing the <samp>Data/Pants</samp> asset. This consists of a string → model lookup, where...
 +
* The key is the unqualified [[Modding:Common_data_field_types#Item_ID|item ID]].
 +
* The value is a model with the fields listed below.
 +
 
 +
====Basic pants data====
 +
{| class="wikitable"
 
|-
 
|-
| 11
+
! field
| table
+
! purpose
 
|-
 
|-
| 12
+
| <samp>Name</samp>
| rug
+
| ''(Optional)'' The internal name for the item. Default <samp>Pants</samp>.
 
|-
 
|-
| 13
+
| <samp>DisplayName</samp><br /><samp>Description</samp>
| window
+
| ''(Optional)'' A [[Modding:Tokenizable strings|tokenizable string]] for the item's in-game display name and description. Defaults to the generic pants text (''Pants'' and ''A wearable pair of pants'').
 
|-
 
|-
| 14
+
| <samp>Price</samp>
| fireplace
+
| ''(Optional)'' The default price when the item is sold to the player in a shop. Default 50.
 +
|}
 +
 
 +
====Appearance====
 +
{| class="wikitable"
 
|-
 
|-
| 15
+
! field
| bed
+
! purpose
 
|-
 
|-
| 16
+
| <samp>Texture</samp>
| torch
+
| The asset name for the texture containing the pants' sprite. Defaults to <samp>Characters/Farmer/pants</samp>.
 
|-
 
|-
| 17
+
| <samp>SpriteIndex</samp>
| sconce
+
| The pants' sprite index within the <samp>Texture</samp>, where 0 is the top-left set.
|}
   
|-
 
|-
| 2
+
| <samp>DefaultColor</samp>
| tilesheet size
+
| ''(Optional)'' The dye color to apply to the sprite when the player hasn't [[dyeing|dyed]] it yet, if any. See [[Modding:Common_data_field_types#Color|color format]]. Default <samp>255 235 203</samp> (which matches the color of the cloth item).
| 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
+
| <samp>CanBeDyed</samp>
| bounding box size
+
| ''(Optional)'' Whether the player can [[dyeing|dye]] these pants. Default false.
| 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
+
| <samp>IsPrismatic</samp>
| rotations
+
| ''(Optional)'' Whether the pants continuously shift colors. This overrides <samp>DefaultColor</samp> and <samp>CanBeDyed</samp> if set. Default false.
| The number of rotations possible (1, 2, or 4).
+
|}
 +
 
 +
====Other====
 +
{| class="wikitable"
 
|-
 
|-
| 5
+
! field
| price
+
! purpose
| The price when purchased from a shop.
   
|-
 
|-
| 6
+
| <samp>CanChooseDuringCharacterCustomization</samp>
| placement restriction
+
| ''(Optional)'' Whether these pants can be selected on the character customization screen (e.g. when creating a character). Default false.
| Where the furniture can be placed.  
  −
{| class="wikitable sortable"
   
|-
 
|-
! value
+
| <samp>CustomFields</samp>
! meaning
+
| The [[Modding:Common_data_field_types#Custom_fields|custom fields]] for this entry.
|-
+
|}
| -1
+
 
| default (uses furniture type)
+
==Shirts==
 +
 
 +
===Data format===
 +
 
 +
You can create/edit [[Tailoring#Shirts|shirts]] by editing the new <samp>Data/Shirts</samp> asset. This consists of a string → model lookup, where...
 +
* The key is the unqualified [[Modding:Common_data_field_types#Item_ID|item ID]].
 +
* The value is a model with the fields listed below.
 +
 
 +
====Basic shirt data====
 +
{| class="wikitable"
 
|-
 
|-
| 0
+
! field
| indoors-only
+
! purpose
 
|-
 
|-
| 1
+
| <samp>Name</samp>
| outdoors-only
+
| ''(Optional)'' The internal name for the item. Default <samp>Shirt</samp>.
 
|-
 
|-
| 2
+
| <samp>DisplayName</samp><br /><samp>Description</samp>
| indoors or outdoors
+
| ''(Optional)'' A [[Modding:Tokenizable strings|tokenizable string]] for the item's in-game display name and description. Defaults to the generic shirt text (''Shirt'' and ''A wearable shirt'').
|}
   
|-
 
|-
| 7
+
| <samp>Price</samp>
| display name
+
| ''(Optional)'' The default price when the item is sold to the player in a shop. Default 50.
| The translated furniture name (in non-English data assets only).
   
|}
 
|}
   −
==Hats==
+
====Appearance====
Hats are items that can be equipped in the player's [[hats|hat]] slot.
+
{| class="wikitable"
 +
|-
 +
! field
 +
! purpose
 +
|-
 +
| <samp>Texture</samp>
 +
| The asset name for the texture containing the shirt's sprite. Defaults to <samp>Characters/Farmer/shirts</samp>.
 +
|-
 +
| <samp>SpriteIndex</samp>
 +
| The shirt's sprite index within the <samp>Texture</samp>, where 0 is the top-left set.
 +
|-
 +
| <samp>DefaultColor</samp>
 +
| ''(Optional)'' The dye color to apply to the sprite when the player hasn't [[dyeing|dyed]] it yet, if any. See [[Modding:Common_data_field_types#Color|color format]]. Default none.
 +
|-
 +
| <samp>CanBeDyed</samp>
 +
| ''(Optional)'' Whether the player can [[dyeing|dye]] this shirt. Default false.
 +
|-
 +
| <samp>IsPrismatic</samp>
 +
| ''(Optional)'' Whether the shirt continuously shifts colors. This overrides <samp>DefaultColor</samp> and <samp>CanBeDyed</samp> if set. Default false.
 +
|-
 +
| <samp>HasSleeves</samp>
 +
| ''(Optional)'' Whether to draw shirt sleeves. Default true.
 +
|}
 +
 
 +
====Other====
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! purpose
 +
|-
 +
| <samp>CanChooseDuringCharacterCustomization</samp>
 +
| ''(Optional)'' Whether this shirt can be selected on the character customization screen (e.g. when creating a character). Default false.
 +
|-
 +
| <samp>CustomFields</samp>
 +
| The [[Modding:Common_data_field_types#Custom_fields|custom fields]] for this entry.
 +
|}
   −
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>.
+
==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>, translations in <samp>Strings/Furniture</samp>, and their code in <samp>StardewValley.Objects.Furniture</samp>.
    
===Data format===
 
===Data format===
The hat data in <samp>Data/Hats</samp> consists of an integer→string dictionary with entries like this:
+
The furniture data in <samp>Data/Furniture</samp> consists of an integer→string dictionary with entries like this:
    
<syntaxhighlight lang="json">
 
<syntaxhighlight lang="json">
   "5": "Official Cap/Looks like it belonged to a postman or policeman. Either way, it's still very soft and smells okay./false/true"
+
   "18": "Country Chair/chair/-1/-1/4/750"
 
</syntaxhighlight>
 
</syntaxhighlight>
   −
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 item's <samp>ParentSheetIndex</samp> and the value is a slash-delimited string with these fields:
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 1,317: Line 1,429:  
| 0
 
| 0
 
| name
 
| name
| The internal item name.
+
| The internal item name (and display name in English).
 +
|-
 +
| 1
 +
| type
 +
| The furniture type. Possible values:
 +
{| class="wikitable sortable"
 +
|-
 +
! type
 +
! meaning
 +
|-
 +
| 0
 +
| chair
 
|-
 
|-
 
| 1
 
| 1
| description
+
| bench
| The translated item description shown in-game.
   
|-
 
|-
 
| 2
 
| 2
| show real hair
+
| couch
| 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
| skip hairstyle offset
+
| armchair
| 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
+
| dresser
| 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
 
| 5
| display name
+
| long table
| The translated item name shown in-game.
   
|-
 
|-
 
| 6
 
| 6
| sprite index
+
| painting
| The index in the hat spritesheet used to display this hat.
   
|-
 
|-
 
| 7
 
| 7
| texture name
+
| lamp
| 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>
+
|-
|}
+
| 8
 
+
| decor
Hats have a hard-coded category of -95 (<samp>HatDataDefinition.cs::GetData</samp>)
+
|-
 
+
| 9
==Tools==
+
| other
[[Tools]] are items that can be swung or used by the player to perform some effect (e.g. dig dirt, chop trees, etc).
+
|-
 
+
| 10
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>.
+
| bookcase
 
  −
===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
+
| 11
! field
+
| table
! effect
   
|-
 
|-
| 0
+
| 12
| name
+
| rug
| The internal weapon name (and display name in English).
   
|-
 
|-
| 1
+
| 13
| description
+
| window
| The translated item description shown in-game.
   
|-
 
|-
| 2<br />3
+
| 14
| min damage<br />max damage
+
| fireplace
| The minimum and maximum damage caused when hitting a monster with this weapon.
   
|-
 
|-
| 4
+
| 15
| knockback
+
| bed
| 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
+
| 16
| speed
+
| torch
| 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
+
| 17
| added precision
+
| sconce
| Reduces the chance that a strike will miss.
+
|}
 
|-
 
|-
| 7
+
| 2
| added defence
+
| tilesheet size
| Reduces damage received by the player.
+
| 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.
 
|-
 
|-
| 8
+
| 3
| type
+
| bounding box size
| 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).
+
| 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.
 
|-
 
|-
| 9<br />10
+
| 4
| base mine level<br />min mine level
+
| rotations
| The base and minimum mine level, which affect [[#Mine container drops|mine container drops]].
+
| The number of rotations possible (1, 2, or 4).
 
|-
 
|-
| 11
+
| 5
| added area of effect
+
| price
| Slightly increases the area of effect.
+
| The price when purchased from a shop.
 
|-
 
|-
| 12
+
| 6
| critical chance
+
| placement restriction
| The chance of a critical hit, as a decimal value between 0 and 1.
+
| Where the furniture can be placed.  
 +
{| class="wikitable sortable"
 
|-
 
|-
| 13
+
! value
| critical damage
+
! meaning
| A multiplier applied to the damage for critical hit.
   
|-
 
|-
| 14
+
| -1
| display name
+
| default (uses furniture type)
| The translated item name (in non-English assets only).
  −
|}
  −
 
  −
; Slingshots
  −
: {| class="wikitable"
   
|-
 
|-
! index
+
| 0
! field
+
| indoors-only
! effect
+
|-
 +
| 1
 +
| outdoors-only
 
|-
 
|-
| 0
+
| 2
| name
+
| indoors or outdoors
| The internal weapon name (and display name in English).
+
|}
 
|-
 
|-
| 1
+
| 7
| description
+
| display name
| The translated item description shown in-game (for non-English assets only).
+
| The translated furniture name, which allows [[Modding:Tokenizable strings|tokenizable strings]].
 
|-
 
|-
| 2&ndash;8
+
| 8
| ''unused''
+
| sprite index
|
+
| The sprite index within the spritesheet texture to draw.
 
|-
 
|-
| 9<br />10
+
| 9
| base mine level<br />min mine level
+
| texture
| The base and minimum mine level, which affect [[#Mine container drops|mine container drops]].
+
| ''(Optional)'' The asset name of the texture to draw. Defaults to <samp>TileSheets/furniture</samp>.
 
|-
 
|-
| 11&ndash;13
+
| 10
| ''unused''
+
| off limits for random sale
|
+
| ''(Optional)'' Whether to prevent this furniture from appearing in randomly generated shop stocks and the furniture catalogue. Default false.
 
|-
 
|-
| 14
+
| 11
| display name
+
| context tags
| The translated item description shown in-game (for non-English assets only).
+
| ''(Optional)'' A space-delimited list of [[Modding:Items#Context tags|context tags]] which apply to this furniture. Default none.
 
|}
 
|}
    +
==Hats==
 +
Hats are items that can be equipped in the player's [[hats|hat]] slot.
 +
 +
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===
 +
The hat data in <samp>Data/Hats</samp> consists of an integer→string dictionary with entries like this:
 +
 +
<syntaxhighlight lang="json">
 +
  "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>
 +
 +
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"
 +
|-
 +
! 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 (<samp>true</samp>), or change the hairstyle to fit the hat (<samp>false</samp>).
 +
|-
 +
| 3
 +
| skip hairstyle offset
 +
| 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
 +
| 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 data in <samp>Data/Tools</samp>, 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===
 +
 +
You can create/edit [[tools]] by editing the<samp>Data/Tools</samp> asset. This consists of a string → model lookup, where...
 +
* The key is the unqualified [[Modding:Common_data_field_types#Item_ID|item ID]].
 +
* The value is a model with the fields listed below.
 +
 +
====Basic tool data====
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! purpose
 +
|-
 +
| <samp>ClassName</samp>
 +
| The name of the C# class to construct within the <code>StardewValley.Tools</code> namespace. The class must be a subclass of <samp>StardewValley.Tool</samp>, and have a constructor with no arguments. For example, given a value of <samp>Axe</samp>, the game will create <code>StardewValley.Tools.Axe</code> instances.
 +
 +
The main values are:
 +
* main tools (<samp>Axe</samp>, <samp>FishingRod</samp>, <samp>Hoe</samp>, <samp>MeleeWeapon</samp>, <samp>MilkPail</samp>, <samp>Pan</samp>, <samp>Pickaxe</samp>, <samp>Shears</samp>, <samp>Wand</samp>, and <samp>WateringCan</samp>);
 +
* a special <samp>GenericTool</samp> type which applies the <samp>Data/Tools</samp> data and only has generic logic, so C# mods can patch in their own logic;
 +
* and two tools cut from the game which may not work correctly (<samp>Lantern</samp> and <samp>Raft</samp>).
 +
|-
 +
| <samp>Name</samp>
 +
| The internal name to set for the tool item.
 +
|-
 +
| <samp>DisplayName</samp><br /><samp>Description</samp>
 +
| A [[Modding:Tokenizable strings|tokenizable string]] for the tool's in-game display name and description.
 +
|-
 +
| <samp>AttachmentSlots</samp>
 +
| ''(Optional)'' The number of attachment slots to enable on the tool. Note that only <samp>FishingRod</samp> tools have the code to render and use attachment slots. Default <samp>-1</samp>, which keeps the default value set by the tool class.
 +
|-
 +
| <samp>SalePrice</samp>
 +
| ''(Optional)'' The default price when the item is sold to the player in a shop. Defaults to <samp>-1</samp>, in which case you should set the price manually in shops.
 +
|-
 +
| <samp>CustomFields</samp>
 +
| The [[Modding:Common_data_field_types#Custom_fields|custom fields]] for this entry.
 +
|}
 +
 +
====Appearance====
 +
Note that drawing the tool correctly in the world (ie, while the player is trying to use it) will likely require custom code.
 +
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! purpose
 +
|-
 +
| <samp>Texture</samp>
 +
| The asset name for the texture containing the tool's sprite.
 +
|-
 +
| <samp>SpriteIndex</samp>
 +
| The tool's sprite index within the <samp>Texture</samp>, where 0 is the top row.
 +
|-
 +
| <samp>MenuSpriteIndex</samp>
 +
| ''(Optional)'' The sprite index within the <samp>Texture</samp> for the item icon. Defaults to <samp>SpriteIndex</samp>.
 +
|}
 +
 +
====Upgrades====
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! purpose
 +
|-
 +
| <samp>UpgradeLevel</samp>
 +
| ''(Optional)'' The tool upgrade level. Default <samp>-1</samp>, which keeps the default value set by the tool class.
 +
|-
 +
| <samp>ApplyUpgradeLevelToDisplayName</samp>
 +
| ''(Optional)'' Whether to adjust the <samp>DisplayName</samp> for the usual upgrade levels. For example, the display name for a level one Axe changes to 'Copper Axe'. Default false.
 +
 +
The display name format in English is:
 +
{| class="wikitable"
 +
|-
 +
! upgrade level
 +
! display name format
 +
|-
 +
| 1
 +
| Copper {{t|display name}}
 +
|-
 +
| 2
 +
| Steel {{t|display name}}
 +
|-
 +
| 3
 +
| Gold {{t|display name}}
 +
|-
 +
| 4
 +
| Iridium {{t|display name}}
 +
|}
 +
|-
 +
| <samp>ConventionalUpgradeFrom</samp>
 +
| ''(Optional)'' If set, prepends an upgrade for the given tool ID to the <samp>UpgradeFrom</samp> field. This applies these rules (based on the <samp>UpgradeLevel</samp> field, not the upgrade level of the specified tool ID):
 +
 +
{| class="wikitable"
 +
|-
 +
! upgrade level
 +
! price
 +
! items needed
 +
|-
 +
| 1
 +
| {{price|2000}}
 +
| {{name|Copper Bar|5}}
 +
|-
 +
| 2
 +
| {{price|5000}}
 +
| {{name|Iron Bar|5}}
 +
|-
 +
| 3
 +
| {{price|10000}}
 +
| {{name|Gold Bar|5}}
 +
|-
 +
| 4
 +
| {{price|25000}}
 +
| {{name|Iridium Bar|5}}
 +
|}
 +
 +
For example, Iridium Axe specifies this value:
 +
<syntaxhighlight lang="js">
 +
"ConventionalUpgradeFrom": "(T)GoldAxe"
 +
</syntaxhighlight>
 +
|-
 +
| <samp>UpgradeFrom</samp>
 +
| ''(Optional)'' The requirements to buy this tool from Clint's [[Blacksmith#Upgrade Tools|blacksmith tool upgrade shop]]. If you specify multiple entries, the first one which matches will be applied.
 +
 +
This consists of a list of models with these fields:
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! purpose
 +
|-
 +
| <samp>Price</samp>
 +
| ''(Optional)'' The gold price to buy the upgrade. Defaults to 0.
 +
|-
 +
| <samp>RequireToolId</samp>
 +
| ''(Optional)'' If set, the [[Modding:Common_data_field_types#Item_ID|qualified or unqualified item ID]] for the tool that must be in the player's inventory for the upgrade to appear. The tool will be destroyed when the upgrade is purchased.
 +
|-
 +
| <samp>TradeItemId</samp>
 +
| ''(Optional)'' If set, the [[Modding:Common_data_field_types#Item_ID|qualified or unqualified item ID]] for an extra item that must be traded to upgrade the tool. (For example, many vanilla tools need metal bars.)
 +
|-
 +
| <samp>TradeItemAmount</samp>
 +
| ''(Optional)'' The number of <samp>TradeItemId</samp> required. Defaults to 1.
 +
|-
 +
| <samp>Condition</samp>
 +
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether this upgrade is available. Defaults to always true.
 +
|}
 +
 +
For example, these are equivalent to the Steel Axe's upgrade settings:
 +
<syntaxhighlight lang="js">
 +
"UpgradeFrom": [
 +
    {
 +
        "RequireToolId": "(T)CopperAxe",
 +
        "Price": 5000,
 +
        "TradeItemId": "(O)335", // Iron Bar
 +
        "TradeItemAmount": 5
 +
    }
 +
]
 +
</syntaxhighlight>
 +
 +
If you want the tool to always be available, you can just omit the conditions. For example:
 +
<syntaxhighlight lang="js">
 +
"UpgradeFrom": [
 +
    {
 +
        "Price": 5000
 +
    }
 +
]
 +
</syntaxhighlight>
 +
 +
Note that Clint needs a few days to smith the new tool. If you want to sell the tool directly, [[Modding:Shops|add it to a regular shop]] instead.
 +
|}
 +
 +
====Game logic====
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! purpose
 +
|-
 +
| <samp>CanBeLostOnDeath</samp>
 +
| Whether the player can [[Adventurer's Guild#Item Recovery Service|lose this tool when they die]]. Default false.
 +
|}
 +
 +
====Extensibility====
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! purpose
 +
|-
 +
| <samp>ModData</samp>
 +
| ''(Optional)'' The mod data values to set when the tool is created, accessible in C# code via the <samp>tool.modData</samp> dictionary. For example:
 +
<syntaxhighlight lang="js">
 +
"ModData": {
 +
    "PowerLevel": 9000
 +
}
 +
</syntaxhighlight>
 +
|-
 +
| <samp>SetProperties</samp>
 +
| ''(Optional)'' Set the value of arbitrary properties on the tool class. For example, this would disable the tool animation and require no stamina:
 +
<syntaxhighlight lang="js">
 +
"SetProperties": {
 +
    "InstantUse": true,
 +
    "IsEfficient": true
 +
}
 +
</syntaxhighlight>
 +
|}
 +
 +
==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 a string → model lookup, where...
 +
* The key is the unqualified [[Modding:Common_data_field_types#Item_ID|item ID]] for the weapon.
 +
* The value is model with the fields listed below.
 +
 +
====Basic weapon info====
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! effect
 +
|-
 +
| <samp>Name</samp>
 +
| The internal weapon name.
 +
|-
 +
| <samp>DisplayName</samp><br /><samp>Description</samp>
 +
| A [[Modding:Tokenizable strings|tokenizable string]] for the translated display name & description.
 +
|-
 +
| <samp>Type</samp>
 +
| 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).
 +
|}
 +
 +
====Appearance====
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! effect
 +
|-
 +
| <samp>Texture</samp>
 +
| The asset name for the spritesheet containing the weapon's sprite.
 +
|-
 +
| <samp>SpriteIndex</samp>
 +
| The index within the <samp>Texture</samp> for the weapon sprite, where 0 is the top-left sprite.
 +
|}
 +
 +
====Stats====
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! effect
 +
|-
 +
| <samp>MinDamage</samp><br /><samp>MaxDamage</samp>
 +
| The minimum and maximum based damage caused when hitting a monster with this weapon.
 +
|-
 +
| <samp>Knockback</samp>
 +
| ''(Optional)'' 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). Default 1.
 +
|-
 +
| <samp>Speed</samp>
 +
| ''(Optional)'' 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]]. Default 0.
 +
|-
 +
| <samp>Precision</samp>
 +
| ''(Optional)'' Reduces the chance that a strike will miss. Default 0.
 +
|-
 +
| <samp>Defense</samp>
 +
| ''(Optional)'' Reduces damage received by the player. Default 0.
 +
|-
 +
| <samp>AreaOfEffect</samp>
 +
| ''(Optional)'' Slightly increases the area of effect. Default 0.
 +
|-
 +
| <samp>CritChance</samp>
 +
| ''(Optional)'' The chance of a critical hit, as a decimal value between 0 (never) and 1 (always). Default 0.02.
 +
|-
 +
| <samp>CritMultiplier</samp>
 +
| ''(Optional)'' A multiplier applied to the base damage for a critical hit. This can be a decimal value. Default 3.
 +
|}
 +
 +
====Game logic====
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! effect
 +
|-
 +
| <samp>CanBeLostOnDeath</samp>
 +
| Whether the player can [[Adventurer's Guild#Item Recovery Service|lose this tool when they die]]. Default true.
 +
|-
 +
| <samp>MineBaseLevel</samp><br /><samp>MineMinLevel</samp>
 +
| ''(Optional)'' The base and minimum mine level, which affect [[#Mine container drops|mine container drops]]. Both default to -1, which disables automatic mine drops.
 +
|}
 +
 +
====Advanced====
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! effect
 +
|-
 +
| <samp>Projectiles</samp>
 +
| ''(Optional)'' The projectiles fired when the weapon is used, which continue along their path until they hit a monster and cause damage. A separate projectile is fired for each entry in this list.
 +
 +
This consists of a list of models with these fields (one projectile will fire for each entry in the list):
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! effect
 +
|-
 +
| <samp>Id</samp>
 +
| The [[Modding:Common data field types#Unique string ID|unique string ID]] for the projectile within the current weapon's data.
 +
|-
 +
| <samp>Damage</samp>
 +
| ''(Optional)'' The amount of damage caused when the projectile hits a monster. Default 10.
 +
|-
 +
| <samp>Explodes</samp>
 +
| ''(Optional)'' Whether the projectile explodes when it collides with something. Default false.
 +
|-
 +
| <samp>Bounces</samp>
 +
| ''(Optional)'' The number of times the projectile can bounce off walls before being destroyed. Default 0.
 +
|-
 +
| <samp>MaxDistance</samp>
 +
| ''(Optional)'' The maximum tile distance the projectile can travel. Default 4.
 +
|-
 +
| <samp>Velocity</samp>
 +
| ''(Optional)'' The speed at which the projectile moves. Default 10.
 +
|-
 +
| <samp>RotationVelocity</samp>
 +
| ''(Optional)'' The rotation velocity. Default 32.
 +
|-
 +
| <samp>TailLength</samp>
 +
| ''(Optional)'' The length of the tail which trails behind the main projectile. Default 1.
 +
|-
 +
| <samp>FireSound</samp><br /><samp>BounceSound</samp><br /><samp>CollisionSound</samp>
 +
| ''(Optional)'' The sound played when the projectile is fired, bounces off a wall, or collides with something. All three default to none.
 +
|-
 +
| <samp>MinAngleOffset</samp><br /><samp>MaxAngleOffset</samp>
 +
| ''(Optional)'' A random offset applied to the direction of the project each time it's fired. Both fields default to 0, in which case it's always shot at the 90° angle matching the player's facing direction.
 +
|-
 +
| <samp>SpriteIndex</samp>
 +
| ''(Optional)'' The sprite index in the <samp>TileSheets/Projectiles</samp> asset to draw for this projectile. Defaults to 11 (a glowing-yellow-ball sprite).
 +
|-
 +
| <samp>Item</samp>
 +
| ''(Optional)'' The item to shoot. If set, this overrides <samp>SpriteIndex</samp>.
 +
 +
This consists of a list of models with these fields:
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! effect
 +
|-
 +
| ''common fields''
 +
| See [[Modding:Item queries#Item spawn fields|item spawn fields]] for the generic item fields supported for ammo items.
 +
 +
If set to an [[Modding:Item queries|item query]] which returns multiple items, one of them will be selected at random.
 +
|}
 +
|}
 +
 +
Note that these are magic projectiles fired when the weapon is used, they're not aimed directly like [[slingshot]] projectiles.
 +
|-
 +
| <samp>CustomFields</samp>
 +
| The [[Modding:Common_data_field_types#Custom_fields|custom fields]] for this entry.
 +
|}
 
Weapons have a hardcoded category of -98 (<samp>Object.weaponCategory</samp>).
 
Weapons have a hardcoded category of -98 (<samp>Object.weaponCategory</samp>).
   Line 1,474: Line 1,974:     
<ol>
 
<ol>
<li>Match weapons whose minimum mine level ([[#Format|field 10]]) is less than the current mine level.</li>
+
<li>Match weapons whose [[#Game logic|minimum mine level]] 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:
+
<li>From that list, match weapons with a probability check based on the gap between the [[#Game logic|base mine level]] and current mine level. The probability is a bell curve centered on the base mine level:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
24

edits

Navigation menu