Changes

m
SpouseRoom and SpousePatio have the Maps/ (plural) prefix added, not Map/ (singular).
Line 2: Line 2:     
{{Modder compatibility header}}
 
{{Modder compatibility header}}
{{upcoming|1.6.0}}
     −
This page explains how to update your mods for compatibility with the next major game version (tentatively {{version|1.6.0|Stardew Valley 1.6.0}}), and documents some of the changes and new functionality. See also [[Modding:Migrate to SMAPI 4.0|''Migrate to SMAPI 4.0'']].
+
This page explains how to update your mods for compatibility with {{version|1.6|Stardew Valley 1.6}}, and documents some of the changes and new functionality. See also [[Modding:Migrate to SMAPI 4.0|''Migrate to SMAPI 4.0'']].
 
  −
'''This describes an unreleased alpha version of the game. Things ''will'' change before it's released!'''
      
{{TOC|limit=3}}
 
{{TOC|limit=3}}
Line 18: Line 15:     
===How to update your mod===
 
===How to update your mod===
# Update your mod code and assets for the changes listed below (particularly [[#Breaking changes for C# mods|''Breaking changes for C# mods'']] and [[#Breaking changes for content packs|''Breaking changes for content packs'']]).
+
The rest of this page may seem overwhelming, but fortunately most of it probably doesn't apply to your specific mods. Here's a suggested 'quick start' guide to update a mod for Stardew Valley 1.6.
# If SMAPI still says your mod is incompatible, check the <samp>TRACE</samp> messages in the log file for the reason why.<br />If the logs say "''marked 'assume broken' in SMAPI's internal compatibility list''", you can increase the <samp>Version</samp> in your content pack's <samp>manifest.json</samp> file to bypass it.
+
 
# Test the mod in-game and make any other changes needed.
+
; For C# mods&#58;
 +
:# Update the [https://www.nuget.org/packages/Pathoschild.Stardew.ModBuildConfig mod build config NuGet package] to the latest version.
 +
:# In each <samp>.csproj</samp> project file, change <code>&lt;TargetFramework&gt;net5.0&lt;/TargetFramework&gt;</code> to <code>&lt;TargetFramework&gt;net6.0&lt;/TargetFramework&gt;</code>.<br /><small>(Tip: if the second line looks like <code>&lt;Project ToolsVersion=...</code> instead of <code>&lt;Project Sdk="Microsoft.NET.Sdk"&gt;</code>, you'll need to [[Modding:Migrate to Stardew Valley 1.5.5|migrate it to Stardew Valley 1.5.5]] first.)</small>
 +
:# Rebuild the solution.
 +
:# Fix any build errors. You can search this page for relevant info as needed.
 +
:# Review all build warnings (particularly obsolete-code warnings), which may indicate code that broke in 1.6.
 +
:# Increment your mod version in <samp>manifest.json</samp>.<br /><small>(Some mods may be added to SMAPI's compatibility blacklist due to runtime errors. Incrementing the mod version will fix that if so.)</small>
 +
:# Test to make sure the mod works.
 +
:# Skim through [[#Breaking changes for C# mods|''breaking changes for C# mods'']] and the table of contents, and check any section that might be relevant to the mod.
 +
 
 +
; For [[Modding:Content Patcher|Content Patcher]] packs&#58;
 +
:# Follow the [https://smapi.io/cp-migrate Content Patcher migration guide] until your content pack has <code>"Format": "2.0.0"</code>.<br /><small>'''Do not skip this step!''' Content Patcher will assume your content pack is pre-1.6 if you don't, which can cause confusing errors if you already updated it.</small>
 +
:# Review [[#Breaking changes for content packs|''breaking changes for content packs'']] and update the content pack as needed.
 +
 
 +
; For content packs which use another framework&#58;
 +
: See the documentation for the framework mod. Often you won't need to update the content pack if the framework mod itself was updated.
    
==What's new architecturally?==
 
==What's new architecturally?==
Line 34: Line 46:     
===Trigger actions===
 
===Trigger actions===
 +
{{/doc status|[[Modding:Trigger actions]]|done=true}}
 +
 
Trigger actions are a new feature which lets content packs perform an action when something happens, with support for a wide range of actions (like sending mail, changing friendship, starting a quest, etc).
 
Trigger actions are a new feature which lets content packs perform an action when something happens, with support for a wide range of actions (like sending mail, changing friendship, starting a quest, etc).
   Line 48: Line 62:  
}
 
}
 
</syntaxhighlight>
 
</syntaxhighlight>
  −
See [[Modding:Trigger actions]] for more info.
      
===Hash set fields===
 
===Hash set fields===
Line 106: Line 118:     
In Stardew Valley 1.6, you can now rewrite that code like <code>DataLoader.PassiveFestivals(Game1.content)</code>. That's simpler, you can't use the wrong asset name or type, and it's more future-proof in case the game changes them.
 
In Stardew Valley 1.6, you can now rewrite that code like <code>DataLoader.PassiveFestivals(Game1.content)</code>. That's simpler, you can't use the wrong asset name or type, and it's more future-proof in case the game changes them.
 +
 +
===Unique string IDs===
 +
{{/doc status|[[Modding:Common data field types#Unique string ID]]|done=true}}
 +
 +
Stardew Valley now uses ''unique string IDs'' throughout the code to identify data (like events, locations, items, NPCs, etc). For example, <code>Town</code> is the unique ID for the [[Pelican Town]] location; no other location can use that ID. The IDs are used for a wide range of purposes, from internal game logic to [[Modding:Content Patcher|content pack edits]].
 +
 +
For mods, it's '''strongly recommended''' to...
 +
* Use namespaced IDs prefixed with your [[Modding:Modder Guide/APIs/Manifest#Basic fields|mod's unique ID]] for all new content. For example, if your mod ID is <code>Example.PufferchickMod</code> and you're adding a pufferchick plushy, your item ID would look like <code>Example.PufferchickMod_PufferchickPlushy</code>. In a [[Modding:Content Patcher|Content Patcher pack]], you can use <code><nowiki>{{ModId}}_PufferchickPlushy</nowiki></code> to insert your mod ID automatically. This eliminates ID conflicts between mods, and makes it easy (for both troubleshooters and mod code) to identify which mod added a particular content. See [[Modding:Common data field types#Unique string ID|the new format docs]] for the recommended format.
 +
* Only use alphanumeric (a–z, A–Z, 0–9), underscore (<code>_</code>), and dot (<code>.</code>) characters in string IDs. This is important because they're often used in places where some characters have special meaning (like file names or [[#Game state queries|game state queries]]).
 +
 +
You can optionally migrate pre-1.6 content to use unique string IDs too, without breaking existing players' saves. This is recommended to reduce mod conflicts and simplify troubleshooting going forward. Here's how to migrate for each data type:
 +
{{collapse|migration steps for pre-1.6 content|content=&#32;
 +
{{{!}} class="wikitable"
 +
{{!}}-
 +
! content type
 +
! how to change IDs
 +
{{!}}-
 +
{{!}} [[Modding:Event data|event IDs]]<br />[[Modding:Items|item IDs]]<br />[[Modding:Mail data|mail IDs]]<br />[[Modding:Recipe data|recipe IDs]]<br />[[#Custom jukebox tracks|song IDs for jukebox]]
 +
{{!}} [[Modding:Content Patcher|Content Patcher]] adds a custom [[Modding:Trigger actions|trigger action]] which can migrate IDs everywhere in the save data.
 +
 +
For example, this migrates two crafting recipe IDs:
 +
<syntaxhighlight lang="js">
 +
{
 +
    "Action": "EditData",
 +
    "Target": "Data/TriggerActions",
 +
    "Entries": {
 +
        "{{ModId}}_MigrateToUniqueIds": {
 +
            "Id": "{{ModId}}_MigrateToUniqueIds",
 +
            "Trigger": "DayStarted",
 +
            "Actions": [
 +
                // Note: use double-quotes around an argument if it contains spaces. This example has single-quotes for
 +
                // the action itself, so we don't need to escape the double-quotes inside it.
 +
                'Pathoschild.ContentPatcher_MigrateIds CraftingRecipes "Puffer Plush" {{ModId}}_PufferPlush "Puffer Sofa" {{ModId}}_PufferSofa'
 +
            ],
 +
            "HostOnly": true
 +
        }
 +
    }
 +
}
 +
</syntaxhighlight>
 +
 +
See the [https://github.com/Pathoschild/StardewMods/blob/develop/ContentPatcher/docs/author-guide/trigger-actions.md Content Patcher docs] for more info about using the trigger action, including restrictions and valid ID types.
 +
{{!}}-
 +
{{!}} [[Modding:Location data|location IDs]]
 +
{{!}} Add the old name to the location's <samp>FormerLocationNames</samp> field in <samp>Data/Locations</samp>.
 +
{{!}}-
 +
{{!}} [[Modding:NPC data|NPC internal names]]
 +
{{!}} Add the old name to the NPC's <samp>FormerCharacterNames</samp> field in <samp>Data/Characters</samp>.
 +
{{!}}-
 +
{{!}} [[Modding:Quest data|quest]] and [[Modding:Special orders|special order]] IDs
 +
{{!}} Currently there's no safe way to migrate quest and special order IDs, since removing and readding them will reset any progress the player has made on them.
 +
{{!}}}
 +
}}
    
==What's new for items==
 
==What's new for items==
 
===Custom items===
 
===Custom items===
 +
{{/doc status|[[Modding:Items]]|done=true}}
 +
 
====Overview====
 
====Overview====
 
Stardew Valley 1.6 makes three major changes to how items work in the game:
 
Stardew Valley 1.6 makes three major changes to how items work in the game:
Line 126: Line 192:  
| <samp>ItemId</samp>
 
| <samp>ItemId</samp>
 
| <samp>string</samp>
 
| <samp>string</samp>
| A [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for this item which should be globally unique (but may not be for existing vanilla items for backwards compatibility). For example, <samp>128</samp> (vanilla item) or <samp>Example.ModId_Watermelon</samp> (custom item).
+
| A [[Modding:Common data field types#Unique string ID|unique string ID]] for this item which should be globally unique (but may not be for existing vanilla items for backwards compatibility). For example, <samp>128</samp> (vanilla item) or <samp>Example.ModId_Watermelon</samp> (custom item).
 
|-
 
|-
 
| <samp>QualifiedItemId</samp>
 
| <samp>QualifiedItemId</samp>
Line 252: Line 318:  
====Define a custom item====
 
====Define a custom item====
 
You can define custom items for most vanilla item types using only [[Modding:Content Patcher|Content Patcher]] or [[Modding:Modder Guide/APIs/Content|SMAPI's content API]].
 
You can define custom items for most vanilla item types using only [[Modding:Content Patcher|Content Patcher]] or [[Modding:Modder Guide/APIs/Content|SMAPI's content API]].
  −
For example, this content pack adds a new Pufferchick item with a custom image, custom gift tastes, and a custom crop that produces it. Note that item references in other data assets like <samp>Data/Crops</samp> and <samp>Data/NPCGiftTastes</samp> use the item ID.
  −
  −
{{#tag:syntaxhighlight|<nowiki>
  −
{
  −
    "Format": "</nowiki>{{Content Patcher version}}<nowiki>",
  −
    "Changes": [
  −
        // add item
  −
        {
  −
            "Action": "EditData",
  −
            "Target": "Data/Objects",
  −
            "Entries": {
  −
                "Example.ModId_Pufferchick": {
  −
                    "Name": "Pufferchick",
  −
                    "Displayname": "Pufferchick",
  −
                    "Description": "An example object.",
  −
                    "Type": "Seeds",
  −
                    "Category": -74,
  −
                    "Price": 1200,
  −
  −
                    "Texture": "Mods/Example.ModId/Objects",
  −
                    "SpriteIndex": 0
  −
            }
  −
        },
  −
  −
        // add gift tastes
  −
        {
  −
            "Action": "EditData",
  −
            "Target": "Data/NPCGiftTastes",
  −
            "TextOperations": [
  −
                {
  −
                    "Operation": "Append",
  −
                    "Target": ["Entries", "Universal_Love"],
  −
                    "Value": "Example.ModId_Pufferchick",
  −
                    "Delimiter": " " // if there are already values, add a space between them and the new one
  −
                }
  −
            ]
  −
        },
  −
  −
        // add crop (Pufferchick is both seed and produce, like coffee beans)
  −
        {
  −
            "Action": "EditData",
  −
            "Target": "Data/Crops",
  −
            "Entries": {
  −
                "Example.ModId_Pufferchick": {
  −
                    "Seasons": [ "spring", "summer", "fall" ],
  −
                    "DaysInPhase": [ 1, 1, 1, 1, 1 ],
  −
                    "HarvestItemId": "Example.ModId_Pufferchick",
  −
  −
                    "Texture": "Mods/Example.ModId/Crops",
  −
                    "SpriteIndex": 0
  −
            }
  −
        },
  −
  −
        // add item + crop images
  −
        {
  −
            "Action": "Load",
  −
            "Target": "Mods/Example.ModId/Crops, Mods/Example.ModId/Objects",
  −
            "FromFile": "assets/{{TargetWithoutPath}}.png" // assets/Crops.png, assets/Objects.png
  −
        },
  −
    ]
  −
}</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 [[#Custom fruit trees|custom fruit trees]], [[#Custom tools|custom tools]], and [[#Custom melee weapon data|melee weapons]].
Line 323: Line 327:     
====For C# mods====
 
====For C# mods====
<dl style="margin-left: 2em;">
     −
<dt>Compare items</dt>
+
Stardew Valley 1.6 added new ways to compare/construct items, define custom item types, and work with item metadata. Please see [[Modding:Items]] for the migrated docs.
<dd>
  −
Since <samp>Item.QualifiedItemId</samp> is globally unique, it can be used to simplify comparing items. For example:
     −
{| class="wikitable"
+
===Custom big craftables===
|-
+
{{/doc status|[[Modding:Items#Big craftables]]|done=true}}
! old code
+
 
! new code
+
You can now create/edit [[Modding:Items#Big craftables|big craftables]] by editing the new <samp>Data/BigCraftables</samp> asset, which replaces the previous slash-delimited <samp>Data/BigCraftablesInformation</samp>.
|-
+
 
|-
+
Besides the format change, this adds...
| <samp>item.ParentSheetIndex == 128</samp>
+
* context tags (moved from the former <samp>Data/ObjectContextTags</samp> asset);
| <samp>item.QualifiedItemId == "(O)128"</samp>
+
* [[#Custom data fields|custom fields]] to let framework mods support additional features.
|-
+
 
| <samp>IsNormalObjectAtParentSheetIndex(item, 128)</samp>
+
===Custom crops===
| <samp>item.QualifiedItemId == "(O)128"</samp>
+
{{/doc status|[[Modding:Crop data]]|done=true}}
|-
+
 
| <samp>!item.bigCraftable && item.ParentSheetIndex == 128</samp>
+
[[Modding:Crop data|Crops]] are still stored in <samp>Data/Crops</samp>, but that asset has been overhauled in Stardew Valley 1.6. The slash-delimited entries are now models to simplify edits and enable new features.
| <samp>item.QualifiedItemId == "(O)128"</samp>
+
 
|-
+
===Custom fences===
| <samp>item is Boots && item.ParentSheetIndex == 505</samp>
+
{{/doc status|[[Modding:Fences]]|done=true}}
| <samp>item.QualifiedItemId == "(B)505"</samp>
+
 
|}
+
You can now add or customize [[Crafting#Fences|fences]] by editing the <samp>Data/Fences</samp> asset.
 +
 
 +
===Custom floors (craftable) & paths===
 +
{{/doc status|[[Modding:Floors and Paths]]|done=true}}
   −
You can also use <samp>ItemRegistry.QualifyItemId</samp> to convert any item ID into a qualified one (if it's valid), and <samp>ItemRegistry.HasItemId</samp> to check if an item has a qualified or unqualified item ID.
+
You can now add or customize [[Crafting#Decor|craftable floors & paths]] by editing the <samp>Data/FloorsAndPaths</samp> asset. See the new doc page for formatting information.
   −
Note that flavored item don't have their own ID. For example, Blueberry Wine and Wine are both <samp>(O)348</samp>. This affects flavored jellies, juices, pickles, and wines. In those cases you should still compare their separate fields like <samp>preservedParentSheetIndex</samp> (which actually contains the preserved item's <samp>ItemId</samp>, not its <samp>ParentSheetIndex</samp>).
+
===Custom machines===
</dd>
+
{{/doc status|[[Modding:Machines]]|done=true}}
   −
<dt>Construct items</dt>
+
You can now add/edit machine logic by editing the <samp>Data/Machines</samp> asset. This supports the full range of vanilla functionality, including calling custom code define in C# mods.
<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:
     −
<syntaxhighlight lang="c#">
+
For C# mods, 1.6 also adds a new <samp>MachineDataUtility</samp> class and various <samp>Object</samp> to simplify working with machines in code. These are used by the game code itself to implement the base machine logic.
new Object("128", 1);                      // vanilla item
  −
new Object("Example.ModId_Watermelon", 1); // custom item
  −
</syntaxhighlight>
     −
You can use a new utility method to construct items from their <samp>QualifiedItemId</samp>:
+
===Custom melee weapons===
 +
{{/doc status|[[Modding:Items#Weapons]]|done=true}}
   −
<syntaxhighlight lang="c#">
+
[[Modding:Items#Weapons|Melee weapons]] are still stored in <samp>Data/Weapons</samp>, but that asset has been overhauled in Stardew Valley 1.6. The slash-delimited entries are now models to simplify edits and enable new features (like the new <samp>Projectiles</samp> feature).
Item item = ItemRegistry.Create("(B)505"); // Rubber Boots
  −
</syntaxhighlight>
  −
</dd>
     −
<dt>Define custom item types</dt>
+
===Custom movie concessions===
<dd>You can implement <samp>IItemDataDefinition</samp> for your own item type, and call <samp>ItemRegistry.AddTypeDefinition</samp> to register it. This provides all the logic needed by the game to handle the item type: where to get item data, how to draw them, etc.
+
{{/doc status|[[Modding:Movie theater data]]|done=true}}
 +
: ''See also: [[#Custom movies|custom movies]].''
   −
'''This is extremely specialized''', and multiplayer compatibility is unknown. Most mods should add custom items within the existing types instead.</dd>
+
You could already [[Modding:Movie theater data#Concession data|add/edit concessions]] sold in the [[Movie Theater|movie theater]], but conflicts were likely since each concession had an incrementing numeric ID which matched its position in the vanilla tilesheet.
   −
<dt>New <samp>Is*</samp> methods</dt>
+
Stardew Valley 1.6 addresses that with two changes:
<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):
+
<ul>
 +
<li>The <samp>Id</samp> field is now a [[Modding:Common data field types#Unique string ID|unique string ID]].</li>
 +
<li>You can now use a different texture with two new required fields:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! method
+
! field
 
! effect
 
! effect
 
|-
 
|-
| <samp>object.IsBar()</samp>
+
| <samp>Texture</samp>
| Whether the item is a [[Copper Bar|copper bar]], [[Iron Bar|iron bar]], [[Gold Bar|gold bar]], [[Iridium Bar|iridium bar]], or [[Radioactive Bar|radioactive bar]].
+
| The asset name for the texture containing the concession's sprite.
 
|-
 
|-
| <samp>object.IsBreakableStone()</samp>
+
| <samp>SpriteIndex</samp>
| Whether the item is a stone debris item which can be broken by a pickaxe.
+
| The index within the <samp>Texture</samp> for the concession sprite, where 0 is the top-left sprite.
|-
+
|}
| <samp>object.IsFence()</samp>
+
</li>
| Whether the item is a [[Crafting#Fences|fence]].
+
</ul>
|-
  −
| <samp>object.IsFruitTreeSapling()</samp>
  −
| Whether the item is a [[Fruit Trees|fruit tree]] sapling. This checks the <samp>Data\fruitTrees</samp> keys, so it works with custom fruit trees too.
  −
|-
  −
| <samp>object.IsHeldOverHead()</samp>
  −
| Whether the player is shown holding up the item when it's selected in their toolbar. Default true (except for furniture).
  −
|-
  −
| <samp>object.IsIncubator()</samp>
  −
| Whether the item can incubate [[Animals|farm animal]] eggs when placed in a building.
  −
|-
  −
| <samp>object.IsTapper()</samp>
  −
| Whether the item is a [[Tapper|tapper]] or [[Heavy Tapper|heavy tapper]].
  −
|-
  −
| <samp>object.IsTeaSapling()</samp>
  −
| Whether the item is a [[Tea Sapling|tea sapling]].
  −
|-
  −
| <samp>object.IsTwig()</samp>
  −
| Whethere the item is a twig debris item.
  −
|-
  −
| <samp>object.IsWeeds()</samp>
  −
| Whether the item is a weed debris item.
  −
|}
  −
</dd>
     −
<dt>Work with item metadata</dt>
+
===Custom museum donations & rewards===
<dd>
+
{{/doc status|[[Modding:Museum]]|done=true}}
1.6 adds an <samp>ItemRegistry</samp> API for working with the new item system. Some of the provided methods are:
     −
{| class="wikitable"
+
You can now add/edit the items which the [[museum]] gives back in rewards through the new <samp>Data/MuseumRewards</samp> data asset.
|-
  −
! method
  −
! effect
  −
|-
  −
| <samp>ItemRegistry.Create</samp>
  −
| Create an item from its item ID (qualified or unqualified). If the ID doesn't match a real item, the optional <samp>allowNull</samp> parameter indicates whether to return null or an Error Item. For example:
  −
<syntaxhighlight lang="c#">
  −
Item item = ItemRegistry.Create("(B)505"); // Rubber Boots
  −
</syntaxhighlight>
     −
You can also get a specific value type instead of <samp>Item</samp> if needed. This will throw a descriptive exception if the type isn't compatible (e.g. you try to convert furniture to boots).
+
The ''A Complete Collection'' [[Achievements|achievement]] is automatically adjusted to require any custom donations added too. This is based on the number of donated items though, so removing custom donations later may incorrectly mark the museum complete (since you may have donated enough items to meet the total required).
<syntaxhighlight lang="c#">
  −
Boots item = ItemRegistry.Create<Boots>("(B)505"); // Rubber Boots
  −
</syntaxhighlight>
  −
|-
  −
| <samp>ItemRegistry.Exists</samp>
  −
| Get whether a qualified or unqualified item ID matches an existing item. For example:
  −
<syntaxhighlight lang="c#">
  −
bool pufferfishExist = ItemRegistry.Exists("(O)128");
  −
</syntaxhighlight>
  −
|-
  −
| <samp>ItemRegistry.IsQualifiedId</samp>
  −
| Get whether the given item ID is qualified with the type prefix (like <samp>(O)128</samp> instead of <samp>128</samp>).
  −
|-
  −
| <samp>ItemRegistry.QualifyItemId</samp>
  −
| Get the unique qualified item ID given an unqualified or qualified one. For example:
  −
<syntaxhighlight lang="c#">
  −
string qualifiedId = ItemRegistry.QualifyItemId("128"); // returns (O)128
  −
</syntaxhighlight>
  −
|-
  −
| <samp>ItemRegistry.GetMetadata</samp>
  −
| This lets you get high-level info about an item:
  −
<syntaxhighlight lang="c#">
  −
// get info about Rubber Boots
  −
ItemMetadata info = ItemRegistry.GetMetadata("(B)505");
     −
// get item ID info
+
===Custom fruit trees===
$"The item has unqualified ID {info.LocalId}, qualified ID {info.QualifiedId}, and is defined by the {info.TypeIdentifier} item data definition.";
+
{{/doc status|[[Modding:Fruit trees]]|done=true}}
   −
// does the item exist in the data files?
+
You can now add custom [[Fruit Trees|fruit trees]] by editing the revamped <samp>Data/FruitTrees</samp> asset.
bool exists = info.Exists();
  −
</syntaxhighlight>
     −
And get common parsed item data:
+
For C# mods, the <samp>fruitsOnTree</samp> field (number of fruit on the tree) has been replaced by <samp>fruit</samp> (list of fruit items).
<syntaxhighlight lang="c#">
  −
// get parsed info
  −
ParsedItemData data = info.GetParsedData();
  −
$"The internal name is {data.InternalName}, translated name {data.DisplayName}, description {data.Description}, etc.";
     −
// draw an item sprite
+
Custom trees can be added to the game in two ways:
Texture2D texture = data.GetTexture();
+
* Spawn them on [[Modding:Maps|map tiles]] when the location is created, using the new <samp>SpawnTree: fruit {{t|tree ID}} {{o|growth stage on location created}} {{o|growth stage on day-update regrowth}}</samp> tile property. This must be added on the <samp>Paths</samp> layer, which must also have tile index 34 from the <samp>paths</samp> tilesheet.
Rectangle sourceRect = data.GetSourceRect();
+
* Or give the player a seed item in the usual ways (e.g. from [[#Custom shops|a shop]], [[Modding:Mail data|mail letter]], etc).
spriteBatch.Draw(texture, Vector2.Zero, sourceRect, Color.White);
  −
</syntaxhighlight>
     −
And create an item:
+
===Custom objects===
<syntaxhighlight lang="c#">
+
{{/doc status|[[Modding:Items#Objects]]|done=true}}
Item item = metadata.CreateItem();
  −
</syntaxhighlight>
     −
And get the type definition (note that this is very specialized, and you should usually use <samp>ItemRegistry</samp> instead to benefit from its caching and optimizations):
+
You can now create/edit objects (the main item type) by editing the new <samp>Data/Objects</samp> asset, which replaces the previous slash-delimited <samp>Data/objectInformation</samp>.
<syntaxhighlight lang="c#">
  −
IItemDataDefinition typeDefinition = info.GetTypeDefinition();
  −
</syntaxhighlight>
  −
|-
  −
| <samp>ItemRegistry.ResolveMetadata</samp>
  −
| Equivalent to <samp>ItemRegistry.GetMetadata</samp>, except that it'll return null if the item doesn't exist.
  −
|-
  −
| <samp>ItemRegistry.GetData</samp>
  −
| Get the parsed data about an item, or <samp>null</samp> if the item doesn't exist. This is a shortcut for <code>ItemRegistry.ResolveMetadata(id)?.GetParsedData()</code>; see the previous method for info on the parsed data.
  −
|-
  −
| <samp>ItemRegistry.GetDataOrErrorItem</samp>
  −
| Equivalent to <samp>ItemRegistry.GetData</samp>, except that it'll return info for an Error Item if the item doesn't exist (e.g. for drawing in inventory).
  −
|-
  −
| <samp>ItemRegistry.GetErrorItemName</samp>
  −
| Get a translated ''Error Item'' label.
  −
|}
  −
</dd>
  −
</dl>
  −
 
  −
===Custom big craftables===
  −
You can now create/edit [[Modding:Items#Big craftables|big craftables]] by editing the new <samp>Data/BigCraftables</samp> asset, which replaces the previous slash-delimited <samp>Data/BigCraftablesInformation</samp>.
      
Besides the format change, this adds...
 
Besides the format change, this adds...
 +
* support for custom textures;
 +
* revamped geode drops with support for conditions, probabilities, and item queries;
 +
* expanded food/drink buffs (e.g. set a custom buff ID, add a custom buff icon, etc);
 
* context tags (moved from the former <samp>Data/ObjectContextTags</samp> asset);
 
* context tags (moved from the former <samp>Data/ObjectContextTags</samp> asset);
 
* [[#Custom data fields|custom fields]] to let framework mods support additional features.
 
* [[#Custom data fields|custom fields]] to let framework mods support additional features.
   −
This consists of a string → model lookup, where...
+
===Custom pants===
* The key is the unqualified [[#Custom items|item ID]].
+
{{/doc status|[[Modding:Items#Pants]]|done=true}}
* The value is a model with the fields listed below.
+
 
 +
You can now create/edit [[Tailoring#Pants|pants]] by editing the new <samp>Data/Pants</samp> asset, which replaces <samp>Data/clothingInformation</samp>.
 +
 
 +
===Custom shirts===
 +
{{/doc status|[[Modding:Items#Shirts]]|done=true}}
 +
 
 +
You can now create/edit [[Tailoring#Shirts|shirts]] by editing the new <samp>Data/Shirts</samp> asset, which replaces <samp>Data/clothingInformation</samp>.
 +
 
 +
===Custom tools===
 +
{{/doc status|[[Modding:Items#Tools]]|done=true}}
 +
 
 +
You can now create/edit [[tools]] by editing the new <samp>Data/Tools</samp> asset. Note that drawing the tool correctly in the world (ie, while the player is trying to use it) probably still needs custom code.
 +
 
 +
===Custom wild trees===
 +
{{/doc status|[[Modding:Wild trees]]|done=true}}
 +
 
 +
You can now create/edit [[Trees|wild trees]] by editing the <samp>Data/WildTrees</samp> asset.
 +
 
 +
Custom trees can be added to the game in two ways:
 +
* Spawn them on [[Modding:Maps|map tiles]] when the location is created, using the new <samp>SpawnTree: wild {{t|tree ID}} {{o|growth stage on location created}} {{o|growth stage on day-update regrowth}}</samp> tile property. This must be added on the <samp>Paths</samp> layer, which must also have tile index 34 from the <samp>paths</samp> tilesheet.
 +
* Or give the player a seed item in the usual ways (e.g. from [[#Custom shops|a shop]], [[Modding:Mail data|mail letter]], etc).
 +
 
 +
===Default recipes===
 +
{{/doc status|[[Modding:Recipe data]]|done=true}}
 +
 
 +
You can now have [[Modding:Recipe data|crafting and cooking recipes]] that are learned automatically by setting the condition field to <samp>default</samp>. Any missing default recipes will be learned on day start.
 +
 
 +
For example, here's the chest entry from <samp>Data/CraftingRecipes</samp>:
 +
<syntaxhighlight lang="js">
 +
"Chest": "388 50/Home/130/true/default/"
 +
</syntaxhighlight>
 +
 
 +
===Global inventories===
 +
C# mods can now set a <samp>chest.GlobalInventoryId</samp> field to make it share a global inventory with every other chest having the same ID. This replaces the equivalent hardcoded logic for [[Junimo Chest|Junimo chests]], which now just default to a <samp>"JunimoChests"</samp> global inventory ID. For example, this can be used to have multiple Junimo chest networks or make other containers share inventory.
 +
 
 +
C# mods can also use this to store items for other mod purposes, by using <samp>Game1.player.team.globalInventories</samp> or <samp>Game1.player.team.GetOrCreateGlobalInventory(id)</samp> directly.
 +
 
 +
===Hats on aquarium fish===
 +
{{/doc status|[[Modding:Fish data]]|done=true}}
 +
 
 +
Custom [[Modding:Fish data|fish in aquariums]] can now wear [[hats]], just like vanilla [[Sea Urchin|sea urchins]]. This can be enabled by specifying a new field in <samp>Data/AquariumFish</samp>:
   −
====Basic info====
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
 +
! index
 
! field
 
! field
 
! purpose
 
! purpose
 
|-
 
|-
| <samp>Name</samp>
+
| 7
| The internal item name.
+
| hat position
|-
+
| The pixel position of the hat on the sprite, specified as an object with <samp>X</samp> and <samp>Y</samp> values.
| <samp>DisplayName</samp><br /><samp>Description</samp>
  −
| A [[Modding:Tokenizable strings|tokenizable string]] for the item's in-game display name and description.
  −
|-
  −
| <samp>Price</samp>
  −
| ''(Optional)'' The price when sold by the player. This is not the price when bought from a shop. Default 0.
   
|}
 
|}
   −
====Behavior====
+
===Context tag changes===
 +
{{/doc status|[[Modding:Items#Context tags]]|done=true}}
 +
 
 +
====New context tags====
 +
1.6 adds several new [[Modding:Items#Context tags|item context tags]]:
 +
 
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! field
+
! context tag
! purpose
+
! effect
 
|-
 
|-
| <samp>Fragility</samp>
+
| <samp>campfire_item</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.
+
| 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>CanBePlacedIndoors</samp><br /><samp>CanBePlacedOutdoors</samp>
+
| <samp>fish_pond_ignore</samp>
| ''(Optional)'' Whether the item can be placed indoors or outdoors. Default true.
+
| Prevents players from adding this fish to [[Fish Pond|fish ponds]], even if it would otherwise match an entry in <samp>Data/FishPondData</samp>.
 
|-
 
|-
| <samp>IsLamp</samp>
+
| <samp>geode_crusher_ignored</samp>
| ''(Optional)'' Whether this is a lamp and should produce light when dark. Default false.
+
| Prevents breaking this item open in a [[Geode Crusher|geode crusher]], even if the item has geode fields in [[#Custom objects|<samp>Data/Objects</samp>]].
|}
  −
 
  −
====Appearance====
  −
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>item_type_{{t|type}}</samp>
! purpose
+
| 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.
 
|-
 
|-
| <samp>Texture</samp>
+
| <samp>museum_donatable</samp><br /><samp>not_museum_donatable</samp>
| ''(Optional)'' The asset name for the texture containing the item's sprite. Defaults to <samp>TileSheets/Craftables</samp>.
+
| Set whether the item can be donated to the [[museum]], overriding the vanilla logic.
 
|-
 
|-
| <samp>SpriteIndex</samp>
+
| <samp>not_giftable</samp>
| ''(Optional)'' The sprite's index within the <samp>Texture</samp>, where 0 is the top-left sprite.
+
| Prevents players from gifting this item to NPCs, who'll ignore the item entirely (e.g. as if you were holding a tool).
|}
     −
====Context tags====
+
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.
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>not_placeable</samp><br /><samp>placeable</samp>
! purpose
+
| Sets whether the item can be placed on the ground.
 
|-
 
|-
| <samp>ContextTags</samp>
+
| <samp>prevent_loss_on_death</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:
+
| Indicates the item can't be [[Adventurer's Guild#Item Recovery Service|lost when the player dies]].
<syntaxhighlight lang="json">
  −
"ContextTags": [ "light_source", "torch_item" ]
  −
</syntaxhighlight>
  −
|}
  −
 
  −
====Advanced====
  −
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>sign_item</samp>
! purpose
+
| 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>CustomFields</samp>
+
| <samp>torch_item</samp>
| ''(Optional)'' The [[#Custom data fields|custom fields]] for this entry.  
+
| Marks the item as a [[torch]], which lets the player turn it on/off to emit light.
 +
 
 +
See also <samp>campfire_item</samp>.
 
|}
 
|}
   −
===Custom crops===
+
Context tags which affect [[#Custom machines|machine processing]]:
[[Modding:Crop data|Crops]] are still stored in <samp>Data/Crops</samp>, but that asset has been overhauled in Stardew Valley 1.6. The slash-delimited entries are now models to simplify edits and enable new features.
  −
 
  −
This consists of a string → model lookup, where...
  −
* The key is the unqualified [[#Custom items|item ID]] for the seed item.
  −
* The value is model with the fields listed below.
  −
 
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! field
+
! context tag
 
! effect
 
! effect
 
|-
 
|-
!colspan="2"| Growth
+
| <samp>crystalarium_banned</samp>
 +
| When applied to a gem or mineral item, prevents players from placing it in a [[crystalarium]].
 
|-
 
|-
| <samp>Seasons</samp>
+
| <samp>keg_juice</samp><br /><samp>keg_wine</samp>
| The seasons in which this crop can grow (any combination of <samp>spring</samp>, <samp>summer</samp>, <samp>fall</samp>, and <samp>winter</samp>).
+
| Allows processing the item in a [[keg]] to produce a juice or wine variant.
 
|-
 
|-
| <samp>DaysInPhase</samp>
+
| <samp>preserves_jelly</samp><br /><samp>preserves_pickle</samp>
| The number of days in each visual step of growth before the crop is harvestable. Each step corresponds to a sprite in the crop's row (see <samp>SpriteIndex</samp>).
+
| Allows processing the item in a [[Preserves Jar|preserves jar]] to produce a jelly or pickled variant.
 
  −
For example, a crop with <code>"DaysInPhase": [ 1, 1, 1, 1 ]</code> will grow from seed to harvestable in 4 days, moving to the next sprite in the row each day.
   
|-
 
|-
| <samp>RegrowDays</samp>
+
| <samp>seedmaker_banned</samp>
| ''(Optional)'' The number of days before the crop regrows after harvesting, or -1 if it can't regrow. The crop will keep the full-grown sprite (i.e. the last phase in <samp>DaysInPhase</samp>) during this time. Default -1.
+
| When applied to a seed item, prevents players from placing it in a [[Seed Maker|seed maker]].
 
|-
 
|-
| <samp>IsRaised</samp>
+
| <samp>tapper_item</samp>
| ''(Optional)'' Whether this is a raised crop on a trellis that can't be walked through. Default false.
+
| Marks the item as a [[tapper]] or [[Heavy Tapper|heavy tapper]].
 
|-
 
|-
| <samp>IsPaddyCrop</samp>
+
| <samp>tapper_multiplier_{{t|multiplier}}</samp>
| ''(Optional)'' Whether this crop can be planted near water for a unique paddy dirt texture, faster growth time, and auto-watering. For example, [[Rice Shoot|rice]] and [[Taro Root|taro]] are paddy crops. Default false.
+
| 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.
|-
+
|}
| <samp>NeedsWatering</samp>
  −
| ''(Optional)'' Whether this crop needs to be watered to grow (e.g. [[Fiber Seeds|fiber seeds]] don't). Default true.
  −
|-
  −
!colspan="2"| Harvest
  −
|-
  −
| <samp>HarvestItemId</samp>
  −
| The item ID produced when this crop is harvested.
  −
|-
  −
| <samp>HarvestMethod</samp>
  −
| ''(Optional)'' How the crop can be harvested. This can be <samp>Grab</samp> (crop is harvested by hand) or <samp>Scythe</samp> (harvested with a [[scythe]]). Default <samp>Grab</samp>.
  −
|-
  −
| <samp>HarvestMinStack</samp><br /><samp>HarvestMaxStack</samp>
  −
| ''(Optional)'' The minimum and maximum number of <samp>HarvestItemId</samp> to produce (before <samp>HarvestMaxIncreasePerFarmingLevel</samp> and <samp>ExtraHarvestChance</samp> are applied). A value within this range (inclusive) will be randomly chosen each time the crop is harvested. The minimum defaults to 1, and the maximum defaults to the minimum.
  −
|-
  −
| <samp>HarvestMinQuality</samp><br /><samp>HarvestMaxQuality</samp>
  −
| ''(Optional)'' If set, the minimum and maximum quality of the harvest crop. These fields set a constraint that's applied after the quality is calculated normally, they don't affect the initial quality logic.
  −
|-
  −
| <samp>HarvestMaxIncreasePerFarmingLevel</samp>
  −
| ''(Optional)'' The number of extra harvests to produce per farming level. This is rounded down to the nearest integer and added to <samp>HarvestMaxStack</samp>. Defaults to 0.
     −
For example, a value of 0.2 is equivalent to +1 max at level 5 and +2 at level 10.
+
And informational tags which have no effect on the game logic:
 +
{| class="wikitable"
 
|-
 
|-
| <samp>ExtraHarvestChance</samp>
+
! context tag
| ''(Optional)'' The probability that harvesting the crop will produce extra harvest items, as a value between 0 (never) and 0.9 (nearly always). This is repeatedly rolled until it fails, then the number of successful rolls is added to the produced count. For example, [[tomato]]es use 0.05. Default 0. This is [https://www.desmos.com/calculator/ok9c2tw6o5 a geometric series with expected value] of <samp>1/(1-ExtraHarvestChance) - 1</samp>, so it will grow faster than you expect it should. For example, with a value of <samp>0.9</samp>, this field has an expected value of nine additional crops.
+
! effect
 
|-
 
|-
!colspan="2"| Appearance
+
| <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 [[#Custom locations|<samp>Data/Locations</samp>]].
 
|-
 
|-
| <samp>Texture</samp>
+
| <samp>geode</samp>
| The asset name for the texture (under the game's <samp>Content</samp> folder) containing the crop sprite. For example, the vanilla crops use <samp>TileSheets\crops</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 [[#Custom objects|<samp>Data/Objects</samp>]].
 
|-
 
|-
| <samp>SpriteIndex</samp>
+
| <samp>id_{{t|item id}}</samp>
| ''(Optional)'' The index of this crop in the <samp>Texture</samp>, one crop per row, where 0 is the top row. Default 0.
+
| ''(Added automatically)'' The [[#Custom items|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>TintColors</samp>
+
| <samp>is_machine</samp>
| ''(Optional)'' The colors with which to tint the sprite when drawn (e.g. for colored flowers). A random color from the list will be chosen for each crop. See [[#Color fields|color format]]. Default none.
+
| ''(Added automatically)'' Indicates the item has [[#Custom machines|machine logic]]. This is added automatically based on <samp>Data/Machines</samp>.
 
|-
 
|-
!colspan="2"| Achievements
+
| <samp>machine_input</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>CountForMonoculture</samp>
+
| <samp>machine_output</samp>
| ''(Optional)'' Whether the player can ship 300 of this crop's harvest item to unlock the monoculture [[achievements|achievement]]. Default false.
+
| ''(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;
| <samp>CountForPolyculture</samp>
+
* ''or'' if it has any output rules.
| ''(Optional)'' Whether the player must ship 15 of this crop's harvest item (along with any other required crops) to unlock the polyculture [[achievements|achievement]]. Default false.
+
|}
|-
  −
!colspan="2"| Advanced
  −
|-
  −
| <samp>PlantableLocationRules</samp>
  −
| ''(Optional)'' The rules to decide which locations you can plant the seed in, if applicable. The first matching rule is used. This can override location checks (e.g. crops being limited to the farm), but not built-in requirements like crops needing dirt.
     −
This consists of a list of models with these fields:
+
====ItemContextTagManager class====
 +
For C# mods, 1.6 adds a new <samp>ItemContextTagManager</samp> class which simplifies working with [[Modding:Items#Context tags|item context tags]] and reduces repeated code.
    +
This provides a few utility methods:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! field
+
! method
 
! effect
 
! effect
 
|-
 
|-
| <samp>Id</samp>
+
| <code>GetBaseContextTags(id)</code>
| The [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for this entry within the list.
+
| 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>Result</samp>
+
| <code>DoesTagQueryMatch(query, tags)</code>
| Indicates whether the seed can be planted in a location if this entry is selected. The possible values are:
+
| 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]]).
* <samp>Default</samp>: the seed can be planted if the location normally allows it. This can be used to stop processing further rules, and/or set a custom <samp>DeniedMessage</samp>.
  −
* <samp>Allow</samp>: the seed can be planted here, regardless of whether the location normally allows it.
  −
* <samp>Deny</samp>: the seed can't be planted here, regardless of whether the location normally allows it.
   
|-
 
|-
| <samp>Condition</samp>
+
| <code>DoAllTagsMatch(requiredTags, actualTags)</code><br /><code>DoAnyTagsMatch(requiredTags, actualTags)</code>
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether this entry applies. Default true.
+
| 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>PlantedIn</samp>
+
| <code>DoesTagMatch(requiredTag, actualTags)</code>
| ''(Optional)'' The planting context to apply this rule for. The possible values are <samp>Ground</samp> (planted directly in dirt), <samp>GardenPot</samp> (planted in a [[Garden Pot|garden pot]]), or <samp>Any</samp>. Default <samp>Any</samp>.
+
| Get whether a single tag matches the actual item tags. This supports negated required tags like <samp>"!fossil_item"</samp> too.
 
|-
 
|-
| <samp>DeniedMessage</samp>
+
| <code>SanitizeContextTag(tag)</code>
| ''(Optional)'' If this rule prevents planting the seed, the tokenizable string to show to the player (or <samp>null</samp> to default to the normal behavior for the context). This also applies when the <samp>Result</samp> is <samp>Default</samp>, if that causes the planting to be denied.
+
| ''(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>.
|}
  −
|-
  −
| <samp>CustomFields</samp>
  −
| The [[#Custom data fields|custom fields]] for this entry.
   
|}
 
|}
   −
For example, this adds a custom cucumber crop (assuming you've already added [[#Custom items|custom items]] for cucumber seeds and cucumber):
+
====Other context tag changes====
{{#tag:syntaxhighlight|<nowiki>
+
* Context tags are now case-insensitive.
{
  −
    "Format": "</nowiki>{{Content Patcher version}}<nowiki>",
  −
    "Changes": [
  −
        {
  −
            "Action": "EditData",
  −
            "Target": "Data/Crops",
  −
            "Entries": {
  −
                "Example.Id_CucumberSeeds": {
  −
                    "Seasons": [ "summer" ],
  −
                    "DaysInPhase": [ 1, 2, 2, 2 ], // grows in 7 days with four growing sprites
  −
                    "HarvestItemId": "Example.Id_Cucumber",
  −
                    "Texture": "{{InternalAssetKey: assets/crops.png}}",
  −
                    "SpriteIndex": 0
  −
                }
  −
            }
  −
        }
  −
    ]
  −
}</nowiki>|lang=javascript}}
     −
===Custom fences===
+
===Inventory class===
You can now add or customize [[Crafting#Fences|fences]] by editing the <samp>Data/Fences</samp> asset.
+
For C# mods, 1.6 adds a new <samp>Inventory</samp> class to manage a list of items. This is used for the <samp>Farmer.items</samp> and <samp>Chest.items</samp> fields. It implements <samp>IList&lt;Item&gt;</samp>, so most existing code should still work fine.
   −
This consists of a string → model lookup, where the key is the [[#Custom items|unqualified item ID]] of the fence object, and the value is a model with these fields:
+
This has three main benefits:
 +
<ul>
 +
<li>It has methods to simplify many common operations. For example:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! field
+
! method
 
! effect
 
! effect
 
|-
 
|-
| <samp>Health</samp>
+
| <code>HasAny()</code>
| The health points for a fence when it's first placed, which affects how quickly it degrades. A fence loses <sup>1</sup>/<sub>1440</sub> points per in-game minute (roughly 0.04 points per hour or 0.5 points for a 12-hour day).
+
| Get whether the inventory contains any items (ignoring empty slots).
 
  −
Repairing a fence sets its max health to ''2 × (base_health + repair_health_adjustment)'', where <samp>base_health</samp> is this field's value and <samp>repair_health_adjustment</samp> is a random value between <samp>RepairHealthAdjustmentMinimum</samp> and <samp>RepairHealthAdjustmentMaximum</samp>.
   
|-
 
|-
| <samp>Texture</samp>
+
| <code>CountItemStacks()</code>
| The asset name for the texture (under the game's <samp>Content</samp> folder) when the fence is placed. Use <samp>\</samp> (or <samp>\\</samp> in JSON) to separate name segments if needed. For example, the vanilla fences use individual tilesheets like <samp>LooseSprites\Fence1</samp> (wood fence).
+
| Get the number of item stacks in the inventory (ignoring empty slots).
 
|-
 
|-
| <samp>RemovalToolIds</samp><br /><samp>RemovalToolTypes</samp>
+
| <code>ContainsId(id)</code>
| A list of tool IDs (matching the keys in <samp>Data\ToolData</samp>) or C# full type names which can be used to break the fence.
+
| Get whether the inventory contains any item with the given qualified or unqualified item ID.
 
  −
For example, this will let the player break the fence with an iridium axe and any pickaxe:
  −
<syntaxhighlight lang="json">
  −
"RemovalToolIds": ["IridiumAxe"],
  −
"RemovalToolTypes": ["StardewValley.Tools.Pickaxe"]
  −
</syntaxhighlight>
  −
 
  −
A tool must match <samp>RemovalToolIds</samp> ''or'' <samp>RemovalToolTypes</samp> to be a valid removal tool. If both lists are null or empty, all tools can remove the fence.
   
|-
 
|-
| <samp>PlacementSound</samp>
+
| <code>ContainsId(id, minCount)</code>
| The [[#Custom audio|audio cue ID]] played when the fence is placed or repaired (e.g. <samp>axe</samp> used by [[Wood Fence]]).
+
| Get whether the inventory contains items with the given qualified or unqualified item ID, and their combined stack size is at least <samp>minCount</samp>.
 
|-
 
|-
| <samp>RemovalSound</samp>
+
| <code>CountId(id)</code>
| ''(Optional)'' The [[#Custom audio|audio cue ID]] played when the fence is broken or picked up by the player. Defaults to the same sound as <samp>PlacementSound</samp>.
+
| Get the combined stack size of all items with the given qualified or unqualified item ID.
 
|-
 
|-
| <samp>RemovalDebrisType</samp>
+
| <code>GetById(id)</code>
| ''(Optional)'' The type of cosmetic debris particles to 'splash' from the tile when the fence is broken with a tool. The defined values are 0 (copper), 2 (iron), 4 (coal), 6 (gold), 8 (coins), 10 (iridium), 12 (wood), 14 (stone), 32 (big stone), and 34 (big wood). Default 14 (stone).
+
| Get a list of items in the inventory with the given qualified or unqualified item ID.
 
|-
 
|-
| <samp>RepairHealthAdjustmentMinimum</samp><br /><samp>RepairHealthAdjustmentMaximum</samp>
+
| <code>ReduceId(id, count)</code>
| ''(Optional)'' A random amount added to the <samp>Health</samp> when a fence is repaired by a player. See the <samp>Health</samp> field description. Both default to 0.
+
| Remove the given number of items matching the given qualified or unqualified item ID. This reduces the stack size for matching items until a total of <samp>count</samp> have been removed, and clears any slots which reach a stack size of zero.
|-
+
|}</li>
| <samp>HeldObjectDrawOffset</samp>
+
<li>Many common operations have been unified, so previously player-only methods can now be used with chests too.</li>
| ''(Optional)'' When an item like a [[torch]] is placed on the fence, the pixel offset to apply to its draw position. Specified as a string in the form <samp>"{{t|x}}, {{t|y}}"</samp>. Defaults to <samp>"0, -20"</samp> if omitted.
+
<li>It has an internal index by item ID, so operations like <code>items.ContainsId("(O)128")</code> are much more efficient since they no longer iterate the list.</li>
|-
+
</ul>
| <samp>LeftEndHeldObjectDrawX</samp><br /><samp>RightEndHeldObjectDrawX</samp>
  −
| ''(Optional)'' The X pixel offset to apply when the fence is oriented horizontally, with only one connected fence on the right (for <samp>LeftEndHeldObjectDrawX</samp>) or left (for <samp>RightEndHeldObjectDrawX</samp>). This fully replaces the X value specified by <samp>HeldObjectDrawOffset</samp> when it's applied. Default 0.
  −
|}
     −
===Custom floors (craftable) & paths===
+
This replaces some previous methods:
You can now add or customize [[Crafting#Decor|craftable floors & paths]] by editing the <samp>Data/FloorsAndPaths</samp> asset.
     −
This consists of a string → model lookup, where the key matches the <samp>ID</samp> field and the value is a model with these fields:
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! field
+
! game class
! effect
+
! old code
 +
! migration
 
|-
 
|-
| <samp>ID</samp>
+
|rowspan="6"| <samp>Farmer</samp>
| The [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for this floor/path.
+
| <code>getItemCount(id)</code><br /><code>GetTallyOfObject(id)</code><br /><code>GetTallyOfObject(id, isBigCraftable)</code><br /><code>hasItemInInventory(id, count)</code><br /><code>hasItemInList(list, id, count)</code>
 +
| &#32;
 +
* To check an item ID, use <code>items.CountId(id)</code> or <code>Items.ContainsId(id, count)</code>.
 +
* To check Golden Walnuts or Qi Gems, use the <samp>Game1.netWorldState.Value.GoldenWalnuts</samp> and <samp>Farmer.QiGems</samp> fields.
 +
* To check category matches or <samp>-777</samp> (seasonal wild seeds), the <samp>getItemCount</samp> and <samp>getItemCountInList</samp> still exist.
 
|-
 
|-
| <samp>ItemId</samp>
+
| <code>hasItemInInventoryNamed(name)</code><br /><code>hasItemWithNameThatContains(name)</code>
| The unqualified [[#Custom items|item ID]] for the corresponding object-type item.
+
| In most cases, you should match items by ID instead (see the previous row).
 +
 
 +
If you really need to match items by name, you can replace it like this:
 +
<syntaxhighlight lang="c#">
 +
// exact name
 +
bool hasMatch = Game1.player.Items.Any(item => item?.Name == name);
 +
 
 +
// name contains
 +
bool hasMatch = Game1.player.Items.Any(item => item?.Name?.Contains(name) is true);
 +
</syntaxhighlight>
 
|-
 
|-
| <samp>Texture</samp>
+
| <code>areAllItemsNull()</code>
| The asset name for the texture (under the game's <samp>Content</samp> folder) when the flooring is applied or the path is placed. Use <samp>\</samp> (or <samp>\\</samp> in JSON) to separate name segments if needed. For example, the vanilla tilesheet is <samp>TerrainFeatures\Flooring</samp>.
+
| Use <code>!items.HasAny()</code>.
 
|-
 
|-
| <samp>Corner</samp>
+
| <code>numberOfItemsInInventory()</code>
| The top-left pixel position for the sprite within the <samp>Texture</samp> spritesheet, specified as a model with <samp>X</samp> and <samp>Y</samp> fields.
+
| Use <code>items.CountItemStacks()</code> to count all items, or <code>Items.Count(p => p is Object)</code> to match this method's actual behavior.
 
|-
 
|-
| <samp>PlacementSound</samp>
+
| <code>consumeObject(id, count)</code>
| The [[#Custom audio|audio cue ID]] played when the item is applied/placed (e.g. <samp>axchop</samp> used by [[Wood Floor]]).
+
| Use <code>items.ReduceId(id, count)</code>.
 
|-
 
|-
| <samp>FootstepSound</samp>
+
| <code>removeItemsFromInventory(id, count)</code>
| The [[#Custom audio|audio cue ID]] played when the player steps on the tile (e.g. <samp>woodyStep</samp> used by [[Wood Floor]]).
+
| &#32;
 +
* To remove an item by ID, use <code>items.ReduceId(id, count)</code>.
 +
* To deduct Golden Walnuts or Qi Gems, change the <samp>Game1.netWorldState.Value.GoldenWalnuts</samp> and <samp>Farmer.QiGems</samp> fields.
 
|-
 
|-
| <samp>WinterTexture</samp><br /><samp>Corner</samp>
+
|rowspan="2"| <samp>Object</samp>
| ''(Optional)'' Equivalent to <samp>Texture</samp> and <samp>Corner</samp>, but applied if the current location is in winter.
+
| <code>ConsumeInventoryItem(player, id, count)</code>
 +
| This was somewhat specialized and shouldn't be called by mod code, but the equivalent would be <code>(Object.autoLoadChest ?? player.items).ReduceId(id, count)</code>. See also notes for <samp>Farmer.removeItemsFromInventory</samp>.
 
|-
 
|-
| <samp>RemovalSound</samp>
+
| <code>GetTallyOfObject(player, id)</code>
| ''(Optional)'' The [[#Custom audio|audio cue ID]] played when the item is unapplied or picked up. Defaults to the same sound as <samp>PlacementSound</samp>.
+
| This was somewhat specialized and shouldn't be called by mod code, but the equivalent would be <code>(Object.autoLoadChest ?? player.items).CountId(id)</code>. See also notes for <samp>Farmer.getTallyOfObject</samp>.
|-
+
|}
| <samp>RemovalDebrisType</samp>
+
 
| ''(Optional)'' The type of cosmetic debris particles to 'splash' from the tile when the item is unapplied or picked up. The defined values are 0 (copper), 2 (iron), 4 (coal), 6 (gold), 8 (coins), 10 (iridium), 12 (wood), 14 (stone), 32 (big stone), and 34 (big wood). Default 14 (stone).
+
It implements a new <samp>IInventory</samp> interface, which lets mods pass their own implementations to code which works on inventories.
|-
+
 
| <samp>ShadowType</samp>
+
===Furniture changes===
| ''(Optional)'' The type of shadow to draw under the tile sprite. Default <samp>None</samp>.
+
{{/doc status|[[Modding:Items#Furniture]]|done=true}}
 +
 
 +
<ul>
 +
<li>[[Modding:Items#Furniture|<samp>Data/furniture</samp>]] no longer has language variants. Translations were moved into <samp>Strings/Furniture</samp>.</li>
 +
<li>
 +
There are a few changes in [[Modding:Items#Furniture|<samp>Data/furniture</samp>]]:
 +
<ul>
 +
<li>Field index 6 is now placement restrictions and field index 7 is now display name. The display name field is no longer omitted in English.</li>
 +
<li>Field index 7 (display name) now allows [[Modding:Tokenizable strings|tokenizable strings]].</li>
 +
<li>Added new fields:
   −
The possible values are:
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! value
+
! index
 +
! field
 
! effect
 
! effect
 
|-
 
|-
| <samp>None</samp>
+
| 8
| Don't draw a shadow.
+
| sprite index
 +
| The sprite index within the spritesheet texture to draw.
 
|-
 
|-
| <samp>Square</samp>
+
| 9
| Draw a shadow under the entire tile.
+
| texture
 +
| ''(Optional)'' The asset name of the texture to draw. Defaults to <samp>TileSheets/furniture</samp>.
 
|-
 
|-
| <samp>Contoured</samp>
+
| 10
| raw a shadow that follows the lines of the path sprite.
+
| off limits for random sale
|}
+
| ''(Optional)'' Whether to prevent this furniture from appearing in randomly generated shop stocks and the furniture catalogue. Default false.
 
|-
 
|-
| <samp>ConnectType</samp>
+
| 11
| ''(Optional)'' When drawing the flooring across multiple tiles, how the flooring sprite for each tile is selected. Defaults to <samp>Default</samp>.
+
| context tags
 +
| ''(Optional)'' A space-delimited list of [[Modding:Items#Context tags|context tags]] which apply to this furniture. Default none.
 +
|}</li>
 +
</ul>
 +
</li>
 +
</ul>
 +
 
 +
===Other item changes for C# mods===
 +
* Placed object changes:
 +
** Every placed object now has a <samp>Location</samp> property set to the location which contains it. This removes location parameters from many object methods.
 +
** Setting an object's tile position through <samp>obj.TileLocation</samp> now recalculcates its collision box automatically. (Setting it through the <samp>tileLocation</samp> net field directly won't though.)
 +
** The <samp>obj.IsScarecrow()</samp> and <samp>GetScarecrowRadius()</samp> methods now work for non-bigcraftable objects too.
 +
* Clothing changes:
 +
** <samp>Clothes.clothesType</samp> is now an enum field.
 +
** Clothing is no longer gender-specific. This renames <samp>indexInTileSheetMale</samp> to <samp>indexInTileSheet</samp>, obsoletes <samp>indexInTileSheetFemale</samp>, and converts gender-variant clothing into regular items.
 +
** Removed unused <samp>ClothesType.ACCESSORY</samp> value.
 +
** <samp>Farmer.pants</samp> and <samp>Farmer.shirt</samp> now store the item ID instead of the sprite index.
 +
** In <samp>Data/TailoringRecipes</samp>, added a <samp>CraftingIdFeminine</samp> field which overrides <samp>CraftingId</samp> for female characters.
 +
* Crop changes:
 +
** Added <samp>Game1.cropData</samp> to read crop info without constantly reloading the <samp>Data/Crops</samp> asset.
 +
** Removed most crop fields which only mirror the data (like <samp>harvestMethod</samp> or <samp>seasonsToGrowIn</samp>). Mods can get the info through <samp>crop.GetData()</samp> instead.
 +
** Partly de-hardcoded fertilizer logic. Almost all fertilizer logic is now centralized into a new patchable set of <samp>HoeDirt</samp> methods (see list below). The only fertilizer logic that's still embedded elsewhere is the interaction errors in <samp>Utility.tryToPlaceItem</samp>.
 +
** HoeDirt.fertilizer.Value is now set to <samp>null</samp> when there is no fertilizer. Both qualified and unqualified IDs should be expected.
 +
** Removed <samp>crop.InferSeedIndex()</samp>. This was used to support old crops, which are now fixed by a save migration instead.
 +
* Tool changes:
 +
** Fixed various logic not handling custom tool upgrade levels.
 +
<ul>
 +
<li>Other item logic:<ul>
 +
<li>Simplified the constructors for many item types, particularly <samp>Object</samp>.</li>
 +
<li>[[Honey]] items now have their <samp>preserve</samp> field set to a new <samp>Honey</samp> type (instead of null).</li>
 +
<li>The <samp>Object.performObjectDropInAction</samp> method now applies the <samp>probe</samp> argument much more consistently. This only affects method calls with <samp>probe: true</samp>.</li>
 +
<li>The <samp>Item.salePrice()</samp> method now has option to get the price without [[Multiplayer#Profit margins|profit margins]].</li>
 +
<li>Added new fields & methods:
   −
The possible values are:
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! value
+
! type
! usage
+
! field/method
 +
! effect
 
|-
 
|-
| <samp>Default</samp>
+
| <samp>Chest</samp>
| For normal floors, intended to cover large square areas. This uses some logic to draw inner corners.
+
| <samp>GetItemsForPlayer()</samp>
 +
| Shortcut for <samp>chest.GetItemsForPlayer(Game1.player.UniqueMultiplayerID)</samp>.
 
|-
 
|-
| <samp>Path</samp>
+
| rowspan="2"| <samp>Crop</samp>
| For floors intended to be drawn as narrow paths. These are drawn without any consideration for inner corners.
+
| <samp>GetHarvestMethod()</samp>
 +
| Get the method used to harvest the crop (one of <samp>HarvestMethod.Grab</samp> or <samp>HarvestMethod.Scythe</samp>).
 
|-
 
|-
| <samp>CornerDecorated</samp>
+
| <samp>IsInSeason(location)</samp>
| For floors that have a decorative corner. Use <samp>CornerSize</samp> to change the size of this corner.
+
| Whether the crop can grow in the location's current season (or true if crops ignore seasons in the location, like the [[greenhouse]]).
 
|-
 
|-
| <samp>Random</samp>
+
| rowspan="8"| <samp>HoeDirt</samp>
| For floors that don't connect. When placed, one of the tiles is randomly selected.
+
| <samp>HasFertilizer()</samp>
|}
+
| Get whether the dirt has any fertilizer applied.
 
|-
 
|-
| <samp>CornerSize</samp>
+
| <samp>CanApplyFertilizer(itemId)</samp>
| ''(Optional)'' The pixel size of the decorative border when the <samp>ConnectType</samp> field is set to <samp>CornerDecorated</samp> or <samp>Default</samp>.
+
| Get whether a player can apply the given fertilizer to this dirt.
 
|-
 
|-
| <samp>FarmSpeedBuff</samp>
+
| <samp>CheckApplyFertilizerRules(itemId)</samp>
| ''(Optional)'' The speed boost applied to the player, on the [[farm]] only, when they're walking on paths of this type. Negative values are ignored. Default 0.1.
+
| Get whether a player can apply the given fertilizer to this dirt, and the reason they can't if applicable.
|}
  −
 
  −
===Custom machines===
  −
You can now add/edit machine logic by editing the <samp>Data/Machines</samp> asset.
  −
 
  −
This consists of a string → model lookup, where...
  −
* The key is the [[#Custom items|'''qualified''' item ID]] for the item which acts as a machine (like <samp>(BC)127</samp> for [[The Cave|mushroom boxes]]).
  −
* The value is a model with the fields listed below.
  −
 
  −
====Item processing rules====
  −
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>GetFertilizerSpeedBoost()</samp>
! effect
+
| Get the crop growth speed boost from fertilizers applied to this dirt.
 
|-
 
|-
| <samp>OutputRules</samp>
+
| <samp>GetFertilizerWaterRetentionChance()</samp>
| The output produced by this machine. If multiple output rules can be produced, the first available one is selected. This consists of a list of models with these fields:
+
| Get the water retention chance from fertilizers applied to this dirt, as a value between 0 (no change) and 1 (100% chance of staying watered).
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>GetFertilizerQualityBoostLevel()</samp>
! effect
+
| Get the quality boost level from fertilizers applied to this dirt, which influences the chance of producing a higher-quality crop.
 
|-
 
|-
| <samp>Id</samp>
+
| <samp>GetFertilizerSourceRect()</samp>
| The [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for this rule within the current machine (it doesn't need to be unique between machines).
+
| Get the pixel area within the dirt spritesheet to draw for any fertilizer applied to this dirt.
|-
  −
| <samp>Triggers</samp>
  −
| When to apply this output rule. This can list any number of triggers; the output will apply if any of them match.
     −
This consists of a list of models with these fields:
+
(This method existed before, but no longer requires the fertilizer ID argument.)
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>isWatered()</samp>
! effect
+
| Get whether the dirt is currently watered.
 
|-
 
|-
| <samp>Id</samp>
+
|rowspan="5"| <samp>Item</samp>
| The [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for this trigger within the current rule.
+
| <samp>IsRecipe</samp><br /><samp>Quality</samp><br /><samp>Stack</samp></samp><br /><samp>sellToStorePrice(…)</samp>
 +
| Equivalent to the previous <samp>Object</samp> fields/methods, to simplify common code and avoid needing to special-case <samp>Object</samp> items.
 
|-
 
|-
| <samp>Trigger</samp>
+
| <samp>appliesProfitMargins()</samp>
| ''(Optional)'' When this output rule applies. Defaults to <samp>ItemPlacedInMachine</samp>. The possible values are...
+
| Get whether this item should apply [[Multiplayer#Profit margins|profit margins]] to shop prices.
* <samp>ItemPlacedInMachine</samp>: apply this rule when an item is placed into the machine. This is the most common machine behavior.
  −
* <samp>OutputCollected</samp>: apply this rule when the machine's previous output is collected. An output-collected rule won't require or consume the input items, and the input item will be the previous output. For example, this is used to reload the [[crystalarium]].
  −
* <samp>MachinePutDown</samp>: apply this rule when the machine is put down. For example, this is used to start the [[Worm Bin|worm bin]].
  −
* <samp>DayUpdate</samp>: apply this rule when a new day starts, if it isn't already processing output. For example, this is used for the [[Soda Machine|soda machine]].
  −
 
  −
You can specify multiple values, like <code>"Trigger": "DayUpdate, MachinePutDown, OutputCollected"</code>.
   
|-
 
|-
| <samp>RequiredItemId</samp>
+
| <samp>CanBeLostOnDeath()</samp>
| ''(Optional)'' The qualified or unqualified item ID for the item to match, if the trigger is <samp>ItemPlacedInMachine</samp> or <samp>OutputCollected</samp>. Defaults to allowing any item ID.
+
| Get whether this item can be lost when the player dies, so it can be recovered from the [[Adventurer's Guild#Item Recovery Service|item recovery service]].
 
|-
 
|-
| <samp>RequiredTags</samp>
+
| <samp>HasTypeId(id)</samp><br /><samp>HasTypeObject()</samp><br /><samp>HasTypeBigCraftable()</samp>
| ''(Optional)'' The [[Modding:Context tags|context tags]] to match against input items, if the trigger is <samp>ItemPlacedInMachine</samp> or <samp>OutputCollected</samp>. An item must have all of the listed tags to select this rule. You can negate a tag with <samp>!</samp> (like <code>"RequiredTags": [ "bone_item", "!fossil_item" ]</code> for bone items that aren't fossils).
+
| Get whether the item has the given [[#Custom items|type definition ID]]. These are null-safe and double as a null check:
 +
<syntaxhighlight lang="c#">
 +
if (item.HasTypeId(ItemRegistry.type_object))
 +
{
 +
    // item is non-null and has type (O)
 +
}
 +
</syntaxhighlight>
 +
<samp>HasTypeObject()</samp> and <samp>HasTypeBigCraftable()</samp> are shortcuts for passing <samp>ItemRegistry.type_object</samp> and <samp>ItemRegistry.type_bigCraftable</samp> respectively.
 
|-
 
|-
| <samp>RequiredCount</samp>
+
| <samp>TryGetTempData</samp><br /><samp>SetTempData</samp>
| ''(Optional)'' The required stack size for the input item, if the trigger is <samp>ItemPlacedInMachine</samp> or <samp>OutputCollected</samp>. Default 1.
+
| Get or set temporary item info that's not synchronized in multiplayer or written to the save file.
|-
+
 
| <samp>Condition</samp>
+
For example, the game uses this to pass spawn options to the fishing minigame:
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether this trigger should be checked. Item-only tokens are valid for this check if the trigger is <samp>ItemPlacedInMachine</samp> or <samp>OutputCollected</samp>. Defaults to always true.
+
<syntaxhighlight lang="c#">
|}
+
if (spawn.IsBossFish)
|-
+
    fish.SetTempData(nameof(spawn.IsBossFish), true);
| <samp>OutputItem</samp>
+
 
| The items produced by this machine. If multiple output entries match, one will be selected randomly unless you specify <samp>UseFirstValidOutput</samp>. This consists of a list of models with these fields:
+
...
{| class="wikitable"
+
 
 +
fish.TryGetTempData(nameof(SpawnFishData.IsBossFish), out bool bossFish);
 +
</syntaxhighlight>
 
|-
 
|-
! field
+
| <samp>FishingRod</samp>
! effect
+
| <samp>CanUseBait()</samp><br /><samp>CanUseTackle()</samp><br /><samp>GetBait()</samp><br /><samp>GetTackle()</samp><br /><samp>HasMagicBait()</samp><br /><samp>HasCuriosityLure()</samp>
 +
| Simplifies working with the fishing rod's [[bait]] and [[tackle]].
 
|-
 
|-
| ''common fields''
+
|rowspan="2"| <samp>Furniture</samp>
| See [[Modding:Item queries#Item spawn fields|item spawn fields]] for the generic item fields supported by machine output.
+
| <samp>SetPlacement</samp><br /><samp>SetHeldObject</samp>
 +
| Set the furniture's position and rotation (<samp>SetPlacement</samp>) or held object (<samp>SetHeldObject</samp>). The latter will initialize the held object's tile position to match the furniture instance.
   −
Notes:
+
These are used by the game to initialize furniture in one go. For example:
<ul>
+
<syntaxhighlight lang="c#">
<li>If <samp>ItemId</samp> or <samp>RandomItemId</samp> is set to an [[Modding:Item queries|item query]] which returns multiple items, one item will be selected at random.</li>
+
// oak table holding decorative bowl
<li>The <samp>ItemId</samp> and <samp>RandomItemId</samp> can optionally contain special tokens, which will be replaced before the item ID is parsed. For example, you can use <code>FLAVORED_ITEM Wine DROP_IN_ID</code> to create a wine for whatever item was placed in the machine.
+
Furniture table = ItemRegistry
{| class="wikitable"
+
    .Create<Furniture>("(F)1120")
 +
    .SetPlacement(5, 4, 0)
 +
    .SetHeldObject(ItemRegistry.Create<Furniture>("(F)1364"));
 +
</syntaxhighlight>
 
|-
 
|-
! token
+
| <samp>IsTable()</samp>
! replaced with
+
| Get whether this furniture is a table.
 
|-
 
|-
| <samp>DROP_IN_ID</samp>
+
|rowspan="2"| <samp>FruitTree</samp>
| The qualified item ID for the item placed in the machine.
+
| <samp>GetQuality()</samp>
 +
| Get the quality of fruit currently being produced by the fruit tree.
 
|-
 
|-
| <samp>DROP_IN_PRESERVE</samp>
+
| <samp>TryAddFruit()</samp>
| If the item placed into the machine is a flavored item like Apple Juice or Tuna Roe, the ''unqualified'' item ID for the flavor item (e.g. the apple in Apple Wine). Otherwise <samp>0</samp>.
+
| Add a fruit item to the tree based on [[#Custom fruit trees|its data]].
 
|-
 
|-
| <samp>NEARBY_FLOWER_ID</samp>
+
| <samp>IndoorPot</samp>
| The item ID for a flower within 5 tiles of the machine, or <samp>-1</samp> if no flower is found. For example, [[Bee House|bee houses]] produce <code>FLAVORED_ITEM Honey NEARBY_FLOWER_ID</code>.
+
| <samp>Water()</samp>
|}
+
| Simplifies watering dirt in the [[Garden Pot|garden pot]].
</li>
  −
<li>The <samp>ObjectInternalName</samp> can optionally contain <samp>{0}</samp>, which will be replaced with the input item's internal name. This is used to prevent flavored items from stacking (''e.g.'' apple [[wine]] and blueberry wine).</li>
  −
<li>The <samp>Condition</samp> field will check the ''input'' (not output) item for item-related conditions.</li>
  −
</ul>
   
|-
 
|-
| <samp>PreserveType</samp>
+
| <samp>Object</samp>
| ''(Optional)'' The produced item's preserved item type, if applicable. This sets the equivalent flag on the output item. The valid values are <samp>Jelly</samp>, <samp>Juice</samp>, <samp>Pickle</samp>, <samp>Roe</samp> or <samp>AgedRoe</samp>, and <samp>Wine</samp>. Defaults to none.
+
| <samp>GetBoundingBox()</samp><br /><samp>GetBoundingBoxAt(x, y)</samp>
 +
| Get the pixel collision area for the item placed in the world. These replace the former <samp>getBoundingBox(position)</samp> method.
 
|-
 
|-
| <samp>PreserveId</samp>
+
| <samp>Tool</samp>
| ''(Optional)'' The produced item's preserved unqualified item ID, if applicable. For example, [[Wine|blueberry wine]] has its preserved item ID set to the [[blueberry]] ID. This can be set to <samp>DROP_IN</samp> to use the input item's ID. Default none.
+
| <samp>isScythe()</samp>
 +
| Equivalent to the previous <samp>MeleeWeapon</samp> method, to simplify common code and avoid needing to special-case <samp>MeleeWeapon</samp> items.
 
|-
 
|-
| <samp>CopyColor</samp>
+
|rowspan="3"| <samp>Tree</samp>
| ''(Optional)'' Whether to inherit the color of the input item if it was a <samp>ColoredObject</samp>. This mainly affects [[roe]]. Default false.
+
| <samp>CheckForNewTexture()</samp>
 +
| Reset the tree's texture if it would change based on [[#Custom wild trees|its data]].
 
|-
 
|-
| <samp>CopyPrice</samp>
+
| <samp>GetMaxSizeHere</samp>
| ''(Optional)'' Whether to inherit the quality of the input item (before <samp>PriceModifiers</samp> are applied). This is ignored if the input or output aren't both object (<samp>(O)</samp>)-type.
+
| Get the maximum size the tree can grow in its current position (e.g. accounting for nearby trees blocking growth).
 
|-
 
|-
| <samp>CopyQuality</samp>
+
| <samp>IsGrowthBlockedByNearbyTree</samp>
| ''(Optional)'' Whether to inherit the quality of the input item (before <samp>QualityModifiers</samp> are applied).
+
| Get whether growth is blocked because it's too close to another fully-grown tree.
|-
+
|}
| <samp>PriceModifiers</samp><br /><samp>PriceModifiers</samp>
+
</li>
| ''(Optional)'' [[#Quantity modifiers|Quantity modifiers]] applied to the output item's price. Default none.
+
<li>Modularized <samp>Object.CheckForAction</samp> to simplify mod patches.</li>
|-
+
<li>Reworked <samp>Item.getOne()</samp> implementation to avoid common pitfalls. (This only affects mods with custom item classes, or which patch <samp>Item.getOne</samp> or <samp>Item._GetOneFrom</samp>.)</li>
| <samp>IncrementMachineParentSheetIndex</samp>
+
<li>Fixed fruit trees forgetting the growth stage set in their constructor when they're updated overnight.</li>
| ''(Optional)'' An amount by which to increment the machine's spritesheet index while it's processing this output. This stacks with the <samp>ShowNextIndexWhenLoaded</samp> or <samp>ShowNextIndexWhileWorking</samp> field. Default 0.
+
</ul>
|-
+
 
| <samp>OutputMethod</samp>
+
===Other item changes===
| ''(Optional, specialized)'' A C# method which decides which item to produce. If set, the <samp>ItemId</samp> field is optional and ignored.
+
* Added per-object display names (''e.g.'' for custom flavored items). See the <samp>ObjectDisplayName</samp> [[Modding:Item queries#Item spawn fields|item spawn field]], or <samp>object.displayNameFormat</samp> in C#.
 +
* [[Ginger Island#Gem Birds|Item pedestals]] are now normal item, so you can spawn them using a mod like CJB Item Spawner to display items.
 +
* Added optional <samp>Condition</samp> [[Modding:Game state queries|game state query]] field to <samp>Data/SpecialOrders</samp>.
 +
* Item data changes:
 +
** The display name field now exists in English too for <samp>Data/Boots</samp>, <samp>Data/Bundles</samp>, <samp>Data/CookingRecipes</samp>, <samp>Data/CraftingRecipes</samp>, <samp>Data/Furniture</samp>, <samp>Data/Hats</samp>, and <samp>Data/Weapons</samp>.
 +
** The randomly spawned [[The Farm#Stone|stones]], [[The Farm#Wood|twigs]], and [[weeds]] have been formalized into ''litter''. They all now have object type <samp>Litter</samp>, [[Modding:Items#Categories|category]] -999 (<samp>StardewValley.Object.litterCategory</samp>), a relevant display name/description (like ''Gold Stone'' & ''Break apart to obtain gold ore'' instead of ''Stone'' & ''...''), a price of 0 (not sellable), and edibility of -300 (inedible). This also adds all mine ore nodes to <samp>Data/Objects</samp>, so the game no longer creates invalid items to show their sprite. (Doing so in 1.6 will now show an Error Item sprite instead.)
 +
** [[Honey]] items now have the <samp>honey_item</samp> context tag.
 +
** Shirts no longer have a dynamic numeric ID range; every valid shirt is now listed in [[#Custom shirts|<samp>Data/Shirts</samp>]].
 +
** You can now apply a custom buff ID when the item is eaten, via <samp>Data/Objects</samp>'s <samp>Buff</samp> field.
 +
** The type field in <samp>Data/Objects</samp> is no longer checked using substring matching (e.g. the game now uses <code>data.Type == "Fish"</code> instead of <code>typeAndCategory.Contains("Fish")</code>), which may impact mods which depended on that undocumented behavior.
 +
* Crop changes:
 +
** Paddy crops now recheck for nearby water each day, so they'll update if you add/remove a building with water or change the map layout.
 +
** In <samp>Data/Crops</samp>, each harvest option is now self-contained. For example, you can set <samp>HarvestMinStack</samp> without <samp>ExtraHarvestChance</samp>.
 +
* Fish changes:
 +
** <samp>Data/Fish</samp> is no longer translated, so there's only one <samp>Data/Fish.xnb</samp> field. Fish display names are now taken from <samp>Data/Objects</samp>.
 +
** Added a new field (index 13) in <samp>Data/Fish</samp>, which sets whether the fish can be selected for the first-catch tutorial.
 +
* Recipe changes in <samp>Data/CookingRecipes</samp> and <samp>Data/CraftingRecipes</samp>:
 +
** These assets no longer have language variants.
 +
** The display name now supports [[Modding:Tokenizable strings|tokenizable strings]].
 +
** The display name can now be left blank to get it from the first item in the output list.
 +
* Other item logic:
 +
** Missing recipes that should already be unlocked are now added to the player automatically on save load.
 +
** <samp>Data/Bundles</samp> is now loaded later, so content packs can edit it reliably.</samp>
 +
** Chests with <samp>fridge: true</samp> are now treated as mini-fridges for the cooking menu.
 +
** Gift boxes can now contain multiple items.
 +
** Fixed furniture drawn over sitting players if it has no front texture.
 +
** Fixed tool being upgraded by Clint not affected by recursive item search logic.
 +
** Fixed <samp>tool.getOne()</samp> not copying the tool name.
 +
** Fixed cooking menu constantly creating hovered item if the item/recipe names don't match.
   −
This must be specified in the form <samp>{{t|full type name}}.{{t|method name}}</samp> (like <samp>StardewValley.Object.OutputSolarPanel</samp>). The method must be static and match the game's <samp>MachineOutputDelegate</samp> method signature:
+
==What's new for locations & weather==
<syntaxhighlight lang="c#">
+
===Custom locations===
/// <summary>Get the output item to produce.</summary>
+
{{/doc status|[[Modding:Location data]]|done=true}}
/// <param name="machine">The machine instance for which to produce output.</param>
  −
/// <param name="inputItem">The item being dropped into the machine, if applicable.</param>
  −
/// <param name="probe">Whether the machine is only checking whether the input is valid. If so, the input/machine shouldn't be changed and no animations/sounds should play.</param>
  −
/// <param name="outputData">The item output data from <c>Data/Machines</c> for which output is being created, if applicable.</param>
  −
/// <param name="overrideMinutesUntilReady">The in-game minutes until the item will be ready to collect, if set. This overrides the equivalent fields in the machine data if set.</param>
  −
/// <returns>Returns the item to produce, or <c>null</c> if none should be produced.</returns>
  −
public static Item GetOutput(Object machine, Item inputItem, bool probe, MachineItemOutput outputData, out int? overrideMinutesUntilReady);
  −
</syntaxhighlight>
     −
If this method returns null, the machine won't output anything.
+
You can now add/edit locations by editing the revamped <samp>Data/Locations</samp> asset. This makes nearly everything in the location configurable — display name, default warp arrival tile, how the location is created, artifact spots / fish / forage / weeds, music, etc.
|-
  −
| <samp>CustomData</samp>
  −
| Machine-specific data provided to the machine logic, if applicable.
     −
For example, the cask uses this to set the aging rate for each item:
+
See [[Modding:Location data]] for docs on the new data format.
<syntaxhighlight lang="js">
  −
"OutputItem": {
  −
    "OutputMethod": "StardewValley.Objects.Cask.OutputCask",
  −
    "CustomData": {
  −
        "AgingMultiplier": 4
  −
    }
  −
}
  −
</syntaxhighlight>
  −
|}
  −
|-
  −
| <samp>UseFirstValidOutput</samp>
  −
| ''(Optional)'' If multiple <samp>OutputItem</samp> entries match, whether to use the first match instead of choosing one randomly. Default false.
  −
|-
  −
| <samp>MinutesUntilReady</samp><br /><samp>DaysUntilReady</samp>
  −
| ''(Optional)'' The number of in-game minutes or days until the output is ready to collect. If both days and minutes are specified, days are used. If none are specified, the item will be ready instantly.
  −
|-
  −
| <samp>InvalidCountMessage</samp>
  −
| ''(Optional)'' If set, overrides the machine's main <samp>InvalidCountMessage</samp> field.
  −
|-
  −
| <samp>RecalculateOnCollect</samp>
  −
| ''(Optional)'' Whether to regenerate the output right before the player collects it, similar to [[Bee House|bee houses]]. If the new item is null, the original output is returned instead.
  −
|}
  −
|-
  −
| <samp>AdditionalConsumedItems</samp>
  −
| ''(Optional)'' A list of extra items required before <samp>OutputRules</samp> will be checked. If specified, every listed item must be present in the player, [[hopper]], or chest inventory (depending how the machine is being loaded).
     −
This consists of a list of models with these fields:
+
===Custom location contexts===
{| class="wikitable"
+
{{/doc status|[[Modding:Location data]] or a new doc page|done=false}}
|-
+
 
! field
+
====Vanilla contexts====
! effect
+
* The game previously had two hardcoded location context enums: <samp>Default</samp> (for the valley) and <samp>Island</samp> (for [[Ginger Island]]). These have been replaced with data models which define the location context settings, loaded from the <samp>Data/LocationContexts</samp> asset.
|-
+
* [[The Desert|The desert]] is now part of a new <samp>Desert</samp> context (instead of <samp>Default</samp>). Some of the previously hardcoded desert logic (like always sunny weather) is now just part of the context data in <samp>Data/LocationContexts</samp>.
| <samp>ItemId</samp>
+
 
| The [[#Custom items|qualified or unqualified item ID]] for the required item.
+
====Format====
|-
+
Custom contexts can be created by editing the new <samp>Data/LocationContexts</samp> asset, and setting the context name in the location's <samp>LocationContext</samp> [[Modding:Maps|map property]].
| <samp>RequiredCount</samp>
+
 
| ''(Optional)'' The required stack size for the item matching <samp>ItemId</samp>. Default 1.
+
The data asset consists of a string → model lookup, where the key matches the <samp>Name</samp> field and the value is a model with these fields:
|-
  −
| <samp>InvalidCountMessage</samp>
  −
| ''(Optional)'' If set, overrides the machine's main <samp>InvalidCountMessage</samp> field.
  −
|}
  −
|-
  −
| <samp>AllowFairyDust</samp>
  −
| ''(Optional)'' Whether the player can add [[Fairy Dust|fairy dust]] to speed up the machine. Default true.
  −
|-
  −
| <samp>ReadyTimeModifiers</samp>
  −
| ''(Optional)'' [[#Quantity modifiers|Quantity modifiers]] applied to the produced item's processing time. The modifier conditions can use item-only tokens, which will check the ''input'' (not output) item.
  −
|-
  −
| <samp>ReadyTimeModifierMode</samp>
  −
| ''(Optional)'' A [[#Quantity modifiers|quantity modifier mode]] which indicates what to do if multiple modifiers apply at the same time. Default <samp>Stack</samp>.
  −
|}
     −
====Behavior tweaks====
+
<dl style="margin-left: 2em;">
 +
<dt>Required fields:</dt>
 +
<dd>
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 1,028: Line 948:  
! effect
 
! effect
 
|-
 
|-
| <samp>PreventTimePass</samp>
+
| <samp>Name</samp>
| ''(Optional)'' A list of cases when the machine should be paused, so the timer on any item being produced doesn't decrement. Possible values:
+
| The [[Modding:Common data field types#Unique string ID|unique string ID]] for the location context.
{| class="wikitable"
  −
|-
  −
! value
  −
! effect
  −
|-
  −
| <samp>Outside</samp><br /><samp>Inside</samp>
  −
| Pause when placed in an outside or inside location. For example, [[Bee House|bee houses]] don't work inside.
  −
|-
  −
| <samp>Spring</samp><br /><samp>Summer</samp><br /><samp>Fall</samp><br /><samp>Winter</samp>
  −
| Pause in the given season. For example, [[Bee House|bee houses]] don't work in winter.
  −
|-
  −
|-
  −
| <samp>Sun</samp><br /><samp>Rain</samp>
  −
| Pause on days with the given weather.
  −
|-
  −
| <samp>Always</samp>
  −
| Always pause the machine. This is used in specialized cases where the timer is handled by [[#Advanced logic|advanced machine logic]].
  −
|}
  −
|-
  −
| <samp>AllowLoadWhenFull</samp>
  −
| ''(Optional)'' Whether the player can drop a new item into the machine before it's done processing the last one (like the [[crystalarium]]). The previous item will be lost. Default false.
  −
|-
  −
| <samp>ClearContentsOvernightCondition</samp>
  −
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether the machine should be emptied overnight, so any current output will be lost. Defaults to always false.
   
|}
 
|}
 +
</dd>
   −
====Audio & visuals====
+
<dt>Player actions:</dt>
 +
<dd>
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 1,062: Line 960:  
! effect
 
! effect
 
|-
 
|-
| <samp>LoadEffects</samp><br /><samp>WorkingEffects</samp>
+
| <samp>AllowRainTotem</samp>
| ''(Optional)'' The cosmetic effects shown when an item is loaded into the machine (for <samp>LoadEffects</samp>), or while it's processing the item (for <samp>WorkingEffects</samp>, based on the <samp>WorkingEffectChance</samp> probability). Both default to none. These consist of a list of models with these fields:
+
| ''(Optional)'' Whether a [[Rain Totem|rain totem]] can be used to force rain in this context tomorrow. If false, using a rain totem here will show a "''this item can't be used here''" message instead.
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>RainTotemAffectsContext</samp>
! effect
+
| ''(Optional)'' If set, using a rain totem here will change the weather in the given context ID. For example, rain totems in the desert change weather in the valley.
 
|-
 
|-
| <samp>Condition</samp>
+
| <samp>MaxPassOutCost</samp>
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether this effect should be played. For item queries, you can check the input item (<samp>Input</samp) or output item (<samp>Target</samp>). Defaults to always true.
+
| ''(Optional)'' When the player passes out (due to [[energy|exhaustion]] or at 2am) in this context, the maximum amount of [[gold]] lost. If omitted or set to <samp>-1</samp>, uses the same value as the <samp>Default</samp> context ({{price|1000}} by default).
 
|-
 
|-
| <samp>Sounds</samp>
+
| <samp>PassOutMail</samp>
| ''(Optional)'' The audio to play. This consists of a list of models with these fields:
+
| ''(Optional)'' When the player passes out (due to [[energy|exhaustion]] or at 2am) in this context, the possible [[Modding:Mail data|letter IDs]] to add to their mailbox (if they haven't received it before). If multiple letters are valid, one will be chosen randomly (unless one specifies <samp>SkipRandomSelection</samp>).
 +
 
 +
This consists of a list of models with these fields:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 1,080: Line 979:  
|-
 
|-
 
| <samp>Id</samp>
 
| <samp>Id</samp>
| The [[#Custom audio|audio cue ID]] to play.
+
| The [[Modding:Common data field types#Unique string ID|unique string ID]] for this entry in the list.
 
|-
 
|-
| <samp>Delay</samp>
+
| <samp>Mail</samp>
| ''(Optional)'' The number of milliseconds until the sound should play. Default 0.
+
| The [[Modding:Mail data|letter ID]] to add.
|}
     −
Defaults to no sound.
+
The game will look for an existing letter ID in <samp>Data/mail</samp> in this order (where {{t|billed}} is <samp>Billed</samp> if they lost [[gold]] or <samp>NotBilled</samp> otherwise, and {{t|gender}} is <samp>Female</samp> or <samp>Male</samp>):
 +
* <samp>{{t|letter id}}_{{t|billed}}_{{t|gender}}</samp>
 +
* <samp>{{t|letter id}}_{{t|billed}}</samp>
 +
* <samp>{{t|letter id}}</samp>
 +
 
 +
If no match is found in <samp>Data/mail</samp>, the game will send <samp>passedOut2</samp> instead.
 +
 
 +
If the mail ID starts with <samp>passedOut</samp>, <samp>{0}</samp> in the letter text will be replaced with the gold amount lost, and it won't appear in the [[collections]] page.
 
|-
 
|-
| <samp>ShakeDuration</samp>
+
| <samp>MaxPassOutCost</samp>
| ''(Optional)'' A duration in milliseconds during which the machine sprite should shake. Default none.
+
| ''(Optional)'' The maximum amount of [[gold]] lost. This is applied after the context's <samp>MaxPassOutCost</samp> (i.e. the context's value is used to calculate the random amount, then this field caps the result). Defaults to unlimited.
 
|-
 
|-
| <samp>Frames</samp>
+
| <samp>Condition</samp>
| ''(Optional)'' The animation to apply to the machine sprite, specified as a list of offsets relative to the base sprite index. Default none.
+
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether this entry is active. Defaults to always true.
 
|-
 
|-
| <samp>Interval</samp>
+
| <samp>SkipRandomSelection</samp>
| ''(Optional)'' The number of milliseconds for which each frame in <samp>Frames</samp> is kept on-screen. Default 100.
+
| ''(Optional)'' If true, send this mail if the <samp>Condition</samp> matches instead of choosing a random valid mail. Default false.
 +
|}
 
|-
 
|-
| <samp>TemporarySprites</samp>
+
| <samp>PassOutLocations</samp>
| ''(Optional)'' The temporary animated sprites to show. This consists of a list of models with these fields:
+
| ''(Optional)'' When the player passes out (due to [[energy|exhaustion]] or at 2am) in this context ''and'' they started the day in a different location context, the locations where they'll wake up. (If the player started the day in the same context, they'll wake up in the last bed they slept in instead.)
 +
 
 +
If the selected location doesn't contain a bed and doesn't have the [[#New map properties|<samp>AllowWakeUpWithoutBed</samp> map property]], the player will wake up in the farmhouse instead.
 +
 
 +
This consists of a list of models with these fields:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 1,105: Line 1,015:  
|-
 
|-
 
| <samp>Id</samp>
 
| <samp>Id</samp>
| The [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for this rule within the current machine (it doesn't need to be unique between machines).
+
| The [[Modding:Common data field types#Unique string ID|unique string ID]] for this entry in the list.
 
|-
 
|-
| <samp>Texture</samp>
+
| <samp>Location</samp>
| The asset name for the texture (under the game's <samp>Content</samp> folder) for the animated sprite.
+
| The internal location name.
 
|-
 
|-
| <samp>SourceRect</samp>
+
| <samp>Position</samp>
| The pixel area for the first animated frame within the <samp>Texture</samp>, specified as an object with <samp>X</samp>, <samp>Y</samp>, <samp>Width</samp>, and <samp>Height</samp> fields.
+
| The ''default'' tile position within the location, specified as an object with <samp>X</samp> and <samp>Y</samp> fields. If the location has any bed furniture, they'll be placed in the first bed found instead.
 
|-
 
|-
 
| <samp>Condition</samp>
 
| <samp>Condition</samp>
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether to add this temporary sprite.
+
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether this entry is active. Defaults to always applied.
|-
  −
| <samp>PositionOffset</samp>
  −
| ''(Optional)'' A pixel offset applied to the sprite, relative to the top-left corner of the machine's collision box, specified as an object with <samp>X</samp> and <samp>Y</samp> fields. Defaults to (0, 0).
  −
|-
  −
| <samp>Color</samp>
  −
| ''(Optional)'' A tint color to apply to the sprite. See [[#Color fields|color format]]. Default <samp>White</samp> (no tint).
  −
|-
  −
| <samp>AlphaFade</samp><br /><samp>Loops</samp><br /><samp>Rotation</samp><br /><samp>RotationChange</samp><br /><samp>ScaleChange</samp><br /><samp>SortOffset</samp>
  −
| ''(Optional)'' See equivalent fields in the [[#Event changes|<samp>temporaryAnimatedSprite</samp> event command]]. Default 0.
  −
|-
  −
| <samp>Frames</samp><br /><samp>Scale</samp>
  −
| ''(Optional)'' See equivalent fields in the [[#Event changes|<samp>temporaryAnimatedSprite</samp> event command]]. Default 1.
  −
|-
  −
| <samp>Interval</samp>
  −
| ''(Optional)'' See equivalent fields in the [[#Event changes|<samp>temporaryAnimatedSprite</samp> event command]]. Default 100.
  −
|-
  −
| <samp>Flicker</samp><br /><samp>Flip</samp>
  −
| ''(Optional)'' See equivalent fields in the [[#Event changes|<samp>temporaryAnimatedSprite</samp> event command]]. Default false.
  −
|}
   
|}
 
|}
 +
 +
If no locations are specified or none match, the player will wake up in their bed at home.
 
|-
 
|-
| <samp>WorkingEffectChance</samp>
+
| <samp>ReviveLocations</samp>
| ''(Optional)'' The percentage chance to apply <samp>WorkingEffects</samp> each time the day starts or the in-game clock changes, as a value between 0 (never) and 1 (always). Default 0.33.
+
| ''(Optional)'' If the player just got knocked out in combat, the location names where they'll wake up.
|-
  −
| <samp>LightWhileWorking</samp>
  −
| ''(Optional)'' The light emitted by the machine while it's processing an item. Default none.
     −
This consists of a list of models with these fields:  
+
This consists of a list of models with these fields:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 1,148: Line 1,038:  
! effect
 
! effect
 
|-
 
|-
| <samp>Radius</samp>
+
| <samp>Id</samp>
| ''(Optional)'' The size of the area covered by the light effect, as a multiplier of the default radius (like <samp>1.5</samp> for an area 50% wider than the default). Default 1.
+
| The [[Modding:Common data field types#Unique string ID|unique string ID]] for this entry in the list.
 
|-
 
|-
| <samp>Color</samp>
+
| <samp>Location</samp>
| ''(Optional)'' A tint color to apply to the light. See [[#Color fields|color format]]. Default <samp>White</samp> (no tint).
+
| The internal location name.
|}
   
|-
 
|-
| <samp>WobbleWhileWorking</samp>
+
| <samp>Position</samp>
| ''(Optional)'' Whether the machine sprite should bulge in & out while it's processing an item. Default false.
+
| The tile position within the location, specified as an object with <samp>X</samp> and <samp>Y</samp> fields.
 
|-
 
|-
| <samp>ShowNextIndexWhileWorking</samp><br /><samp>ShowNextIndexWhenReady</samp>
+
| <samp>Condition</samp>
| ''(Optional)'' Whether to show the next sprite in the machine's spritesheet while it's processing an item (<samp>ShowNextIndexWhileWorking</samp>) or ready (<samp>ShowNextIndexWhenReady</samp>). Default false.
+
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether this entry is active. Defaults to always applied.
 
|}
 
|}
   −
====Player interaction messages====
+
If the selected location has a standard [[Modding:Event data|event]] with the exact key <samp>PlayerKilled</samp> (with no <samp>/</samp> or preconditions in the key), that event will play when the player wakes up and the game will apply the lost items or [[gold]] logic. The game won't track this event, so it'll repeat each time the player is revived. If there's no such event, the player will wake up without an event, and no items or gold will be lost.
These only apply when the player interacts with a chest directly, instead of using a [[hopper]] or mod like {{nexus mod|1063|Automate}}.
+
 
 +
If no locations are specified or none match, the player will wake up at [[Harvey's Clinic|Harvey's clinic]].
 +
|}
 +
</dd>
    +
<dt>Season:</dt>
 +
<dd>
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 1,170: Line 1,064:  
! effect
 
! effect
 
|-
 
|-
| <samp>InvalidItemMessage</samp>
+
| <samp>SeasonOverride</samp>
| ''(Optional)'' A [[Modding:Tokenizable strings|tokenizable string]] for the message shown in a toaster notification if the player tries to input an item that isn't accepted by the machine.
+
| ''(Optional)'' The season which is always active for locations within this context (one of <samp>spring</samp>, <samp>summer</samp>, <samp>fall</samp>, or <samp>winter</samp>). For example, setting <samp>summer</samp> will make it always [[summer]] there regardless of the calendar season. If not set, the calendar season applies.
|-
  −
| <samp>InvalidItemMessageCondition</samp>
  −
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether <samp>InvalidItemMessage</samp> should be shown. This can use item-related queries like <samp>ITEM_TYPE</samp>. Defaults to always true.
  −
|-
  −
| <samp>InvalidCountMessage</samp>
  −
| ''(Optional)'' A [[Modding:Tokenizable strings|tokenizable string]] for the message shown in a toaster notification if the input inventory doesn't contain this item, unless overridden by <samp>InvalidCountMessage</samp> under <samp>OutputRules</samp>.
  −
 
  −
This can use extra custom tokens:
  −
* <samp>[ItemCount]</samp>: the number of remaining items needed. For example, if you're holding three and need five, <samp>[ItemCount]</samp> will be replaced with <samp>2</samp>.
   
|}
 
|}
 +
</dd>
   −
====Advanced logic====
+
<dt>Weather:</dt>
 +
<dd>
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 1,189: Line 1,076:  
! effect
 
! effect
 
|-
 
|-
| <samp>InteractMethod</samp>
+
| <samp>WeatherConditions</samp>
| ''(Optional)'' A C# method invoked when the player interacts with the machine when it doesn't have output ready to harvest.
+
| ''(Optional)'' The weather logic to apply for locations in this context (ignored if <samp>CopyWeatherFromLocation</samp> is set). Defaults to always sunny. If multiple are specified, the first matching weather is applied.
   −
This must be specified in the form <samp>{{t|full type name}}.{{t|method name}}</samp> (like <samp>StardewValley.Object.SomeInteractMethod</samp>). The method must be static and match the game's <samp>MachineInteractDelegate</samp> method signature:
+
This consists of a list of models with these fields:
<syntaxhighlight lang="c#">
  −
/// <summary>The method signature for a custom <see cref="MachineData.InteractMethod"/> method.</summary>
  −
/// <param name="machine">The machine instance for which to produce output.</param>
  −
/// <param name="location">The location containing the machine.</param>
  −
/// <param name="player">The player using the machine.</param>
  −
/// <returns>Returns whether the interaction was handled.</returns>
  −
public static bool InteractWithMachine(Object machine, GameLocation location, Farmer player);
  −
</syntaxhighlight>
  −
|-
  −
| <samp>HasInput</samp><br /><samp>HasOutput</samp>
  −
| ''(Optional)'' Whether to force adding the <samp>machine_input</samp> or <samp>machine_output</samp> [[#New context tags|context tags]] respectively. This isn't needed for most machines, since they'll be set based on the <samp>OutputRules</samp> field. Default false.
  −
|-
  −
| <samp>IsIncubator</samp>
  −
| ''(Optional)'' Whether this machine acts as an incubator when placed in a building, so players can incubate eggs in it. Default false.
  −
 
  −
This is used by the [[incubator]] and [[Ostrich Incubator|ostrich incubator]]. The game logic assumes there's only one such machine in each building, so this generally shouldn't be used by custom machines that can be built in a vanilla [[barn]] or [[coop]].
  −
|-
  −
| <samp>StatsToIncrementWhenLoaded</samp><br /><samp>StatsToIncrementWhenHarvested</samp>
  −
| ''(Optional)'' The game stat counters to increment when an item is placed in the machine (<samp>StatsToIncrementWhenLoaded</samp>) or when the processed output is collected (<samp>StatsToIncrementWhenHarvested</samp>). Default none. This consists of a list of models with these fields:
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 1,217: Line 1,085:  
! effect
 
! effect
 
|-
 
|-
| <samp>StatName</samp>
+
| <samp>Id</samp>
| The name of the stat counter field in <samp>Game1.stats</samp>. Stat names are case-insensitive.
+
| The [[Modding:Common data field types#Unique string ID|unique string ID]] for this entry in the list.
 
|-
 
|-
| <samp>RequiredItemId</samp>
+
| <samp>Weather</samp>
| ''(Optional)'' If set, only increment the stat if the main input item has this qualified or unqualified item ID.
+
| The [[#Custom weather|weather ID]] to set.
 
|-
 
|-
| <samp>RequiredTags</samp>
+
| <samp>Condition</samp>
| ''(Optional)'' If set, only increment the stat if the main input item has ''all'' of these [[Modding:Context tags|context tags]]. You can negate a tag with <samp>!</samp> (like <code>"RequiredTags": [ "bone_item", "!fossil_item" ]</code> for bone items that aren't fossils).
+
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether to apply the weather. Defaults to always applied.
 
|}
 
|}
  −
This can be used to increment both built-in stats (like <samp>GeodesCracked</samp> for the [[Geode Crusher|geode crusher]]) and custom stats. Using a [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] is strongly recommended for custom stats to avoid conflicts.
   
|-
 
|-
| <samp>CustomFields</samp>
+
| <samp>CopyWeatherFromLocation</samp>
| The [[#Custom data fields|custom fields]] for this entry.
+
| ''(Optional)'' The <samp>Name</samp> (i.e. unique ID) of the location context from which to inherit weather.
 
|}
 
|}
   −
====Interacting with machines in C#====
+
If a [[#Custom passive festivals|passive festival]] is active in any location within this context, the weather is sunny for the entire context regardless of these fields.
Stardew Valley 1.6 adds two <samp>Object</samp> fields for reference:
+
 
 +
</dd>
 +
 
 +
<dt>Music:</dt>
 +
<dd>
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 1,240: Line 1,110:  
! effect
 
! effect
 
|-
 
|-
| <samp>lastOutputRuleId</samp>
+
| <samp>DefaultMusic</samp>
| If this is a machine, the output rule ID for the rule being processed by the machine (if any).
+
| ''(Optional)'' The [[#Custom audio|cue ID]] for the music to play when the player is in the location, unless overridden by a <samp>Music</samp> map property. Despite the name, this has a higher priority than the seasonal music fields below. Ignored if omitted.
 
|-
 
|-
| <samp>lastInputItem</samp>
+
| <samp>DefaultMusicCondition</samp>
| If this is a machine, the item that was dropped into the machine to start the current output (if any).
+
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which returns whether the <samp>DefaultMusic</samp> field should be applied (if more specific music isn't playing). Defaults to always true.
|}
+
|-
 +
| <samp>DefaultMusicDelayOneScreen</samp>
 +
| ''(Optional)'' When the player warps and the music changes, whether to silence the music and play the ambience (if any) until the next warp (similar to the default valley locations). Default false.
 +
|-
 +
| <samp>Music</samp>
 +
| ''(Optional)'' A list of [[#Custom audio|cue IDs]] to play before noon in this location unless it's raining, there's a <samp>Music</samp> map property, or the context has a <samp>DefaultMusic</samp> value. If multiple values are specified, the game will play one per day in sequence.
   −
And a few methods for processing items:
+
This consists of a list of models with these fields:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 1,253: Line 1,128:  
! effect
 
! effect
 
|-
 
|-
| <samp>IsMachineWorking()</samp>
+
| <samp>Id</samp>
| Get whether the machine is currently processing an item.
+
| ''(Optional)'' A [[Modding:Common data field types#Unique string ID|unique string ID]] which identifies this entry within the list. Defaults to the <samp>Track</samp> value.
 
|-
 
|-
| <samp>ShouldTimePassForMachine(location)</samp>
+
| <samp>Track</samp>
| Get whether the machine should be updated in the given location. For example, this will return false for [[Solar Panel|solar panels]] placed indoors, or outdoors on a cloudy day.
+
| The [[Modding:Migrate to Stardew Valley 1.6#Custom audio|audio track ID]] to play.
 
|-
 
|-
| <samp>GetMachineData()</samp>
+
| <samp>Condition</samp>
| Get the underlying machine data from <samp>Data/Machines</samp>.
+
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether this entry applies. Default true.
 +
|}
 
|-
 
|-
| <samp>PlaceInMachine(…)</samp>
+
| <samp>DayAmbience</samp><br /><samp>NightAmbience</samp>
| Try to place an item in the machine using the rules from <samp>Data/Machines</samp>. This returns a boolean which indicates whether the machine was successfully started.
+
| ''(Optional)'' The [[#Custom audio|cue ID]] for the background ambience to play when there's no music active, depending on the [[Day Cycle|time of day]]. Both default to none.
 
|-
 
|-
| <samp>OutputMachine(…)</samp>
+
| <samp>PlayRandomAmbientSounds</samp>
| Try to set the machine output given the input item and an optional output rule to apply. Most code should call <samp>PlaceInMachine</samp> instead.
+
| ''(Optional)'' Whether to play random outdoor ambience sounds depending on factors like the season and time of day (e.g. birds, crickets, and mysterious groan sounds in the rain). This is unrelated to the <samp>DayAmbience</samp> and <samp>NightAmbience</samp> fields. Default true.
 
|}
 
|}
 +
</dd>
   −
A lot of the generic machine logic is also handled by a new <samp>MachineDataUtility</samp> class, which lets C# mods interact with machine data more directly. For example, you can check which output a machine would produce without actually updating the machine.
+
<dt>Advanced:</dt>
 +
<dd>
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! effect
 +
|-
 +
| <samp>CustomFields</samp>
 +
| The [[#Custom data fields|custom fields]] for this entry.
 +
|}
 +
</dd>
 +
</dl>
   −
===Custom melee weapons===
+
===Custom garbage cans===
[[Modding:Items#Weapons|Melee weapons]] are still stored in <samp>Data/Weapons</samp>, but that asset has been overhauled in Stardew Valley 1.6. The slash-delimited entries are now models to simplify edits and enable new features (like the new <samp>Projectiles</samp> feature).
+
{{/doc status|a new doc page|done=false}}
 +
 
 +
====Format====
 +
You can now add or edit [[Garbage Can|garbage cans]] on any map by editing the new <samp>Data/GarbageCans</samp> asset (see examples below).
   −
This consists of a string → model lookup, where...
+
The asset consists of a data model with these fields:
* The key is the unqualified [[#Custom items|item ID]] for the weapon.
  −
* The value is model with the fields listed below.
     −
====Basic weapon info====
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 1,284: Line 1,172:  
! effect
 
! effect
 
|-
 
|-
| <samp>Name</samp>
+
| <samp>DefaultBaseChance</samp>
| The internal weapon name.
+
| The probability that an item will be found when searching garbage cans, as a value between 0 (never) and 1 (always). If the probability check fails, only items that set <samp>IgnoreBaseChance</samp> can spawn. This can be overridden by the per-garbage-can <samp>BaseChance</samp> field. Default 0.2.
 
|-
 
|-
| <samp>DisplayName</samp><br /><samp>Description</samp>
+
| <samp>BeforeAll</samp><br /><samp>AfterAll</samp>
| A [[Modding:Tokenizable strings|tokenizable string]] for the translated display name & description.
+
| The items to prepend (<samp>BeforeAll</samp>) or append (<samp>AfterAll</samp>) to the <samp>GarbageCans</samp> → <samp>Items</samp> field for all garbage cans. These work exactly like the items in that field (e.g. subject to the garbage can's base chance).
 
|-
 
|-
| <samp>Type</samp>
+
| <samp>GarbageCans</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).
+
| The data for individual garbage cans. This consists of a string → model lookup with these fields:
|}
     −
====Appearance====
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 1,300: Line 1,186:  
! effect
 
! effect
 
|-
 
|-
| <samp>Texture</samp>
+
| ''entry key''
| The asset name for the spritesheet containing the weapon's sprite.
+
| The [[Modding:Common data field types#Unique string ID|unique string ID]] for this garbage can.
 +
|-
 +
| <samp>BaseChance</samp>
 +
| ''(Optional)'' If set, overrides the root <samp>DefaultBaseChance</samp> field for this garbage can. Defaults to <samp>DefaultBaseChance</samp>.
 
|-
 
|-
| <samp>SpriteIndex</samp>
+
| <samp>Items</samp>
| The index within the <samp>Texture</samp> for the weapon sprite, where 0 is the top-left sprite.
+
| ''(Optional)'' The items to try spawning when the player searches the garbage can. The first matching item in <samp>BeforeAll</samp> + <samp>Items</samp> + <samp>AfterAll</samp> will be spawned, and any further items will be ignored. Defaults to none.
|}
     −
====Stats====
+
This consists of a list of models with these fields:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 1,313: Line 1,201:  
! effect
 
! effect
 
|-
 
|-
| <samp>MinDamage</samp><br /><samp>MaxDamage</samp>
+
| ''common fields''
| The minimum and maximum based damage caused when hitting a monster with this weapon.
+
| See [[Modding:Item queries#Item spawn fields|item spawn fields]] for the generic item fields supported by garbage cans.
 +
 
 +
If set to an [[Modding:Item queries|item query]] which returns multiple items, one of them will be selected at random.
 
|-
 
|-
| <samp>Knockback</samp>
+
| <samp>IgnoreBaseChance</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.
+
| ''(Optional)'' Whether this item can spawn even if the <samp>BaseChance</samp> probability check didn't pass. Default false.
 
|-
 
|-
| <samp>Speed</samp>
+
| <samp>IsMegaSuccess</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.
+
| ''(Optional)'' Whether to treat this item as a 'mega success' if it's selected, which plays a special <samp>crit</samp> sound and bigger animation. Default false.
 
|-
 
|-
| <samp>Precision</samp>
+
| <samp>IsDoubleMegaSuccess</samp>
| ''(Optional)'' Reduces the chance that a strike will miss. Default 0.
+
| ''(Optional)'' Whether to treat this item as an 'double mega success' if it's selected, which plays an explosion sound and dramatic animation. Default false.
 
|-
 
|-
| <samp>Defense</samp>
+
| <samp>AddToInventoryDirectly</samp>
| ''(Optional)'' Reduces damage received by the player. Default 0.
+
| ''(Optional)'' Whether to add the item to the player's inventory directly, opening an item grab menu if they don't have room in their inventory. If false, the item will be dropped on the ground next to the garbage can instead. Default false.
 
|-
 
|-
| <samp>AreaOfEffect</samp>
+
| <samp>CreateMultipleDebris</samp>
| ''(Optional)'' Slightly increases the area of effect. Default 0.
+
| ''(Optional)'' Whether to split the spawned item into multiple stacks which each have a stack size of one. This has no effect if <samp>AddToInventoryDirectly</samp> is enabled. Default false.
|-
+
|}
| <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====
+
If the garbage can being searched doesn't have its own entry under <samp>GarbageCans</samp>, the game will just use the <samp>BeforeAll</samp> and <samp>AfterAll</samp> fields.
{| 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:Modder Guide/Game Fundamentals#Unique string IDs|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>
 
| <samp>CustomFields</samp>
Line 1,421: Line 1,229:  
|}
 
|}
   −
===Custom movie concessions===
+
====Example new garbage can====
: ''See also: [[#Custom movies|custom movies]].''
+
You can add garbage cans using only [[Modding:Content Patcher|Content Patcher]] or [[Modding:Modder Guide/APIs/Content|SMAPI's content API]]. For example, this content pack adds a new garbage can entry with the ID <samp>Example.ModId_Carpenter</samp>:
   −
You could already [[Modding:Movie theater data#Concession data|add/edit concessions]] sold in the [[Movie Theater|movie theater]], but conflicts were likely since each concession had an incrementing numeric ID which matched its position in the vanilla tilesheet.
+
{{#tag:syntaxhighlight|<nowiki>
 
+
{
Stardew Valley 1.6 addresses that with two changes:
+
    "Format": "</nowiki>{{Content Patcher version}}<nowiki>",
<ul>
+
    "Changes": [
<li>The <samp>Id</samp> field is now a [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]].</li>
+
        {
<li>You can now use a different texture with two new required fields:
+
            "Action": "EditData",
{| class="wikitable"
+
            "Target": "Data/GarbageCans",
|-
+
            "TargetField": [ "GarbageCans" ],
! field
+
            "Entries": {
! effect
+
                "{{ModId}}_Carpenter": {
|-
+
                    "Items": [
| <samp>Texture</samp>
+
                        // 25% chance of pufferfish
| The asset name for the texture containing the concession's sprite.
+
                        {
|-
+
                            "ID": "{{ModId}}_Pufferfish",
| <samp>SpriteIndex</samp>
+
                            "Condition": "RANDOM 0.25",
| The index within the <samp>Texture</samp> for the concession sprite, where 0 is the top-left sprite.
+
                            "ItemId": "(O)128"
|}
+
                        },
</li>
+
 
</ul>
+
                        // else guaranteed random House Plant item
 +
                        {
 +
                            "ID": "{{ModId}}_RandomHousePlant",
 +
                            "ItemID": "RANDOM_ITEMS (F) 1376 1390"
 +
                        }
 +
                    ]
 +
                }
 +
            }
 +
        }
 +
    ]
 +
}</nowiki>|lang=javascript}}
 +
 
 +
Then you'd place an <code>Action: Garbage Example.ModId_Carpenter</code> [[Modding:Maps|map tile property]] to mark a tile as a garbage can using this data.
 +
 
 +
====Example change for existing garbage can====
 +
You can edit an existing garbage cans using only [[Modding:Content Patcher|Content Patcher]] or [[Modding:Modder Guide/APIs/Content|SMAPI's content API]]. For example, this content pack adds pufferfish to the Saloon garbage can, and moves it above the dish of the day.
 +
 
 +
Note that this uses <samp>TargetField</samp> to 'move into' the item list for the saloon, and then treat those items as the entry list being edited. Specifying an ID which isn't in the list will add a new entry, just like when editing a regular list asset.
   −
For example, this content pack adds a new 'Pufferchick Pop' concession with a custom image:
   
{{#tag:syntaxhighlight|<nowiki>
 
{{#tag:syntaxhighlight|<nowiki>
 
{
 
{
Line 1,451: Line 1,275:  
         {
 
         {
 
             "Action": "EditData",
 
             "Action": "EditData",
             "Target": "Data/Concessions",
+
             "Target": "Data/GarbageCans",
 +
            "TargetField": [ "GarbageCans", "Saloon", "Items" ],
 
             "Entries": {
 
             "Entries": {
                 "Example.ModId_PufferchickPop": {
+
                 // 25% chance of pufferfish
                    "Id": "Example.ModId_PufferchickPop", // must specify ID again when creating a new entry
+
               
                    "Name": "PufferchickPop",
+
                "{{ModId}}_Pufferfish":{
                     "DisplayName": "Pufferchick Pop",
+
                     "ID": "{{ModId}}_Pufferfish",
                     "Description": "A cute cake pop shaped like a pufferchick.",
+
                     "Condition": "RANDOM 0.25",
                     "Price": 25,
+
                     "ItemId": "(O)128"
                    "Texture": "{{InternalAssetKey: assets/pufferchick-pop.png}}" // an image in your content pack
  −
                    "SpriteIndex": 0
   
                 }
 
                 }
             }
+
             },
 +
            "MoveEntries": [
 +
                { "ID": "{{ModId}}_Pufferfish", "BeforeId": "Base_DishOfTheDay" }
 +
            ]
 
         }
 
         }
 
     ]
 
     ]
 
}</nowiki>|lang=javascript}}
 
}</nowiki>|lang=javascript}}
   −
===Custom museum donations & rewards===
+
====Changes for C# mods====
You can now add/edit the items which the [[museum]] accepts in donation and gives back in rewards through the new <samp>Data/MuseumRewards</samp> data asset.
+
Previously garbage cans were tracked by <samp>Town.garbageChecked</samp>, an array of boolean fields. That approach doesn't work in Stardew Valley 1.6, since we're no longer limited to a specific set of garbage cans in the town map. This has been replaced by <samp>Game1.netWorldState.Value.CheckedGarbage</samp>, which is a hash set of garbage can IDs.
 
  −
====Format====
  −
The data asset consists of a string → model lookup, where...
  −
* The key is a [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for the reward group.
  −
* The value is a model with the fields listed below.
      +
To migrate code:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! field
+
! action
! effect
+
! code in 1.5.6
 +
! code in 1.6
 +
|-
 +
| check if a garbage can was searched
 +
| <syntaxhighlight lang="js">
 +
Town town = (Town)Game1.getLocationFromName("Town");
 +
if (town.garbageChecked[5])
 +
  ...
 +
</syntaxhighlight>
 +
| <syntaxhighlight lang="js">
 +
if (Game1.netWorldState.Value.CheckedGarbage.Contains("Saloon"))
 +
  ...
 +
</syntaxhighlight>
 
|-
 
|-
| <samp>TargetContextTags</samp>
+
| mark a garbage can searched
| The items that must be donated to complete this reward group. The player must fulfill every entry in the list to unlock the reward. This consists of a list of models with these fields:
+
| <syntaxhighlight lang="js">
 +
Town town = (Town)Game1.getLocationFromName("Town");
 +
town.garbageChecked[5] = true;
 +
</syntaxhighlight>
 +
| <syntaxhighlight lang="js">
 +
Game1.netWorldState.Value.CheckedGarbage.Add("Saloon");
 +
</syntaxhighlight>
 +
|}
 +
 
 +
To migrate former vanilla trash can IDs:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! field
+
! position
! effect
+
! ID in 1.5.6
 +
! ID in 1.6
 
|-
 
|-
| <samp>Tag</samp>
+
| Near [[Jodi]] and [[Kent]]'s house
| The [[Modding:Context tags|context tag]] for the items to require.
+
| <code>0</code>
 +
| <code>JodiAndKent</code>
 
|-
 
|-
| <samp>Count</samp>
+
| Near [[Emily]] and [[Haley]]'s house
| The minimum number of items matching the context tags that must be donated.
+
| <code>1</code>
|}
+
| <code>EmilyAndHaley</code>
 
  −
For example, an entry with the tag <samp>forage_item</samp> and count 2 will require donating any two forage items.
  −
 
  −
Special case: an entry with the exact values <code>Tag: "", Count: -1</code> passes if the museum is complete (i.e. the player has donated the max number of items).
  −
|-
  −
| <samp>FlagOnCompletion</samp>
  −
| ''(Optional if <samp>RewardItemIsSpecial</samp> is true)'' Whether to add the <samp>ID</samp> value to the player's received mail. This is used to track whether the player has collected the reward, and should almost always be true. If this is omitted and <samp>RewardItemIsSpecial</samp> is false, the player will be able collect the reward infinite times. Default false.
  −
 
  −
After the reward is collected, you can check this value using the <samp><nowiki>HasFlag</nowiki></samp> condition in [[Modding:Content Patcher|Content Patcher]].
   
|-
 
|-
| <samp>RewardActions</samp>
+
| Near [[Lewis]]' house
| Run one or more [[Modding:Trigger actions|trigger action strings]]. For example, this adds {{price|500}} to the current player:
+
| <code>2</code>
<syntaxhighlight lang="js">
+
| <code>Mayor</code>
"RewardActions": [
  −
    "AddMoney 500"
  −
]
  −
</syntaxhighlight>
   
|-
 
|-
| <samp>RewardItemId</samp>
+
| Near [[Museum]]
| ''(Optional)'' The [[#Custom items|qualified item ID]] for the item given to the player when they donate all required items for this group. There's no reward item if omitted.
+
| <code>3</code>
 +
| <code>Museum</code>
 
|-
 
|-
| <samp>RewardItemCount</samp>
+
| Near [[Blacksmith|Clint's blacksmith]]
| ''(Optional)'' The stack size for the <samp>RewardItemId</samp> (if the item supports stacking). Default 1.
+
| <code>4</code>
 +
| <code>Blacksmith</code>
 
|-
 
|-
| <samp>RewardItemIsSpecial</samp>
+
| Near [[The Stardrop Saloon|the Saloon]]
| ''(Optional)'' Whether to mark the <samp>RewardItemId</samp> as a special permanent item, which can't be destroyed/dropped and can only be collected once. Default false.
+
| <code>5</code>
 +
| <code>Saloon</code>
 
|-
 
|-
| <samp>RewardItemIsRecipe</samp>
+
| Near [[Evelyn]] and [[George]]'s house
| ''(Optional)'' Whether to give the player a cooking/crafting recipe which produces the <samp>RewardItemId</samp>, instead of the item itself. Ignored if the item type can't be cooked/crafted (i.e. non-object-type items). Default false.
+
| <code>6</code>
 +
| <code>Evelyn</code>
 
|-
 
|-
| <samp>CustomFields</samp>
+
| Near [[JojaMart]]
| The [[#Custom data fields|custom fields]] for this entry.
+
| <code>7</code>
 +
| <code>JojaMart</code>
 
|}
 
|}
   −
For example, this content pack adds two rewards (one mail and one item):
+
===Custom map actions===
{{#tag:syntaxhighlight|<nowiki>
+
{{/doc status|[[Modding:Maps#Custom_Actions]]|done=true}}
{
+
 
    "Format": "</nowiki>{{Content Patcher version}}<nowiki>",
+
C# mods can now handle custom <samp>Action</samp> & <samp>TouchAction</samp> [[Modding:Maps|map properties]] by calling <samp>GameLocation.RegisterTileAction</samp> & <samp>RegisterTouchAction</samp>, and passing a callback which receives the location, map property arguments, player who activated it, and tile position.
    "Changes": [
+
 
        {
+
For example, let's say you want a locked gate which needs a custom key item. You can add a regular <code>TouchAction Example.ModId_UnlockGate</code> map property (e.g. by adding it directly in the map file, or using [[Modding:Content Patcher|Content Patcher]]'s <samp>EditMap</samp>, or using the [[Modding:Modder Guide/APIs/Content|content API]]). Then you can just handle the logic from your C# mod. See the updated docs for an example.
            "Action": "EditData",
+
 
            "Target": "Data/MuseumRewards",
+
As another example, let's say you want the gate to unlock when the player presses the action key. You can add a regular <code>Action Example.ModId_UnlockGate</code> map property (e.g. by adding it directly in the map file, or using [[Modding:Content Patcher|Content Patcher]]'s <samp>EditMap</samp>, or using the [[Modding:Modder Guide/APIs/Content|content API]]). Then you can just handle the logic from your C# mod. See the updated docs for an example.
            "Entries": {
+
 
                // send a letter when a specific item is donated
+
===Custom map layers===
                "{{ModId}}_ShinyArtifact": {
+
{{/doc status|[[Modding:Maps]]|done=true}}
                    "TargetContextTags": [
+
 
                        {
+
You can now add any number of [[Modding:Maps|map layers]] by suffixing a vanilla layer name (i.e. <samp>Back</samp>, <samp>Buildings</samp>, <samp>Front</samp>, or <samp>AlwaysFront</samp>) with an offset. For example, <samp>Back-1</samp> will be drawn before/under <samp>Back</samp>, and <samp>Back2</samp> will be drawn after/over it. You can increment the number to add more layers.
                            "Tag": "id_{{ModId}}_ShinyArtifact", // unique context tag identifying the item by ID
  −
                            "Count": 1
  −
                        },
  −
                    ],
  −
                    "FlagOnCompletion": true,
  −
                    "RewardActions": [ "AddMail Current {{ModId}}_ShinyArtifact" ]
  −
                },
     −
                // give item when 18 minerals are donated
+
This only affects layer rendering. Tile properties must still be set on the original layers.
                "{{ModId}}_18MineralItems": {
  −
                    "TargetContextTags": [
  −
                        {
  −
                            "Tag": "item_type_minerals",
  −
                            "Count": 18
  −
                        },
  −
                    ],
  −
                    "RewardItemId": "(BC){{ModId}}_SuperMachine",
  −
                    "RewardItemCount": 1,
  −
                    "FlagOnCompletion": true
  −
                }
  −
            }
  −
        }
  −
    ]
  −
}</nowiki>|lang=javascript}}
     −
See also [[Modding:Mail data|mail data]], [[#Custom items|custom items]], and [[#custom machines|custom machines]] to add the custom mail and items.
+
===Custom minecarts===
 +
{{/doc status|a new doc page|done=false}}
   −
====Achievements====
+
You can now extend [[minecart]]s by editing the <samp>Data\Minecarts</samp> data asset.
The ''A Complete Collection'' [[Achievements|achievement]] is automatically adjusted to require any custom donations added too. This is based on the number of donated items though, so removing custom donations later may incorrectly mark the museum complete (since you may have donated enough items to meet the total required).
     −
===Custom fruit trees===
+
This consists of a string → model lookup, where...
====Data format====
+
* The key is a [[Modding:Common data field types#Unique string ID|unique string ID]] for the minecart network. When you interact with a minecart, the destinations listed for its network are shown.
You can now add custom [[Fruit Trees|fruit trees]] by editing the revamped <samp>Data/fruitTrees</samp> asset. This consists of a string → model lookup, where...
  −
* The key is the [[#Custom items|unqualified item ID]] for the sapling item in <samp>Data/Objects</samp>.
   
* The value is a model with the fields listed below.
 
* The value is a model with the fields listed below.
   Line 1,581: Line 1,394:  
! effect
 
! effect
 
|-
 
|-
| <samp>DisplayName</samp>
+
| <samp>Destinations</samp>
| A [[Modding:Tokenizable strings|tokenizable string]] for the tree's display name. This should return a display name without 'tree' (like <samp>Cherry</samp> for a cherry tree). This is used in UI messages like "''Your &lt;display name&gt; tree wasn't able to grow last night''".
+
| The destinations which the player can travel to from minecarts in this network. This consists of a list of model with these fields:
|-
  −
| <samp>Seasons</samp>
  −
| The seasons in which the fruit tree bears fruit. This consists of an array of season names (any combination of <samp>spring</samp>, <samp>summer</samp>, <samp>fall</samp>, or <samp>winter</samp>).
  −
 
  −
'''Note:''' the previous '<samp>island</samp>' season value is no longer valid. Using <samp>summer</samp> is equivalent to how it worked before (since we now have [[#Custom location contexts|per-location seasons]]).
  −
|-
  −
| <samp>Fruit</samp>
  −
| The fruit items to add to the tree each day while the tree is in-season. The first matching fruit (if any) is selected each day.
  −
 
  −
This consists of a list of models with these fields:
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 1,598: Line 1,401:  
! effect
 
! effect
 
|-
 
|-
| ''common fields''
+
| <samp>Id</samp>
| See [[Modding:Item queries#Item spawn fields|item spawn fields]] for the generic item fields supported for fruit items.
+
| A [[Modding:Common data field types#Unique string ID|unique string ID]] for this destination within the network.
 
  −
Notes:
  −
* If set to an [[Modding:Item queries|item query]] which returns multiple items, one of them will be selected at random.
  −
* Season conditions are ignored in non-seasonal locations like the [[greenhouse]] and [[Ginger Island]].
   
|-
 
|-
| <samp>Season</samp>
+
| <samp>DisplayName</samp>
| ''(Optional)'' If set, the group only applies if the tree's location is in this season. This is ignored in non-seasonal locations like the [[greenhouse]] and [[Ginger Island]].
+
| A [[Modding:Tokenizable strings|tokenizable string]] for the destination name shown in the minecart menu. You can use the location's display name with the <samp>LocationName</samp> token (like <code>[LocationName Desert]</code> for the [[desert]]).
 
|-
 
|-
| <samp>Chance</samp>
+
| <samp>TargetLocation</samp>
| ''(Optional)'' The probability that this entry is selected, as a value between 0 (never drops) and 1 (always drops). Default 1 (100% chance).
+
| The [[#Custom locations|location ID]] for the destination.
|}
   
|-
 
|-
| <samp>Texture</samp>
+
| <samp>TargetTile</samp>
| The asset name for the texture under the game's <samp>Content</samp> folder. Use <samp>\</samp> (or <samp>\\</samp> in JSON) to separate name segments if needed. For example, vanilla fruit trees use <samp>TileSheets\fruitTrees</samp>.
+
| The destination tile position within the location, specified as a model with <samp>X</samp> and <samp>Y</samp> fields.
 
|-
 
|-
| <samp>TextureSpriteRow</samp>
+
| <samp>TargetDirection</samp>
| The tree's row index in the <samp>Texture</samp> spritesheet (e.g. 0 for the first tree, 1 for the second tree, etc).
+
| The direction the player should face after arrival (one of <samp>down</samp>, <samp>left</samp>, <samp>right</samp>, or <samp>up</samp>).
 
|-
 
|-
| <samp>PlantableLocationRules</samp>
+
| <samp>Condition</samp>
| ''(Optional)'' The rules to decide which locations you can plant the sapling in, if applicable. The first matching rule is used. This can override location checks (e.g. crops being limited to the farm), but not built-in requirements like crops needing dirt.
+
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether this minecart destination is available. Defaults to always available.
 
  −
This consists of a list of models with these fields:
  −
 
  −
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>Price</samp>
! effect
+
| ''(Optional)'' The gold price that must be paid each time to use this destination. Default none.
 
|-
 
|-
| <samp>Id</samp>
+
| <samp>BuyTicketMessage</samp>
| The [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for this entry within the list.
+
| ''(Optional)'' If the destination costs money to use, a [[Modding:Tokenizable strings|tokenizable string]] for the purchase confirmation message shown. If present, <code>{0}</code> is replaced with the purchase price. Defaults to the network's <samp>BuyTicketMessage</samp> field.
 
|-
 
|-
| <samp>Result</samp>
+
| <samp>CustomFields</samp>
| Indicates whether the sapling can be planted in a location if this entry is selected. The possible values are:
+
| ''(Optional)'' The [[#Custom data fields|custom fields]] for this entry.
* <samp>Default</samp>: the sapling can be planted if the location normally allows it. This can be used to stop processing further rules, and/or set a custom <samp>DeniedMessage</samp>.
+
|}
* <samp>Allow</samp>: the sapling can be planted here, regardless of whether the location normally allows it.
  −
* <samp>Deny</samp>: the sapling can't be planted here, regardless of whether the location normally allows it.
   
|-
 
|-
| <samp>Condition</samp>
+
| <samp>UnlockCondition</samp>
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether this entry applies. Default true.
+
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether this minecart network is unlocked. Default always enabled.
 
|-
 
|-
| <samp>PlantedIn</samp>
+
| <samp>LockedMessage</samp>
| ''(Optional)'' The planting context to apply this rule for. The possible values are <samp>Ground</samp> (planted directly in the ground), <samp>GardenPot</samp> (planted in a [[Garden Pot|garden pot]]), or <samp>Any</samp>. Default <samp>Any</samp>.
+
| ''(Optional)'' A [[Modding:Tokenizable strings|tokenizable string]] for the message shown when interacting with a minecart when the <samp>UnlockCondition</samp> false. Defaults to an "''Out of order''" translation.
 
  −
Note that saplings can't be planted in garden pots.
   
|-
 
|-
| <samp>DeniedMessage</samp>
+
| <samp>ChooseDestinationMessage</samp>
| ''(Optional)'' If this rule prevents planting the sapling, the tokenizable string to show to the player (or <samp>null</samp> to default to the normal behavior for the context). This also applies when the <samp>Result</samp> is <samp>Default</samp>, if that causes the planting to be denied.
+
| ''(Optional)'' A [[Modding:Tokenizable strings|tokenizable string]] for the message shown when listing destinations to choose from. Defaults to a "''Choose destination:''" translation.
|}
   
|-
 
|-
| <samp>CustomFields</samp>
+
| <samp>BuyTicketMessage</samp>
| The [[#Custom data fields|custom fields]] for this entry.
+
| ''(Optional)'' When a destination costs money to use, a [[Modding:Tokenizable strings|tokenizable string]] for the purchase confirmation message shown. If present, <code>{0}</code> is replaced with the purchase price. Defaults to a "''Buy a ticket for {0}g?''" translation.
 
|}
 
|}
   −
For example, this content pack adds a custom fruit tree, including [[#Custom items|custom items]] for the sapling and fruit:
+
====Open a minecart menu====
 +
You can use an <samp>Action: MinecartTransport {{o|network ID}} {{o|exclude destination ID}}</samp> [[Modding:Maps|map property]] to open the minecart menu. When the player interacts with the tile, it'll open the menu for the {{o|network ID}} network (default <samp>Default</samp>). if {{o|exclude destination ID}} is specified, the matching destination will be hidden from the list (usually because you're at that minecart). For example, the [[Bus Stop|bus stop]] minecart uses <code>Action: MinecartTransport Default Bus</code>.
 +
 
 +
From a C# mod, you can call <code>Game1.currentLocation.ShowMineCartMenu(networkId, excludeDestinationId)</code> which works the same way (except that <samp>networkId</samp> is required).
 +
 
 +
====Example====
 +
This [[Modding:Content Patcher|Content Patcher]] content pack adds the [[Railroad]] as a minecart destination, complete with a map edit adding a decorative minecart. It is available after the [[Random Events|Earthquake]] has occurred and minecarts have been unlocked.
    
{{#tag:syntaxhighlight|<nowiki>
 
{{#tag:syntaxhighlight|<nowiki>
Line 1,659: Line 1,454:  
     "Format": "</nowiki>{{Content Patcher version}}<nowiki>",
 
     "Format": "</nowiki>{{Content Patcher version}}<nowiki>",
 
     "Changes": [
 
     "Changes": [
         // add fruit + sapling items
+
         // add minecart destination
        // note: sapling must have an edibility under 0 (usually -300) to be plantable
   
         {
 
         {
 
             "Action": "EditData",
 
             "Action": "EditData",
             "Target": "Data/Objects",
+
             "Target": "Data/Minecarts",
 +
            "TargetField": [ "Default", "Destinations" ], // for the "Default" network, edit the "Destinations" field
 
             "Entries": {
 
             "Entries": {
                 "Example.ModId_Pufferfruit": {
+
                 "Railroad": {
                     "Name": "Pufferfruit",
+
                     "Id": "Railroad",
                     "DisplayName": "Pufferfruit",
+
                     "DisplayName": "[LocationName Railroad]",
                     "Description": "An example fruit item.",
+
                     "Condition": "LOCATION_ACCESSIBLE Railroad",
                    "Type": "Basic",
  −
                    "Category": -6,
  −
                    "Price": 1200,
     −
                     "Texture": "Mods/Example.ModId/Objects",
+
                     "TargetLocation": "Railroad",
                     "SpriteIndex": 0
+
                     "TargetTile": { "X": 16, "Y": 39 },
                },
+
                     "TargetDirection": "down",
                "Example.ModId_Puffersapling": {
  −
                    "Name": "Puffersapling",
  −
                    "DisplayName": "Puffersapling",
  −
                    "Description": "An example tree sapling.",
  −
                    "Type": "Basic",
  −
                     "Category": -74,
  −
                    "Price": 1200,
  −
 
  −
                    "Texture": "Mods/Example.ModId/Objects",
  −
                    "SpriteIndex": 1
   
                 }
 
                 }
 
             }
 
             }
 
         },
 
         },
   −
         // add fruit tree
+
         // add decorative minecart
 
         {
 
         {
             "Action": "EditData",
+
             "Action": "EditMap",
             "Target": "Data/FruitTrees",
+
             "Target": "Maps/Railroad",
             "Entries": {
+
             "FromFile": "assets/Custom_Railroad_Minecart.tmx",
                "Example.ModId_Puffersapling": {
+
            "ToArea": { "X": 15, "Y": 35, "Width": 4, "Height": 5 }
                    "DisplayName": "Pufferfruit",
+
         }
                    "Seasons": [ "spring" ],
  −
                    "Fruit": [
  −
                        {
  −
                            "Id": "Example.ModId_Pufferfruit",
  −
                            "ItemId": "Example.ModId_Pufferfruit"
  −
                        }
  −
                    ],
  −
                    "Texture": "Mods/Example.ModId/FruitTrees",
  −
                    "TextureSpriteRow": 0
  −
                }
  −
            }
  −
         },
  −
 
  −
        // add images
  −
        {
  −
            "Action": "Load",
  −
            "Target": "Mods/Example.ModId/FruitTrees, Mods/Example.ModId/Objects",
  −
            "FromFile": "assets/{{TargetWithoutPath}}.png" // assets/FruitTrees.png, assets/Objects.png
  −
        },
   
     ]
 
     ]
 
}</nowiki>|lang=javascript}}
 
}</nowiki>|lang=javascript}}
   −
The fruit trees can then be added to the game by giving the player a sapling item in the usual ways (e.g. from [[#Custom shops|a shop]]).
+
===Custom passive festivals===
 +
{{/doc status|[[Modding:Festival data]] or a new doc page|done=false}}
   −
====Fruit items====
+
You can now add or modify passive festivals by editing the <samp>Data/PassiveFestivals</samp> asset.
For C# mods, the <samp>fruitsOnTree</samp> field (number of fruit on the tree) has been replaced by <samp>fruit</samp> (list of fruit items).
     −
====Spawning fruit trees====
+
(A ''passive festival'' is a [[festivals|festival]] like the [[Night Market]]. They replace a location for a period of time, the player can enter/leave them anytime, and time continues passing while at the festival.)
Custom trees can be added to the game in two ways:
  −
* Spawn them on [[Modding:Maps|map tiles]] when the location is created, using the new <samp>SpawnTree: fruit {{t|tree ID}} {{o|growth stage on location created}} {{o|growth stage on day-update regrowth}}</samp> tile property. This must be added on the <samp>Paths</samp> layer, which must also have tile index 34 from the <samp>paths</samp> tilesheet.
  −
* Or give the player a seed item in the usual ways (e.g. from [[#Custom shops|a shop]], [[Modding:Mail data|mail letter]], etc).
     −
===Custom objects===
+
====Data format====
You can now create/edit objects (the main item type) by editing the new <samp>Data/Objects</samp> asset, which replaces the previous slash-delimited <samp>Data/objectInformation</samp>.
+
The <samp>Data/PassiveFestivals</samp> asset consists of a string → model lookup, where...
 
+
* The key is a [[Modding:Common data field types#Unique string ID|unique string ID]] for the festival.
Besides the format change, this adds...
  −
* support for custom textures;
  −
* revamped geode drops with support for conditions, probabilities, and item queries;
  −
* expanded food/drink buffs (e.g. set a custom buff ID, add a custom buff icon, etc);
  −
* context tags (moved from the former <samp>Data/ObjectContextTags</samp> asset);
  −
* [[#Custom data fields|custom fields]] to let framework mods support additional features.
  −
 
  −
This consists of a string → model lookup, where...
  −
* The key is the unqualified [[#Custom items|item ID]].
   
* The value is a model with the fields listed below.
 
* The value is a model with the fields listed below.
  −
====Basic info====
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
 
! field
 
! field
! purpose
+
! effect
 
|-
 
|-
| <samp>Name</samp>
+
| <samp>DisplayName</samp>
| The internal item name.
+
| A [[Modding:Tokenizable strings|tokenizable string]] for the display name shown on the [[calendar]].
 
|-
 
|-
| <samp>DisplayName</samp><br /><samp>Description</samp>
+
| <samp>Season</samp>
| A [[Modding:Tokenizable strings|tokenizable string]] for the item's in-game display name and description.
+
| The [[season]] when the festival becomes active.
 
|-
 
|-
| <samp>Type</samp>
+
| <samp>StartDay</samp><br /><samp>EndDay</samp>
| The item's general type, like <c>Arch</c> (artifact) or <c>Minerals</c>. See details at [[Modding:Items#Objects]].
+
| The days of month when the festival becomes active.
 
|-
 
|-
| <samp>Category</samp>
+
| <samp>StartTime</samp>
| The [[Modding:Items#Categories|item category]].
+
| The time of day when the festival opens each day.
 
|-
 
|-
| <samp>Price</samp>
+
| <samp>StartMessage</samp>
| ''(Optional)'' The price when sold by the player. This is not the price when bought from a shop. Default 0.
+
| A [[Modding:Tokenizable strings|tokenizable string]] for the in-game [[wikipedia:Pop-up notification|toast notification]] shown when the festival begins each day.
|}
+
|-
 +
| <samp>MapReplacements</samp>
 +
| The locations to swap for the duration of the festival. Despite the field name, this swaps '''locations''' (e.g. as added by <samp>CustomLocations</samp> using [[Modding:Content Patcher|Content Patcher]]), and not the location's map asset.
   −
====Appearance====
+
This is specified as a string → string lookup, where the key is the original location to replace and the value is the new location. Both use the internal location name, as shown by the {{nexus mod|679|Debug Mode}} mod. For example, this swaps the <samp>Beach</samp> location with <samp>BeachNightMarket</samp> during the [[Night Market]]:
{| class="wikitable"
+
<syntaxhighlight lang="js">
 +
"MapReplacements": {
 +
    "Beach": "BeachNightMarket"
 +
}
 +
</syntaxhighlight>
 +
|-
 +
| <samp>Condition</samp>
 +
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether the festival is enabled (subject to the other fields like <samp>StartDay</samp> and <samp>EndDay</samp>). Defaults to always enabled.
 
|-
 
|-
! field
+
| <samp>ShowOnCalendar</samp>
! purpose
+
| ''(Optional)'' Whether the festival appears on the [[calendar]], using the same iridium-star icon as the [[Calendar#Winter|Night Market]]. Default true.
 
|-
 
|-
| <samp>Texture</samp>
+
| <samp>DailySetupMethod</samp><br /><samp>CleanupMethod</samp>
| The asset name for the texture containing the item's sprite. Defaults to <samp>Maps/springobjects</samp>.
+
| ''(Optional)'' A C# method which applies custom logic when the day starts (<samp>DailySetupMethod</samp>) and/or overnight after the last day of the festival (<samp>CleanupMethod</samp>).
 +
 
 +
These must be specified in the form <samp>{{t|full type name}}: {{t|method name}}</samp> (like <samp>ExampleMod.Namespace.Type, ExampleMod: MethodName</samp>). The methods must be static, take zero arguments, and return void.
 
|-
 
|-
| <samp>SpriteIndex</samp>
+
| <samp>CustomFields</samp>
| The sprite's index within the <samp>Texture</samp>, where 0 is the top-left sprite.
+
| The [[#Custom data fields|custom fields]] for this entry.
 
|}
 
|}
   −
====Edibility====
+
====NPC schedules====
 +
When a passive festival is active, NPCs will check for [[Modding:Schedule data|a schedule entry]] in this order:
 +
 
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! field
+
! syntax
! purpose
+
! summary
 
|-
 
|-
| <samp>Edibility</samp>
+
| <samp>{{t|festival ID}}_{{t|festival day}}</samp>
| ''(Optional)'' A numeric value that determines how much energy (edibility × 2.5) and health (edibility × 1.125) is restored when this item is eaten. An item with an edibility of -300 can't be eaten, values from -299 to -1 reduce health and energy, and zero can be eaten but doesn't change health/energy. Default -300.
+
| Applies on the given date. The {{t|festival day}} is relative, so <samp>1</samp> matches the festival <samp>StartDay</samp>.<br /><small>Example: <samp>NightMarket_3</samp> or <samp>marriage_NightMarket_3</samp></small>
 
|-
 
|-
| <samp>IsDrink</samp>
+
| <samp>{{t|festival ID}}</samp>
| ''(Optional)'' Whether to drink the item instead of eating it. Default false.
+
| Applies if there's no date-specific entry.<br /><small>Example: <samp>NightMarket</samp> or <samp>marriage_NightMarket</samp></small>
|-
+
|}
| <samp>Buff</samp>
+
 
| ''(Optional)'' The buff to apply to the player when this item is eaten, if any. Default none.
+
If the NPC is married to a player, they'll add a <samp>marriage_</samp> prefix to the keys (like <samp>marriage_{{t|festival ID}}_{{t|festival day}}</samp>) and ignore any entry without the prefix.
   −
This consists of a model with these fields:
+
===Custom weather===
{| class="wikitable"
+
{{/doc status|[[Modding:Weather data]]|done=false}}
|-
+
 
! field
+
You can now change the weather algorithm by editing [[#Custom location contexts|location context data]], and (with a C# mod) implement custom weathers.
! purpose
+
 
|-
+
Fields like <samp>Game1.weather</samp> and <samp>Game1.weatherForTomorrow</samp> are now strings to support custom mod weather IDs. The change for vanilla weather has no effect on Content Patcher packs, since the new weather IDs match the ones Content Patcher was using before (i.e. <samp>Sun</samp>, <samp>Rain</samp>, <samp>Snow</samp>, <samp>Storm</samp>, and <samp>Wind</samp>). C# mods may also see a <samp>Festival</samp> weather, while Content Patcher packs will see <samp>Sun</samp> for it. The constants like <samp>Game1.weather_sunny</samp> have the new string values (with new constants like <samp>Game1.legacy_weather_sunny</samp> for the legacy values).
| <samp>Duration</samp>
+
 
| The buff duration measured in in-game minutes. This can be set to value <samp>-2</samp> for a buff that should last for the rest of the day.
+
The base game will treat an invalid weather as sunny. C# mods can implement custom weather effects using [[Modding:Modder Guide/APIs/Events|normal SMAPI events]] like <samp>UpdateTicked</samp>, or by [[Modding:Modder Guide/APIs/Harmony|patching]] methods like <samp>Game1.ApplyWeatherForNewDay</samp> and <samp>Game1.populateDebrisWeatherArray</samp>.
 +
 
 +
===Custom world maps===
 +
{{/doc status|[[Modding:World map]]|done=true}}
 +
 
 +
[[File:Modding map area.png|thumb|The default world map, with the farm map area highlighted.]]
 +
 
 +
You can now change the world map shown in the game menu by editing the <samp>Data/WorldMap</samp> asset. This lets you...
 +
* add custom maps for certain locations;
 +
* apply texture overlays;
 +
* add/edit tooltips;
 +
* set real-time player marker positioning;
 +
* etc.
 +
 
 +
The game's default map is fully defined in <samp>Data/WorldMap</samp>, including all the display text and conditional changes.
 +
 
 +
===New map properties===
 +
{{/doc status|[[Modding:Maps#Known_map_properties]]|done=true}}
 +
 
 +
1.6 adds several new [[Modding:Maps|map properties]].
 +
 
 +
====Building construction====
 +
{| class="wikitable"
 
|-
 
|-
| <samp>BuffId</samp>
+
! property
| ''(Optional)'' The buff ID to apply. If this matches an entry in [[#Custom buffs|<samp>Data/Buffs</samp>]], its data fields will be applied unless overridden by one of the other fields. Defaults to <samp>food</samp> or <samp>drink</samp> depending on the item's <samp>IsDrink</samp> field.
+
! explanation
 
|-
 
|-
| <samp>IsDebuff</samp>
+
| <samp>CanBuildHere T</samp><br />''(valid in any outdoor location)''
| ''(Optional)'' Whether this buff counts as a debuff, so its duration should be halved when wearing a Sturdy Ring. Default false.
+
| Whether to allow constructing buildings in this location. The game will adjust automatically to account for it (e.g. Robin will let you choose where to build). See [[#Build anywhere|''build anywhere'' in what's new]].
 
|-
 
|-
| <samp>IconTexture</samp>
+
| <samp>BuildConditions {{t|query}}</samp><br />''(valid in any outdoor location)''
| ''(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.
+
| If <samp>CanBuildHere</samp> is set, an optional [[Modding:Game state queries|game state query]] which indicates whether building is allowed currently.
 
|-
 
|-
| <samp>SpriteIndex</samp>
+
| <samp>LooserBuildRestrictions T</samp><br />''(valid in any outdoor location)''
| ''(Optional)'' The buff's icon index within the <samp>IconTexture</samp>, where 0 is the top-left icon. Default 0.
+
| If set, tiles don't need to be marked <samp>Buildable T</samp> or <samp>Diggable T</samp> in their properties. Tiles can be blocked with <samp>Buildable F</samp> instead. The other restrictions still apply.
 
|-
 
|-
| <samp>GlowColor</samp>
+
| <samp>ValidBuildRect {{t|x}} {{t|y}} {{t|width}} {{t|height}}</samp><br />''(valid in any outdoor location)''
| ''(Optional)'' The glow color to apply to the player. See [[#Color fields|color format]]. Default none.
+
| The tile area within the map where buildings may be placed. If omitted, buildings may be placed in any open space in the map.
|-
+
|}
| <samp>CustomAttributes</samp>
  −
| The custom buff attributes to apply, if any.
     −
This consists of a model with any combination of these fields:
+
====Crops====
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! field
+
! property
! purpose
+
! explanation
 
|-
 
|-
| <samp>FarmingLevel</samp><br /><samp>FishingLevel</samp><br /><samp>ForagingLevel</samp><br /><samp>LuckLevel</samp><br /><samp>MiningLevel</samp>
+
| <samp>AllowGiantCrops T</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.
+
| If set with any non-blank value, [[Crops#Giant Crops|giant crops]] can grow in this location (if crops are also allowed per the [[#Custom crops|crop data]] or [[#Custom location contexts|<samp>PlantableLocations</samp> context field]]).
 
|-
 
|-
| <samp>Attack</samp><br /><samp>Defense</samp><br /><samp>MagneticRadius</samp><br /><samp>MaxStamina</samp><br /><samp>Speed</samp>
+
| <samp>DirtDecayChance {{t|chance}}</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 probability that each dirt tile will disappear overnight if it doesn't contain a crop, as a value between 0 (never) and 1 (always). Defaults to 0 (greenhouses), 0.1 (farms), and 1 (anywhere else).
 
|}
 
|}
|-
+
 
| <samp>CustomFields</samp>
+
====Farmhouse interior====
| ''(Optional)'' The [[#Custom data fields|custom fields]] for this entry.
  −
|}
  −
|}
  −
 
  −
====Geodes & artifact spots====
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! field
+
! property
! purpose
+
! explanation
 
|-
 
|-
| <samp>GeodeDrops</samp><br /><samp><samp>GeodeDropsDefaultItems</samp>
+
| <samp>FarmHouseStarterGift [{{t|id}} {{o|count}}]+</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.
+
| The items that should appear in the initial gift box placed in the farmhouse when the save is created. This consists of one or more pairs of item ID (which can be qualified or unqualified) and count. The count is optional on the last entry.
   −
You can specify one or both fields:
+
For example, this will add 10 pufferfish (object 128) and a blobfish mask (hat 56):
<ul>
+
<pre>FarmHouseStarterGift (O)128 10 (H)56 1</pre>
<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:
+
 
 +
If omitted, the default items (usually a 15 parsnip seeds) are added instead.
 +
|}
 +
 
 +
====Warps & map positions====
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! field
+
! property
! purpose
+
! explanation
 
|-
 
|-
 +
| <samp>AllowWakeUpWithoutBed {{t|allow}}</samp>
 +
| Whether the player can wake up in this location without a bed, similar to the island farmhouse. This is typically used with <samp>PassOutLocations</samp> in [[#Custom location contexts|<samp>Data/LocationContexts</samp>]].
 
|-
 
|-
| ''common fields''
+
| <samp>DefaultWarpLocation {{t|x}} {{t|y}}</samp><br />''(valid in any location)''
| See [[Modding:Item queries#Item spawn fields|item spawn fields]] for the generic item fields supported by geode drops.
+
| The default arrival tile, used when a player or NPC is added to the location without a target tile (e.g. using [[Modding:Console commands|debug commands]] like <samp>debug warp</samp> or <samp>debug eventbyid</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>
+
| <samp>PetBowlLocation {{t|x}} {{t|y}}</samp><br />''(valid in the farm)''
| ''(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.
+
| The default position of the pet bowl
 
|-
 
|-
| <samp>SetFlagOnPickup</samp>
+
| <samp>SpouseRoomPosition {{t|x}} {{t|y}}</samp><br />''(valid in farmhouse)''
| ''(Optional)'' The mail flag to set for the current player when this drop is picked up.
+
| The top-left position at which to place the [[Marriage#Spouse Rooms|spouse room]].
 
|-
 
|-
| <samp>Precedence</samp>
+
| <samp>TravelingCartPosition {{t|x}} {{t|y}}</samp><br />''(valid in the forest)''
| ''(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.
+
| The top-left position at which to place the [[Traveling Cart]]. This is the top-left corner of the collision box, so the roof will extend two tiles above this tile.
 +
|}
   −
For consistency, vanilla drops mostly use these values:
+
===Other map property changes===
* <samp>-1000</samp>: special overrides like the [[Golden Helmet]];
+
{{/doc status|[[Modding:Maps]]|done=true}}
* <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>
     −
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.
  −
|-
  −
| <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.
  −
  −
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"
 
|-
 
|-
! field
+
! map property
! purpose
+
! changes
 
|-
 
|-
| <samp>ContextTags</samp>
+
| <samp>Arch</samp><br /><samp>asdf</samp><br /><samp>Debris</samp><br /><samp>Fish</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:
+
| Removed (these were unused).
<syntaxhighlight lang="json">
  −
"ContextTags": [ "color_yellow", "fish_ocean", "fish_upright", "season_summer" ]
  −
</syntaxhighlight>
   
|-
 
|-
| <samp>ExcludeFromRandomSale</samp>
+
| <samp>FarmHouseFlooring</samp><br /><samp>FarmHouseFurniture</samp><br /><samp>FarmHouseStarterSeedsPosition</samp><br /><samp>FarmHouseWallpaper</samp>
| ''(Optional)'' Whether to exclude this item from shops when selecting random items to sell. Default false.
+
| These now work independently. For example, you can now use <samp>FarmHouseFlooring</samp> without needing to set <samp>FarmHouseFurniture</samp> too.
 
|-
 
|-
| <samp>ExcludeFromFishingCollection</samp><br /><samp>ExcludeFromShippingCollection</samp>
+
| <samp>Music</samp>
| ''(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).
+
| Deprecated; use the music fields in [[#Custom locations|<samp>Data/Locations</samp>]] instead. This property is only applied if the location has no music in <samp>Data/Locations</samp>. This was removed from all vanilla maps.
|}
+
|-
 
+
| <samp>NPCWarp</samp><br /><samp>Warp</samp>
====Advanced====
+
| Now fault-tolerant. They'll automatically ignore extra spaces, log an informative warning if parsing still fails, and continue with the next warp if possible.
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>Stumps</samp>
! purpose
+
| Now works in all locations.
 
|-
 
|-
| <samp>CustomFields</samp>
+
| <samp>UniquePortrait</samp><br /><samp>UniqueSprite</samp>
| ''(Optional)'' The [[#Custom data fields|custom fields]] for this entry.  
+
| Deprecated; use [[#Custom NPC appearance|custom NPC appearances]] instead. These properties will override NPC appearances. This was removed from all vanilla maps.
 
|}
 
|}
   −
===Custom pants===
+
===Tile property changes===
You can now create/edit [[Tailoring#Pants|pants]] by editing the new <samp>Data/Pants</samp> asset, which replaces <samp>Data/clothingInformation</samp>. This consists of a string → model lookup, where...
+
{{/doc status|[[Modding:Maps#Known tile properties]]|done=true}}
* The key is the unqualified [[#Custom items|item ID]].
  −
* The value is a model with the fields listed below.
     −
====Basic pants data====
+
<ul>
 +
<li>You can now override a tile index property by setting it as a tile property.</li>
 +
<li>Added new [[Modding:Maps|tile properties]]:
 
{| class="wikitable"
 
{| class="wikitable"
 +
! layer
 +
! property
 +
! explanation
 
|-
 
|-
! field
+
| <samp>Paths</samp>
! purpose
+
| <samp>SpawnTree {{t|category}} {{t|ID}} {{t|Growth stage}} {{t|Regrowth stage}}</samp>
|-
+
| Spawns a tree when the map is created. {{t|category}} may be either <samp>wild</samp> or <samp>fruit</samp>. <samp>wild</samp> will spawn a [[Trees|wild tree]], while <samp>fruit</samp> will spawn a [[Fruit Trees|fruit tree]].  
| <samp>Name</samp>
  −
| ''(Optional)'' The internal name for the item. Default <samp>Pants</samp>.
  −
|-
  −
| <samp>DisplayName</samp><br /><samp>Description</samp>
  −
| ''(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'').
  −
|-
  −
| <samp>Price</samp>
  −
| ''(Optional)'' The default price when the item is sold to the player in a shop. Default 50.
   
|}
 
|}
 
+
</li>
====Appearance====
+
<li>Added new <samp>Action</samp> [[Modding:Maps|tile properties]]:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! field
+
! layer
! purpose
+
! property
 +
! explanation
 
|-
 
|-
| <samp>Texture</samp>
+
| <samp>Buildings</samp>
| The asset name for the texture containing the pants' sprite. Defaults to <samp>Characters/Farmer/pants</samp>.
+
| <samp>Action BuildingSilo</samp>
 +
| If a building covers this tile, enables [[silo]] interactions on this tile subject to the building's <samp>HayCapacity</samp> field in <samp>Data/Buildings</samp>.
 
|-
 
|-
| <samp>SpriteIndex</samp>
+
| <samp>Buildings</samp>
| The pants' sprite index within the <samp>Texture</samp>, where 0 is the top-left set.
+
| <samp>Action BuildingToggleAnimalDoor</samp>
 +
| If a building covers this tile, opens or closes its animal door.
 
|-
 
|-
| <samp>DefaultColor</samp>
+
| <samp>Buildings</samp>
| ''(Optional)'' The dye color to apply to the sprite when the player hasn't [[dyeing|dyed]] it yet, if any. See [[#Color fields|color format]]. Default <samp>255 235 203</samp> (which matches the color of the cloth item).
+
| <samp>Action Dialogue</samp>
 +
| &#32;
 +
* The message can now be a [[Modding:Tokenizable strings|tokenizable string]].
 +
* Fixed the cursor not changing to the inspection icon when hovering on an <samp>Action Dialogue</samp> tile.
 
|-
 
|-
| <samp>CanBeDyed</samp>
+
| <samp>Buildings</samp>
| ''(Optional)'' Whether the player can [[dyeing|dye]] these pants. Default false.
+
| <samp>Action Forge</samp>
 +
| Opens the [[Forge]] menu.
 
|-
 
|-
| <samp>IsPrismatic</samp>
+
| <samp>Buildings</samp>
| ''(Optional)'' Whether the pants continuously shift colors. This overrides <samp>DefaultColor</samp> and <samp>CanBeDyed</samp> if set. Default false.
+
| <samp>Action None</samp>
|}
+
| Does nothing. This is used to mark the tile interactive if the click will be handled separately.
 
  −
====Other====
  −
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>Buildings</samp>
! purpose
+
| <samp>Action ObeliskWarp {{t|location name}} {{t|x}} {{t|y}} {{o|whether to dismount}}</samp>
 +
| Warps the player to the specified location name and position with the [[Warp Totem|Obelisk]] animation/sound effects.
 
|-
 
|-
| <samp>CanChooseDuringCharacterCustomization</samp>
+
| <samp>Buildings</samp>
| ''(Optional)'' Whether these pants can be selected on the character customization screen (e.g. when creating a character). Default false.
+
| <samp>Action OpenShop {{t|shop id}} {{o|from direction}} {{o|open time}} {{o|close time}} {{o|owner tile area}}</samp>
 +
| Open the [[#Custom shops|shop]] with the given {{t|shop id}}. All arguments besides the ID are optional:
 +
* {{o|from direction}}: if specified, the player must be standing in this direction relative to the shop (one of <samp>down</samp>, <samp>up</samp>, <samp>left</samp>, <samp>right</samp>, or <samp>none</samp>). Setting this to <samp>none</samp> disables the requirement. The default for most vanilla shops is <samp>down</samp>.
 +
* {{o|open time}} and {{o|close time}}: the start & end times in 26-hour format when the shop is available. Interacting with the tile outside those times does nothing.
 +
* {{o|owner tile area}}: if specified, the tile area which must contain one of the shop owners for the shop to be available. For a custom shop, these are defined by its <samp>Owners</samp> field. This can be specified in two forms: <samp>{{t|x}} {{t|y}}</samp> for a single tile, or <samp>{{t|x}} {{t|y}} {{t|width}} {{t|height}}</samp> for a multi-tile area.
 
|-
 
|-
| <samp>CustomFields</samp>
+
| <samp>Buildings</samp>
| The [[#Custom data fields|custom fields]] for this entry.
+
| <samp>Action PlayEvent {{t|event id}} {{o|check preconditions}} {{o|skip if seen}} {{o|fallback action}}</samp>
|}
+
| Immediately start an [[Modding:Event data|event]], subject to the conditions:
 +
* {{o|check preconditions}}: whether to ignore the action if the [[Modding:Event data#Event preconditions|event's preconditions]] don't match (one of <samp>true</samp> or <samp>false</samp>). Default true.
 +
* {{o|skip if seen}}: whether to ignore the action if the player has already seen the given event. Default true.
   −
===Custom shirts===
+
If the event doesn't start for any reason (including the preceding conditions):
You can now create/edit [[Tailoring#Shirts|shirts]] by editing the new <samp>Data/Shirts</samp> asset, which replaces <samp>Data/clothingInformation</samp>. This consists of a string → model lookup, where...
+
* If {{o|fallback action}} is specified, it'll be run as an action. This can be any <samp>Action</samp> tile property (without the "Action " prefix), like <code>Action PlayEvent 60367 true true PlayEvent 520702 false false</code> to play a different event.
* The key is the unqualified [[#Custom items|item ID]].
+
* Otherwise the action is silently ignored.
* The value is a model with the fields listed below.
     −
====Basic shirt data====
+
For example, <code>Action PlayEvent 60367 false false</code> will replay the bus arrival event from the start of the game.
 +
|}
 +
</li>
 +
<li>Added new <samp>TouchAction</samp> [[Modding:Maps|tile properties]]:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! field
+
! layer
! purpose
+
! property
 +
! explanation
 
|-
 
|-
| <samp>Name</samp>
+
| <samp>Back</samp>
| ''(Optional)'' The internal name for the item. Default <samp>Shirt</samp>.
+
| <samp>TouchAction PlayEvent {{t|event id}} {{o|check preconditions}} {{o|skip if seen}} {{o|fallback action}}</samp>
|-
+
| Equivalent to <samp>Action PlayEvent</samp>, but activated on touch. Note that {{o|fallback action}} is an <samp>Action</samp> tile property, ''not'' a <samp>TouchAction</samp> tile property.
| <samp>DisplayName</samp><br /><samp>Description</samp>
+
|}</li>
| ''(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'').
+
<li>Changed existing tile properties:
|-
  −
| <samp>Price</samp>
  −
| ''(Optional)'' The default price when the item is sold to the player in a shop. Default 50.
  −
|}
  −
 
  −
====Appearance====
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! field
+
! layer
! purpose
+
! property
 +
! reason
 
|-
 
|-
| <samp>Texture</samp>
+
|rowspan="4"| <samp>Back</samp>
| The asset name for the texture containing the shirt's sprite. Defaults to <samp>Characters/Farmer/shirts</samp>.
+
| <samp>NoSpawn</samp>
 +
| Added <samp>NoSpawn false</samp> form, which disables any previous <samp>NoSpawn</samp> property on the tile. For example, this can be used to enable spawning on a tile which has a <samp>NoSpawn</samp> tile index property.
 
|-
 
|-
| <samp>SpriteIndex</samp>
+
| <samp>TouchAction Bus</samp>
| The shirt's sprite index within the <samp>Texture</samp>, where 0 is the top-left set.
+
| Removed. This wasn't used by the game or mods.
 
|-
 
|-
| <samp>DefaultColor</samp>
+
| <samp>TouchAction Emote</samp>
| ''(Optional)'' The dye color to apply to the sprite when the player hasn't [[dyeing|dyed]] it yet, if any. See [[#Color fields|color format]]. Default none.
+
| Fixed error if the specified NPC isn't found.
 
|-
 
|-
| <samp>CanBeDyed</samp>
+
| <samp>Treasure</samp>
| ''(Optional)'' Whether the player can [[dyeing|dye]] this shirt. Default false.
+
| Added <samp>Treasure Item {{t|item ID}}</samp> form which accepts a [[#Custom items|qualified or unqualified item ID]].
 
|-
 
|-
| <samp>IsPrismatic</samp>
+
|rowspan="2"| <samp>Buildings</samp>
| ''(Optional)'' Whether the shirt continuously shifts colors. This overrides <samp>DefaultColor</samp> and <samp>CanBeDyed</samp> if set. Default false.
+
| <samp>Action ItemChest</samp><br /><samp>Action Minecart</samp><br /><samp>Action RemoveChest</samp>
 +
| Removed. These weren't used by the game or mods.
 
|-
 
|-
| <samp>HasSleeves</samp>
+
| <samp>Action Kitchen</samp>
| ''(Optional)'' Whether to draw shirt sleeves. Default true.
+
| Now works in any location (including those without a fridge).
 
|}
 
|}
 +
</li>
 +
</ul>
   −
====Other====
+
===Other location/map changes===
 +
{{/doc status|[[Modding:Maps]] and other pages as needed|done=false}}
 +
 
 +
* Farm data:
 +
** Added <samp>SpawnMonstersByDefault</samp> field to <samp>Data/AdditionalFarms</samp> to set the default value of the 'spawn monsters at night' [[Options#Advanced Game Options|advanced save option]].
 +
** Fixed crash on new-save screen if the farm type's tooltip has no description.
 +
* General location data:
 +
** All locations can now have animals. The <samp>IAnimalLocation</samp> is now obsolete and implemented by <samp>GameLocation</samp>.
 +
** Added new [[Modding:Fish data|fishing areas]] to simplify compatibility between fish & map mods (specifically for hilltop farm, wilderness farm, town, and desert).
 +
** Added a descriptive error when a required location or layer isn't found. Mods can use <samp>map.RequireLayer</samp> and <samp>Game1.RequireLocation</samp> to get a location with similar error-checking.
 +
** Added <samp>WarpPathfindingCache</samp> for C# mods, which modularizes the NPC warp route logic. You can edit its <samp>IgnoreLocationNames</samp>, <samp>OverrideTargetNames</samp>, and <samp>GenderRestrictions</samp> fields if needed for custom locations.
 +
** Game logic which checks tile indexes is now more fault-tolerant, so it won't crash if an expected tile was edited.
 +
** Finished migrating <samp>DecoratableLocation</samp> flooring/wallpaper areas to string IDs (started in Stardew Valley 1.5.5).
 +
* General map changes:
 +
** Added validation for [[Modding:Maps|map properties and tile properties]]. If the format is invalid, the game will now log a detailed error and skip it.
 +
** Removed unused [[Modding:Maps#Paths layer|path tiles]] in <samp>Maps/paths</samp> and all map files.
 +
* Location context data:
 +
** Building interiors now inherit their parent's location context by default.
 +
** Added <samp>Game1.locationContextData</samp> to cache the data from <samp>Data/LocationContexts</samp>.
 +
** Added constants for the vanilla context IDs like <samp>LocationContexts.IslandId</samp>.
 +
** Added validation for required location context IDs (and <samp>LocationContexts.Require(id)</samp> for mod logic).
 +
** Removed the <samp>Name</samp> field in <samp>Data/LocationContexts</samp>, which duplicated the ID.
 +
<ul>
 +
<li>Added methods to simplify common operations:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! field
+
! type
! purpose
+
! method
 +
! effect
 
|-
 
|-
| <samp>CanChooseDuringCharacterCustomization</samp>
+
|rowspan="7"| <samp>Building</samp>
| ''(Optional)'' Whether this shirt can be selected on the character customization screen (e.g. when creating a character). Default false.
+
| <samp>GetParentLocation</samp>
 +
| Get the location which contains this building.
 
|-
 
|-
| <samp>CustomFields</samp>
+
| <samp>IsInCurrentLocation</samp>
| The [[#Custom data fields|custom fields]] for this entry.
+
| Get whether the building is in the same location as the current player.
|}
  −
 
  −
===Custom tools===
  −
You can now create/edit [[tools]] by editing the new <samp>Data/Tools</samp> asset. This consists of a string → model lookup, where...
  −
* The key is the unqualified [[#Custom items|item ID]].
  −
* The value is a model with the fields listed below.
  −
 
  −
====Basic tool data====
  −
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>HasIndoors</samp>
! purpose
+
| Get whether the building has an interior location.
 
|-
 
|-
| <samp>ClassName</samp>
+
| <samp>GetIndoors</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.
+
| Get the location within this building, if applicable.
 
  −
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>
+
| <samp>HasIndoorsName</samp>
| The internal name to set for the tool item.
+
| Get whether the building has an interior location and its unique name matches the given value (like <code>building.HasIndoorsName("FarmHouse")</code>).
 
|-
 
|-
| <samp>DisplayName</samp><br /><samp>Description</samp>
+
| <samp>GetIndoorsName</samp>
| A [[Modding:Tokenizable strings|tokenizable string]] for the tool's in-game display name and description.
+
| Get the unique name of the location within this building, if applicable.
 
|-
 
|-
| <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.
+
| ''see also [[#Other building changes|other building changes]] for non-location methods.''
 
|-
 
|-
| <samp>SalePrice</samp>
+
|rowspan="7"|<samp>Cabin</samp><br /><samp>FarmHouse</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>GetCellar</samp>
 +
| Get the [[cellar]] location linked to this cabin, if any.
 
|-
 
|-
| <samp>CustomFields</samp>
+
| <samp>CanAssignFarmhand</samp><br /><samp>AssignFarmhand</samp>
| The [[#Custom data fields|custom fields]] for this entry.
+
| ''(Cabin only)'' Check whether the cabin is available to assign to a farmhand, or perform the assignment.
|}
+
|-
 
+
| <samp>HasOwner</samp>
====Appearance====
+
| Get whether the home has an assigned player, regardless of whether they've finished creating their character.
Note that drawing the tool correctly in the world (ie, while the player is trying to use it) probably still needs custom code.
  −
 
  −
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>OwnerId</samp>
! purpose
+
| Get the unique ID of the player who owns this home, if any.
 
|-
 
|-
| <samp>Texture</samp>
+
| <samp>IsOwnedByCurrentPlayer</samp>
| The asset name for the texture containing the tool's sprite.
+
| Get whether the cabin belongs to the current player.
 
|-
 
|-
| <samp>SpriteIndex</samp>
+
| <samp>IsOwnerActivated</samp>
| The tool's sprite index within the <samp>Texture</samp>, where 0 is the top row.
+
| Get whether the home has an assigned player and they've finished creating their character.
 
|-
 
|-
| <samp>MenuSpriteIndex</samp>
+
| <samp>HasNpcSpouse</samp>
| ''(Optional)'' The sprite index within the <samp>Texture</samp> for the item icon. Defaults to <samp>SpriteIndex</samp>.
+
| Get whether the player who owns this home is married to any NPC (when used like <samp>HasNpcSpouse()</samp>) or a specific NPC (like <samp>HasNpcSpouse(name)</samp>). This also replaces <samp>shouldShowSpouseRoom()</samp>.
|}
  −
 
  −
====Upgrades====
  −
{| class="wikitable"
   
|-
 
|-
! field
+
|rowspan="2"| <samp>Farm</samp>
! purpose
+
| <samp>GetStarterFarmhouseLocation</samp>
 +
| Get the default tile position for the farmhouse. (See also <samp>farm.GetMainFarmHouseEntry()</samp>.)
 
|-
 
|-
| <samp>UpgradeLevel</samp>
+
| <samp>GetStarterPetBowlLocation</samp>
| ''(Optional)'' The tool upgrade level. Default <samp>-1</samp>, which keeps the default value set by the tool class.
+
| Get the default tile position for the pet bowl.
 
|-
 
|-
| <samp>ApplyUpgradeLevelToDisplayName</samp>
+
|rowspan="19"| <samp>GameLocation</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.
+
| <samp>AddDefaultBuildings</samp>
 +
| Can be overridden to add custom buildings when the location is created and/or loaded. These can either be re-added whenever they're missing (like the vanilla farmhouse), or only built once on save creation (like the vanilla pre-built cabins).
   −
The display name format in English is:
+
This replaces the former <samp>farm.AddModularShippingBin()</samp> method.
{| class="wikitable"
   
|-
 
|-
! upgrade level
+
| <samp>GetFridge</samp><br /><samp>GetFridgePosition</samp>
! display name format
+
| Get the fridge's chest or tile position, if the location has one.
 
|-
 
|-
| 1
+
| <samp>GetSeason</samp><br /><samp>GetSeasonIndex</samp><br /><samp>GetSeasonKey</samp>
| Copper {{t|display name}}
+
| Get the local season that applies within the location as an enum, number (like <samp>0</samp> for spring), or string (like <samp>spring</samp>) respectively. For example, it's always summer on [[Ginger Island]].
 
|-
 
|-
| 2
+
| <samp>GetWeather</samp><br /><samp>IsDebrisWeatherHere</samp><br /><samp>IsLightningHere</samp><br /><samp>IsRainingHere</samp><br /><samp>IsSnowingHere</samp>
| Steel {{t|display name}}
+
| Get the current weather in this location's context, regardless of whether the player is indoors and sheltered from it.
 
|-
 
|-
| 3
+
| <samp>InDesertContext</samp><br /><samp>InIslandContext</samp><br /><samp>InValleyContext</samp>
| Gold {{t|display name}}
+
| Get whether this location is within the <samp>Island</samp> or <samp>Default</samp> location context respectively.
 
|-
 
|-
| 4
+
| <samp>IsActiveLocation</samp>
| Iridium {{t|display name}}
+
| Get whether this location is actively synced to the current player (see [[Modding:Modder Guide/Game Fundamentals#Farmhand shadow world|farmhand shadow world]]).
|}
   
|-
 
|-
| <samp>ConventionalUpgradeFrom</samp>
+
| <samp>IsTemporary</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):
+
| Get whether this is a temporary location for a festival or minigame. This is cached based on the location name (e.g. locations starting with <samp>Temp</samp> or some other specific names).
 
  −
{| class="wikitable"
   
|-
 
|-
! upgrade level
+
| <samp>GetLocationContextId</samp>
! price
+
| Get the ID of the location context in <samp>Data/LocationContexts</samp> which contains this building.
! items needed
   
|-
 
|-
| 1
+
| <samp>GetContainingBuilding</samp>
| {{price|2000}}
+
| Get the building instance which contains this location (like the cabin for a cabin interior), if applicable.
| {{name|Copper Bar|5}}
   
|-
 
|-
| 2
+
| <samp>GetParentLocation</samp>
| {{price|5000}}
+
| Get the parent location which contains this one (like the farm for a cabin interior), or <samp>null</samp> if it has no parent.
| {{name|Iron Bar|5}}
   
|-
 
|-
| 3
+
| <samp>GetRootLocation</samp>
| {{price|10000}}
+
| Get the parent location which contains this one (like the farm for a cabin interior), or the location itself if it has no parent.
| {{name|Gold Bar|5}}
+
|-
 +
| <samp>GetInstancedBuildingInteriors</samp>
 +
| Get all building interiors within this location which are instanced to the building (i.e. not in <samp>Game1.locations</samp> separately).
 
|-
 
|-
| 4
+
| <samp>GetMapPropertySplitBySpaces</samp><br /><samp>GetTilePropertySplitBySpaces</samp>
| {{price|25000}}
+
| Get the value of a map/tile property and split it into individual words. If the map/tile property isn't defined, returns an empty array.
| {{name|Iridium Bar|5}}
  −
|}
     −
For example, Iridium Axe specifies this value:
+
For example:
<syntaxhighlight lang="js">
+
<syntaxhighlight lang="c#">
"ConventionalUpgradeFrom": "(T)GoldAxe"
+
string[] fields = Game1.currentLocation.GetMapPropertySplitBySpaces("ScreenshotRegion");
 
</syntaxhighlight>
 
</syntaxhighlight>
 
|-
 
|-
| <samp>UpgradeFrom</samp>
+
| <samp>HasMapPropertyWithValue</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.
+
| Get whether a map property is defined and has a non-empty value.
   −
This consists of a list of models with these fields:
+
For example:
{| class="wikitable"
+
<syntaxhighlight lang="c#">
 +
bool canUseCasks = Game1.currentLocation.HasMapPropertyWithValue("CanCaskHere");
 +
</syntaxhighlight>
 
|-
 
|-
! field
+
| <samp>StoreHayInAnySilo</samp>
! purpose
+
| Add hay to any silo with free space (preferring silos in the current location, then the farm, then anywhere).
 
|-
 
|-
| <samp>Price</samp>
+
| <samp>TryGetMapProperty</samp>
| ''(Optional)'' The gold price to buy the upgrade. Defaults to 0.
+
| Get a map property value as a string, if it's defined.
|-
  −
| <samp>RequireToolId</samp>
  −
| ''(Optional)'' If set, the [[#Custom items|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 [[#Custom items|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:
+
For example:
<syntaxhighlight lang="js">
+
<syntaxhighlight lang="c#">
"UpgradeFrom": [
+
if (this.TryGetMapProperty("Warps", out string warps))
    {
+
{
        "RequireToolId": "(T)CopperAxe",
+
    // ...
        "Price": 5000,
+
}
        "TradeItemId": "(O)335", // Iron Bar
+
</syntaxhighlight>
        "TradeItemAmount": 5
+
|-
    }
+
| <samp>TryGetMapPropertyAs</samp>
]
+
| Get a map property and parse it into into a <samp>bool</samp>, <samp>double</samp>, <samp>Point</samp>, <samp>Rectangle</samp>, or <samp>Vector2</samp> value.
</syntaxhighlight>
     −
If you want the tool to always be available, you can just omit the conditions. For example:
+
For example:
<syntaxhighlight lang="js">
+
<syntaxhighlight lang="c#">
"UpgradeFrom": [
+
if (!this.TryGetMapPropertyAs("MailboxLocation", out Point position))
    {
+
{
        "Price": 5000
+
    position = new Point(68, 16); // default value
    }
+
}
]
   
</syntaxhighlight>
 
</syntaxhighlight>
  −
Note that Clint needs a few days to smith the new tool. If you want to sell the tool directly, [[#Custom shops|add it to a regular shop]] instead.
  −
|}
  −
  −
====Game logic====
  −
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>removeObjectsAndSpawned</samp>
! purpose
+
| Remove all objects, bushes, resource clumps, and terrain features within a tile area.
 +
|-
 +
| <samp>OnBuildingConstructed</samp><br /><samp>OnBuildingMoved</samp><br /><samp>OnBuildingDemolished</samp>
 +
| These methods are called for all players when any player constructs, moves, or demolishes a building.
 +
|-
 +
|rowspan="3"| <samp>LibraryMuseum</samp>
 +
| <samp>HasDonatedArtifacts()</samp>
 +
| Get whether any items have been donated to the [[museum]].
 
|-
 
|-
| <samp>CanBeLostOnDeath</samp>
+
| <samp>HasDonatedArtifactAt(tile)</samp>
| Whether the player can [[Adventurer's Guild#Item Recovery Service|lose this tool when they die]]. Default false.
+
| Get whether any donated item is currently placed at the given tile position within the [[museum]].
|}
  −
 
  −
====Extensibility====
  −
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>HasDonatedArtifact(itemId)</samp>
! purpose
+
| Get whether an artifact with the given qualified or unqualified item ID has been donated to the [[museum]].
 
|-
 
|-
| <samp>ModData</samp>
+
|rowspan="2"| <samp>MineShaft</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:
+
| <samp>GetLevelName</samp>
<syntaxhighlight lang="js">
+
| Get the location name for a generated [[The Mines|mine]] or [[Skull Cavern]] level.
"ModData": {
+
 
    "PowerLevel": 9000
+
For example:
}
+
<syntaxhighlight lang="c#">
 +
string locationName = MineShaft.GetLevelName(10); // returns "UndergroundMine10"
 +
Game1.warpFarmer(locationName, 0, 0, false);
 
</syntaxhighlight>
 
</syntaxhighlight>
 
|-
 
|-
| <samp>SetProperties</samp>
+
| <samp>IsGeneratedLevel</samp>
| ''(Optional)'' Set the value of arbitrary properties on the tool class. For example, this would disable the tool animation and require no stamina:
+
| Get whether a location or location name is a generated [[The Mines|mine]] or [[Skull Cavern]] level.
<syntaxhighlight lang="js">
  −
"SetProperties": {
  −
    "InstantUse": true,
  −
    "IsEfficient": true
  −
}
  −
</syntaxhighlight>
  −
|}
     −
===Custom wild trees===
+
For example:
====Data format====
+
<syntaxhighlight lang="c#">
You can now create/edit [[Trees|wild trees]] by editing the <samp>Data/WildTrees</samp> asset.
+
string locationName = "UndergroundMine10";
 +
bool isMine = MineShaft.IsGeneratedLevel(locationName, out int level); // returns true, 10
 +
</syntaxhighlight>
 +
|-
 +
| <samp>VolcanoDungeon</samp>
 +
| <samp>GetLevelName</samp><br /><samp>IsGeneratedLevel</samp>
 +
| Equivalent to the matching <samp>MineShaft</samp> methods, but for the [[Volcano Dungeon]].
 +
|}
 +
</li>
 +
</ul>
 +
* Added map/tile property <samp>TryAdd</samp>/<samp>TryGetValue</samp> extensions in <samp>StardewValley.Extensions</samp> for string property values. For example, this lets you do <samp>map.Properties.TryGetValue(key, out string value)</samp>.
 +
* <samp>MineShaft.tryToAddMonster</samp> now returns whether a monster was added.
 +
* <samp>Game1.GetNumberBuildingsConstructed</samp> and <samp>location.getNumberBuildingsConstructed</samp> now have overloads to count all building types and/or specify whether to count under-construction buildings.
 +
* Fixed <samp>location.refurbishMapPortion</samp> copying <samp>Back</samp> source properties to the <samp>Building</samp> target layer.
 +
* Fixed door warps in custom indoor locations not consistently detected by the game.
 +
 
 +
==What's new for buildings==
 +
===Custom buildings===
 +
{{/doc status|[[Modding:Blueprint data]]|done=false}}
   −
This consists of a string → model lookup, where...
+
You can now add custom buildings by editing the <samp>Data/Buildings</samp> asset. This consists of a string → model lookup, where...
* The asset key is a [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for the tree type. The vanilla tree IDs are <samp>1</samp> (oak), <samp>2</samp> (maple), <samp>3</samp> (pine), <samp>6</samp> (palm), <samp>7</samp> (mushroom), and <samp>8</samp> (mahogany).
+
* The key is a [[Modding:Common data field types#Unique string ID|unique string ID]] for the building type.
* The asset value is a model with thee fields listed below.
+
* The value is a model with the fields listed below.
    +
====Required fields====
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 2,242: Line 2,011:  
! effect
 
! effect
 
|-
 
|-
| <samp>Textures</samp>
+
| <samp>Name</samp><br /><samp>Description</samp>
| The texture to use as the tree's spritesheet in-game. If multiple textures are listed, the first matching one is used.
+
| A [[Modding:Tokenizable strings|tokenizable string]] for the display name and description (e.g. shown in the construction menu).
 +
|-
 +
| <samp>Texture</samp>
 +
| The asset name for the texture under the game's Content folder.
 +
|}
   −
This consists of a list of models with these fields:
+
====Construction====
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 2,251: Line 2,024:  
! effect
 
! effect
 
|-
 
|-
| <samp>Texture</samp>
+
| <samp>Builder</samp>
| The asset name for the tree's spritesheet.
+
| ''(Optional)'' The NPC from whom you can request construction. The vanilla values are [[Carpenter's Shop|<samp>Robin</samp>]] and [[Wizard's Tower#Buildings|<samp>Wizard</samp>]], but you can specify a different name if a C# mod opens a construction menu for them. Defaults to <samp>Robin</samp>. If omitted, it won't appear in any menu.
 
|-
 
|-
| <samp>Season</samp>
+
| <samp>BuildCost</samp>
| ''(Optional)'' If set, the specific season when this texture should apply. For more complex conditions, see <samp>Condition</samp>.
+
| ''(Optional)'' The gold cost to construct the building. Defaults to {{price|0}}.
 
|-
 
|-
| <samp>Condition</samp>
+
| <samp>BuildMaterials</samp>
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether this texture should be applied for a tree. Defaults to always enabled.
+
| ''(Optional)'' The materials you must provide to start construction, as a list of models with these fields:
 
+
{| class="wikitable"
This is checked when the tree is created, a new day starts, or its texture is reloaded by a mod. More frequent conditions (like time of day) won't work as expected unless a mod manually triggers a tree update.
  −
|}
   
|-
 
|-
| <samp>SeedItemId</samp>
+
! field
| ''(Optional)'' The [[#Custom items|qualified item ID]] for the seed item. If omitted, the tree can't be planted and <samp>SeedChance</samp> will be ignored.
+
! effect
 
|-
 
|-
| <samp>SeedPlantable</samp>
+
| <samp>Id</samp>
| ''(Optional)'' Whether the seed can be planted by the player. If this is false, it can only be spawned automatically via map properties. Default true.
+
| ''(Optional)'' The [[Modding:Common data field types#Unique string ID|unique string ID]] for this entry within the current list. Defaults to the <samp>ItemId</samp> if not specified.
 
|-
 
|-
| <samp>GrowthChance</samp>
+
| <samp>ItemId</samp>
| ''(Optional)'' The probability each day that the tree will grow to the next stage without [[Tree Fertilizer|tree fertilizer]], as a value from 0 (will never grow) to 1 (will grow every day). Defaults to 0.2 (20% chance).
+
| The required item ID (qualified or unqualified).
 
|-
 
|-
| <samp>FertilizedGrowthChance</samp>
+
| <samp>Amount</samp>
| ''(Optional)'' Equivalent to <samp>GrowthChance</samp>, but with [[Tree Fertilizer|tree fertilizer]]. Defaults to 1 (100% chance).
+
| The number of the item required.
 +
|}
 
|-
 
|-
| <samp>SeedChance</samp>
+
| <samp>BuildDays</samp>
| ''(Optional)'' The probability each day that the tree will produce a seed that will drop when the tree is shaken, as a value from 0 (never) to 1 (always). Default 0.05 (5% chance).
+
| ''(Optional)'' The number of days needed to complete construction (e.g. <samp>1</samp> for a building completed the next day). If set to 0, construction finishes instantly. Defaults to 0.
 
|-
 
|-
| <samp>SeedOnChopChance</samp>
+
| <samp>BuildCondition</samp>
| ''(Optional)'' The probability that a seed will drop when the player chops down the tree, as a value from 0 (never) to 1 (always). Default 0.75 (75% chance).
+
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether the building should be available in the construction menu. Defaults to always available.
 
|-
 
|-
| <samp>DropWoodOnChop</samp>
+
| <samp>BuildMenuDrawOffset</samp>
| ''(Optional)'' Whether to drop [[wood]] when the player chops down the tree. Default true.
+
| ''(Optional)'' A pixel offset to apply to the building sprite when drawn in the construction menu. Default none.
 
|-
 
|-
| <samp>DropHardwoodOnLumberChop</samp>
+
| <samp>AdditionalPlacementTiles</samp>
| ''(Optional)'' Whether to drop [[hardwood]] when the player chops down the tree, if they have the [[Skills#Foraging|Lumberjack profession]]. Default true.
+
| ''(Optional)'' The extra tiles to treat as part of the building when placing it through the construction menu. For example, the farmhouse uses this to make sure the stairs are clear. This consists of a list of models with these fields:
 +
{| class="wikitable"
 
|-
 
|-
| <samp>IsLeafy</samp>
+
! field
| ''(Optional)'' Whether shaking or chopping the tree causes cosmetic leaves to drop from tree and produces a leaf rustle sound. When a leaf drops, the game will use one of the four leaf sprites in the tree's spritesheet in the slot left of the stump sprite. Default true.
+
! effect
 
|-
 
|-
| <samp>IsLeafyInWinter</samp>
+
| <samp>TileArea</samp>
| ''(Optional)'' Whether <samp>IsLeafy</samp> also applies in winter. Default false.
+
| The tile area relative to the top-left corner of the building, specified as an object with <samp>X</samp>, <samp>Y</samp>, <samp>Width</samp>, and <samp>Height</samp> fields.
 
|-
 
|-
| <samp>GrowsInWinter</samp>
+
| <samp>OnlyNeedsToBePassable</samp>
| ''(Optional)'' Whether the tree can grow in winter (subject to <samp>GrowthChance</samp> or <samp>FertilizedGrowthChance</samp>). Default false.
+
| ''(Optional)'' Whether this area allows tiles that would normally not be buildable, so long as they are passable. For example, this is used to ensure that an entrance is accessible. Default false.
 +
|}
 
|-
 
|-
| <samp>IsStumpDuringWinter</samp>
+
| <samp>IndoorItems</samp>
| ''(Optional)'' Whether the tree is reduced to a stump in winter and regrows in spring, like the vanilla [[Trees#Mushroom Tree|mushroom tree]]. Default false.
+
| ''(Optional)'' The items to place in the building interior when it's constructed or upgraded. This consists of a list of models with these fields:
|-
  −
| <samp>AllowWoodpeckers</samp>
  −
| ''(Optional)'' Whether woodpeckers can spawn on the tree. Default true.
  −
|-
  −
| <samp>UseAlternateSpriteWhenNotShaken</samp><br /><samp>UseAlternateSpriteWhenSeedReady</samp>
  −
| ''(Optional)'' Whether to render a different tree sprite when the player hasn't shaken it on that day (<samp>UseAlternateSpriteWhenNotShaken</samp>) or it has a seed ready (<samp>UseAlternateSpriteWhenSeedReady</samp>). If either field is true, the tree spritesheet must be double-width with the alternate textures on the right. If both are true, the same alternate sprites are used for both. Default false.
  −
|-
  −
| <samp>DebrisColor</samp>
  −
| ''(Optional)'' The color of the cosmetic wood chips when chopping the tree. This can be...
  −
* a [[#Color fields|standard color format]];
  −
* or one of <samp>12</samp> (brown/woody), <samp>100001</samp> (white), <samp>100001</samp> (light green),  <samp>100002</samp> (light blue), <samp>100003</samp> (red), <samp>100004</samp> (yellow), <samp>100005</samp> (black), <samp>100006</samp> (gray), or <samp>100007</samp> (charcoal / dim gray).
  −
 
  −
Defaults to <samp>12</samp> (brown/woody).
  −
|-
  −
| <samp>SeedDropItems</samp>
  −
| ''(Optional)'' When a seed is dropped subject to <samp>SeedChance</samp>, the item to drop instead of the item specified by <samp>SeedItemId</samp>. If this is empty or none match, the <samp>SeedItemId</samp> will be dropped instead.
  −
 
  −
This consists of a list of models with these fields:
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 2,321: Line 2,077:  
! effect
 
! effect
 
|-
 
|-
| ''common fields''
+
| <samp>Id</samp>
| See [[Modding:Item queries#Item spawn fields|item spawn fields]] for the generic item fields supported for chop drops.
+
| The [[Modding:Common data field types#Unique string ID|unique string ID]] for this entry within the current list.
 
  −
If set to an [[Modding:Item queries|item query]] which returns multiple items, one of them will be selected at random.
   
|-
 
|-
| <samp>Season</samp>
+
| <samp>ItemId</samp>
| ''(Optional)'' If set, the item only applies if the tree's location is in this season.
+
| The [[#Custom items|qualified item ID]] for the item to place.
 
|-
 
|-
| <samp>Chance</samp>
+
| <samp>Tile</samp>
| ''(Optional)'' The probability that the item will drop, as a value between 0 (never drops) and 1 (always drops). Default 1 (100% chance).
+
| The tile position at which to place the item, specified as an object with <samp>X</samp> and <samp>Y</samp> fields.
 
|-
 
|-
| <samp>ContinueOnDrop</samp>
+
| <samp>Indestructible</samp>
| ''(Optional)'' If this item is dropped, whether to continue as if it hadn't been dropped for the remaining drop candidates. Default false.
+
| ''(Optional)'' Whether to prevent the player from destroying, picking up, or moving the item. Default false.
 
|}
 
|}
 
|-
 
|-
| <samp>ChopItems</samp>
+
| <samp>MagicalConstruction</samp>
| ''(Optional)'' The additional items to drop when the tree is chopped down. All matching items are dropped.
+
| ''(Optional)'' Whether the building is magical. This changes the carpenter menu to a mystic theme while this building's blueprint is selected, and completes the construction instantly when placed.
 +
|-
 +
| <samp>AddMailOnBuild</samp>
 +
| ''(Optional)'' A list of [[Modding:Mail data|letter IDs]] to send to all players when the building is constructed for the first time.
 +
|}
   −
This consists of a list of models with these fields:
+
====Upgrades====
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 2,345: Line 2,103:  
! effect
 
! effect
 
|-
 
|-
| ''common fields''
+
| <samp>BuildingToUpgrade</samp>
| See [[Modding:Item queries#Item spawn fields|item spawn fields]] for the generic item fields supported for chop drops.
+
| ''(Optional)'' The ID of the building for which this is an upgrade, or omit to allow constructing it as a new building. For example, the [[Coop|Big Coop]] sets this to <samp>"Coop"</samp>. Any numbers of buildings can be an upgrade for the same building, in which case the player can choose one upgrade path.
 
  −
If set to an [[Modding:Item queries|item query]] which returns multiple items, one of them will be selected at random.
   
|-
 
|-
| <samp>Season</samp>
+
| <samp>IndoorItemMoves</samp>
| ''(Optional)'' If set, the item only applies if the tree's location is in this season.
+
| ''(Optional)'' When applied as an upgrade to an existing building, the placed items in its interior to move when transitioning to the new map. This is a list of models with these fields:
|-
  −
| <samp>Chance</samp>
  −
| ''(Optional)'' The probability that the item will drop, as a value between 0 (never drops) and 1 (always drops). Default 1 (100% chance).
  −
|-
  −
| <samp>MinSize</samp><br /><samp>MaxSize</samp>
  −
| ''(Optional)'' The minimum and/or maximum growth stage for the tree at which this item is produced. The possible values are <samp>Seed</samp>, <samp>Sprout</samp>, <samp>Sapling</samp>, <samp>Bush</samp>, and <samp>Tree</samp>. Both default to no limit.
  −
|-
  −
| <samp>ForStump</samp>
  −
| ''(Optional)'' Whether the item is only produced if the tree is a stump (<samp>true</samp>), not a stump (<samp>false</samp>), or both (<samp>null</samp>). Defaults to <samp>false</samp> (non-stumps only).
  −
|}
  −
|-
  −
| <samp>ShakeItems</samp>
  −
| The items produced by shaking the tree when it's fully grown. This only applies the first time the tree is shaken each day. All matching items are dropped.
  −
 
  −
This consists of a list of models with these fields:
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 2,372: Line 2,113:  
! effect
 
! effect
 
|-
 
|-
| ''common fields''
+
| <samp>Id</samp>
| See [[Modding:Item queries#Item spawn fields|item spawn fields]] for the generic item fields supported for shake items.
+
| The [[Modding:Common data field types#Unique string ID|unique string ID]] for this entry within the current list.
 
+
|-
If set to an [[Modding:Item queries|item query]] which returns multiple items, one of them will be selected at random.
+
| <samp>Source</samp>
 +
| The tile position on which any item will be moved.
 
|-
 
|-
| <samp>Season</samp>
+
| <samp>Destination</samp>
| ''(Optional)'' If set, the item only applies if the tree's location is in this season.
+
| The tile position to which to move the item.
 
|-
 
|-
| <samp>Chance</samp>
+
| <samp>Size</samp>
| ''(Optional)'' The probability that this entry is selected, as a value between 0 (never drops) and 1 (always drops). Default 1 (100% chance).
+
| ''(Optional)'' The tile size of the area to move, specified as a model with <samp>X</samp> and <samp>Y</samp> fields. Defaults to a 1×1 area. If this is multiple tiles, the <samp>Source</samp> and <samp>Destination</samp> specify the top-left coordinate of the area.
 
|}
 
|}
 
|-
 
|-
| <samp>TapItems</samp>
+
| <samp>UpgradeSignTile</samp>
| The items produced by [[Tapper|tapping]] the tree. If multiple items can be produced, the first available one is selected.
+
| ''(Optional)'' The tile position relative to the top-left corner of the building where the upgrade sign will be placed when Robin is building an upgrade, in the form <samp>"{{t|x}}, {{t|y}}"</samp>. Defaults to approximately <samp>"5, 1"</samp> if the building interior type is <samp>Shed</samp>, else <samp>"0, 0"</samp>.
 +
|-
 +
| <samp>UpgradeSignHeight</samp>
 +
| ''(Optional)'' The pixel height of the upgrade sign when Robin is building an upgrade. Defaults to 0.
 +
|}
   −
This consists of a list of models with these fields:
+
====Exterior behavior====
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 2,393: Line 2,139:  
! effect
 
! effect
 
|-
 
|-
| ''common fields''
+
| <samp>Size</samp>
| See [[Modding:Item queries#Item spawn fields|item spawn fields]] for the generic item fields supported for tapper items.
+
| ''(Optional)'' The building's width and height when constructed, measured in tiles. Defaults to a 1 x 1 area.
 +
|-
 +
| <samp>CollisionMap</samp>
 +
| ''(Optional)'' An ASCII text block which indicates which of the building's tiles the players can walk onto, where each character can be <samp>X</samp> (blocked) or <samp>O</samp> (passable). Defaults to all tiles blocked.
 +
 
 +
For example, a [[stable]] covers a 2x4 tile area with the front two tiles passable:
 +
<pre>XXXX
 +
XOOX</pre>
 +
 
 +
When the collision map is parsed, leading/trailing whitespace is trimmed (both for the entire map and for each line). In JSON, you can specify it in two forms:
 +
<syntaxhighlight lang="js">
 +
// single line with \n line breaks
 +
"CollisionMap": "XXXX\nXOOX"
   −
If set to an [[Modding:Item queries|item query]] which returns multiple items, one of them will be selected at random.
+
// multi-line with optional indentation
 +
"CollisionMap": "
 +
    XXXX
 +
    XOOX
 +
"
 +
</syntaxhighlight>
 
|-
 
|-
| <samp>Season</samp>
+
| <samp>HumanDoor</samp>
| ''(Optional)'' If set, the item only applies if the tree's location is in this season.
+
| ''(Optional)'' The position of the door that can be clicked to warp into the building interior. This is measured in tiles relative to the top-left corner tile. Defaults to disabled.
 
|-
 
|-
| <samp>Chance</samp>
+
| <samp>AnimalDoor</samp>
| ''(Optional)'' The probability that this entry is selected, as a value between 0 (never drops) and 1 (always drops). Default 1 (100% chance).
+
| ''(Optional)'' The position and size of the door that animals use to enter/exit the building, if the building interior is an animal location, specified as an object with <samp>X</samp>, <samp>Y</samp>, <samp>Width</samp>, and <samp>Height</samp> fields. This is measured in tiles relative to the top-left corner tile. Defaults to disabled.
 
|-
 
|-
| <samp>DaysUntilReady</samp>
+
| <samp>AnimalDoorOpenDuration</samp><br /><samp>AnimalDoorCloseDuration</samp>
| The number of days before the tapper is ready to empty.
+
| ''(Optional)'' The duration of the open/close animation for the animal door, measured in milliseconds. If omitted, the door switches to the open/closed state instantly.
 
|-
 
|-
| <samp>PreviousItemId</samp>
+
| <samp>AnimalDoorOpenSound</samp><br /><samp>AnimalDoorCloseSound</samp>
| ''(Optional)'' If set, the item only applies if the previous item produced by the tapper matches one of the given [[#Custom items|qualified item IDs]]. If an entry is null or an empty string, it matches when there's no previous item.
+
| ''(Optional)'' The sound which is played once each time the animal door is opened/closed. Disabled by default.
 +
|}
   −
For example: <code>"PreviousItemId": [ null ]</code> only applies when a tapper is first added to the tree, and <code>"PreviousItemsId": [ "(O)420" ]</code> applies if the player just collected a [[Red Mushroom|red mushroom]] (object #420) from it.
+
====Exterior appearance====
 +
{| class="wikitable"
 
|-
 
|-
| <samp>DaysUntilReadyModifiers</samp>
+
! field
| ''(Optional)'' [[#Quantity modifiers|Quantity modifiers]] applied to the <samp>DaysUntilReady</samp> value. Default none.
+
! effect
 
|-
 
|-
| <samp>DaysUntilReadyModifiersMode</samp>
+
| <samp>SourceRect</samp>
| ''(Optional)'' [[#Quantity modifiers|quantity modifier modes]] which indicate what to do if multiple modifiers in the <samp>DaysUntilReadyModifiersMode</samp> field apply at the same time. Default <samp>Stack</samp>.
+
| ''(Optional)'' The building's pixel area within the <samp>Texture</samp>, specified as an object with <samp>X</samp>, <samp>Y</samp>, <samp>Width</samp>, and <samp>Height</samp> fields. Defaults to the entire texture.
|}
   
|-
 
|-
| <samp>PlantableLocationRules</samp>
+
| <samp>Skins</samp>
| ''(Optional)'' The rules to decide which locations you can plant the seed in, if applicable. The first matching rule is used. This can override location checks (e.g. crops being limited to the farm), but not built-in requirements like crops needing dirt.
+
| ''(Optional)'' The appearances which can be selected from Robin's menu (like stone/plank/log [[cabin]]s), in addition to the default appearance based on <samp>Texture</samp>. This consists of a list of models with these fields:
 
  −
This consists of a list of models with these fields:
  −
 
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 2,430: Line 2,191:  
|-
 
|-
 
| <samp>Id</samp>
 
| <samp>Id</samp>
| The [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for this entry within the list.
+
| The [[Modding:Common data field types#Unique string ID|unique string ID]] for the skin.
 
|-
 
|-
| <samp>Result</samp>
+
| <samp>Name</samp><br /><samp>Description</samp>
| Indicates whether the seed can be planted in a location if this entry is selected. The possible values are:
+
| [[Modding:Tokenizable strings|Tokenizable strings]] for the skin's display name and description.
* <samp>Default</samp>: the seed can be planted if the location normally allows it. This can be used to stop processing further rules, and/or set a custom <samp>DeniedMessage</samp>.
+
|-
* <samp>Allow</samp>: the seed can be planted here, regardless of whether the location normally allows it.
+
| <samp>Texture</samp>
* <samp>Deny</samp>: the seed can't be planted here, regardless of whether the location normally allows it.
+
| The asset name for the texture under the game's Content folder.
 
|-
 
|-
 
| <samp>Condition</samp>
 
| <samp>Condition</samp>
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether this entry applies. Default true.
+
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether this skin should be available to apply. This doesn't change buildings which already have it applied. Defaults to always true.
 
|-
 
|-
| <samp>PlantedIn</samp>
+
| <samp>BuildDays</samp><br /><samp>BuildCost</samp><br /><samp>BuildMaterials</samp>
| ''(Optional)'' The planting context to apply this rule for. The possible values are <samp>Ground</samp> (planted directly in the ground), <samp>GardenPot</samp> (planted in a [[Garden Pot|garden pot]]), or <samp>Any</samp>. Default <samp>Any</samp>.
+
| ''(Optional)'' If set, overrides the equivalent field in the building data.
 
  −
Note that trees can't be planted in garden pots.
   
|-
 
|-
| <samp>DeniedMessage</samp>
+
| <samp>ShowAsSeparateConstructionEntry</samp>
| ''(Optional)'' If this rule prevents planting the seed, the tokenizable string to show to the player (or <samp>null</samp> to default to the normal behavior for the context). This also applies when the <samp>Result</samp> is <samp>Default</samp>, if that causes the planting to be denied.
+
| ''(Optional)'' Whether this skin should be shown as a separate building option in the construction menu (like cabins). Default false.
|}
   
|-
 
|-
| <samp>CustomFields</samp>
+
| <samp>Metadata</samp>
| The [[#Custom data fields|custom fields]] for this entry.
+
| ''(Optional)'' Equivalent to the <samp>Metadata</samp> field on the building. Properties defined in this field are added to the building's metadata when this skin is active, overwriting the previous property with the same name if applicable. Default none.
 
|}
 
|}
  −
====Spawning wild trees====
  −
Custom trees can be added to the game in two ways:
  −
* Spawn them on [[Modding:Maps|map tiles]] when the location is created, using the new <samp>SpawnTree: wild {{t|tree ID}} {{o|growth stage on location created}} {{o|growth stage on day-update regrowth}}</samp> tile property. This must be added on the <samp>Paths</samp> layer, which must also have tile index 34 from the <samp>paths</samp> tilesheet.
  −
* Or give the player a seed item in the usual ways (e.g. from [[#Custom shops|a shop]], [[Modding:Mail data|mail letter]], etc).
  −
  −
===Default recipes===
  −
You can now have [[Modding:Recipe data|crafting and cooking recipes]] that are learned automatically by setting the condition field to <samp>default</samp>. Any missing default recipes will be learned on day start.
  −
  −
For example, here's the chest entry from <samp>Data/CraftingRecipes</samp>:
  −
<syntaxhighlight lang="js">
  −
"Chest": "388 50/Home/130/true/default/"
  −
</syntaxhighlight>
  −
  −
===Global inventories===
  −
C# mods can now set a <samp>chest.GlobalInventoryId</samp> field to make it share a global inventory with every other chest having the same ID. This replaces the equivalent hardcoded logic for [[Junimo Chest|Junimo chests]], which now just default to a <samp>"JunimoChests"</samp> global inventory ID. For example, this can be used to have multiple Junimo chest networks or make other containers share inventory.
  −
  −
C# mods can also use this to store items for other mod purposes, by using <samp>Game1.player.team.globalInventories</samp> or <samp>Game1.player.team.GetOrCreateGlobalInventory(id)</samp> directly.
  −
  −
===Hats on aquarium fish===
  −
Custom [[Modding:Fish data|fish in aquariums]] can now wear [[hats]], just like vanilla [[Sea Urchin|sea urchins]]. This can be enabled by specifying a new field in <samp>Data/AquariumFish</samp>:
  −
  −
{| class="wikitable"
   
|-
 
|-
! index
+
| <samp>FadeWhenBehind</samp>
! field
+
| ''(Optional)'' Whether the building should become semi-transparent when the player is behind it. Default true.
! purpose
   
|-
 
|-
| 7
+
| <samp>DrawOffset</samp>
| hat position
+
| ''(Optional)'' A pixel offset applied to the building sprite's placement in the world. Default 0.
| The pixel position of the hat on the sprite, specified as an object with <samp>X</samp> and <samp>Y</samp> values.
+
|-
|}
+
| <samp>SeasonOffset</samp>
 
+
| ''(Optional)'' A pixel offset to apply each season. This is applied to the <samp>SourceRect</samp> position by multiplying the offset by 0 (spring), 1 (summer), 2 (fall), or 3 (winter). Default 0, so all seasons use the same source rect.
===Context tag changes===
+
|-
====New context tags====
+
| <samp>SortTileOffset</samp>
1.6 adds several new [[Modding:Items#Context tags|item context tags]]:
+
| ''(Optional)'' A Y tile offset applied when figuring out render layering. For example, a value of <samp>2.5</samp> will treat the building as if it was 2.5 tiles further up the screen for the purposes of layering. Default 0.
 
+
|-
 +
| <samp>DrawLayers</samp>
 +
| ''(Optional)'' A list of textures to draw over or behind the building, with support for conditions and animations. This consists of a list of models with these fields:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! context tag
+
! field
 
! effect
 
! effect
 
|-
 
|-
| <samp>campfire_item</samp>
+
| <samp>Id</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...
+
| The [[Modding:Common data field types#Unique string ID|unique string ID]] for this entry within the current list.
* 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>
+
| <samp>SourceRect</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>.
+
| The pixel area within the <samp>texture</samp> to draw, formatted like <samp>"{{t|x}} {{t|y}} {{t|width}} {{t|height}}"</samp>. If the overlay is animated via <samp>FrameCount</samp>, this is the area of the first frame.
 
|-
 
|-
| <samp>geode_crusher_ignored</samp>
+
| <samp>DrawPosition</samp>
| Prevents breaking this item open in a [[Geode Crusher|geode crusher]], even if the item has geode fields in [[#Custom objects|<samp>Data/Objects</samp>]].
+
| The tile position at which to draw the top-left corner of the texture, relative to the building's top-left corner tile.
 
|-
 
|-
| <samp>item_type_{{t|type}}</samp>
+
| <samp>Texture</samp>
| 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.
+
| ''(Optional)'' The asset name of the texture to draw. Defaults to the building's default <samp>Texture</samp> field.
 
|-
 
|-
| <samp>museum_donatable</samp><br /><samp>not_museum_donatable</samp>
+
| <samp>DrawInBackground</samp>
| Set whether the item can be donated to the [[museum]], overriding the vanilla logic.
+
| ''(Optional)'' Whether to draw the texture behind the building sprite (i.e. underlay) instead of over it.
 
|-
 
|-
| <samp>not_giftable</samp>
+
| <samp>SortTileOffset</samp>
| Prevents players from gifting this item to NPCs, who'll ignore the item entirely (e.g. as if you were holding a tool).
+
| ''(Optional)'' A Y tile offset applied when figuring out render layering. For example, a value of <samp>2.5</samp> will treat the texture as if it was 2.5 tiles further up the screen for the purposes of layering. Default 0.
 
  −
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>
+
| <samp>OnlyDrawIfChestHasContents</samp>
| Sets whether the item can be placed on the ground.
+
| ''(Optional)'' The ID of a chest defined in the <samp>Chests</samp> field which must contain items. If it's empty, this overlay won't be rendered. Default none.
 
|-
 
|-
| <samp>prevent_loss_on_death</samp>
+
| <samp>FrameCount</samp><br /><samp>FramesPerRow</samp><br /><samp>FrameDuration</samp>
| Indicates the item can't be [[Adventurer's Guild#Item Recovery Service|lost when the player dies]].
+
| ''(Optional)'' If <samp>FrameCount</samp> is more than one, the building overlay will be animated automatically. For each frame, the <samp>SourceRect</samp> will be offset by its <samp>Width</samp> to the right up to <samp>FramesPerRow - 1</samp> times, and then down by its <samp>Height</samp>. Each frame will be rendered on-screen for <samp>FrameDuration</samp> milliseconds before switching to the next frame.
|-
+
 
| <samp>sign_item</samp>
+
For example, if you set <samp>FrameCount</samp> to 6 and <samp>FramesPerRow</samp> to 3, the building will expect the frames to be laid out like this in the spritesheet (where frame 1 matches <samp>SourceRect</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.
+
<pre>
 +
┌───┬───┬───┐
 +
│ 1 │ 2 │ 3 │
 +
├───┼───┼───┤
 +
│ 4 │ 5 │ 6 │
 +
└───┴───┴───┘
 +
</pre>
 
|-
 
|-
| <samp>torch_item</samp>
+
| <samp>AnimalDoorOffset</samp>
| Marks the item as a [[torch]], which lets the player turn it on/off to emit light.
+
| ''(Optional)'' A pixel offset applied to the draw layer when the animal door is open. While the door is opening, the percentage open is applied to the offset (e.g. 50% open = 50% offset).
 
+
|}
See also <samp>campfire_item</samp>.
+
|-
 +
| <samp>DrawShadow</samp>
 +
| ''(Optional)'' Whether to draw an automatic shadow along the bottom edge of the building's sprite. Default true.
 
|}
 
|}
   −
Context tags which affect [[#Custom machines|machine processing]]:
+
====Interior====
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! context tag
+
! field
 
! effect
 
! effect
 
|-
 
|-
| <samp>crystalarium_banned</samp>
+
| <samp>IndoorMap</samp>
| When applied to a gem or mineral item, prevents players from placing it in a [[crystalarium]].
+
| ''(Optional)'' The name of the map asset under <samp>Maps</samp> to load for the building interior. For example, <samp>"Shed"</samp> will load the [[shed]]'s <samp>Maps/Shed</samp> map.
 
|-
 
|-
| <samp>keg_juice</samp><br /><samp>keg_wine</samp>
+
| <samp>IndoorMapType</samp>
| Allows processing the item in a [[keg]] to produce a juice or wine variant.
+
| ''(Optional)'' The full name of the C# location class which will manage the building's interior location. This must be one of the vanilla types to avoid a crash when saving. There are too many to list here, but the most useful types are likely...
 +
* <samp>StardewValley.AnimalHouse</samp>;
 +
* <samp>StardewValley.Locations.Cabin</samp>;
 +
* <samp>StardewValley.Locations.Cellar</samp>;
 +
* <samp>StardewValley.Locations.DecoratableLocation</samp>;
 +
* <samp>StardewValley.Locations.FarmCave</samp>;
 +
* <samp>StardewValley.Locations.FarmHouse</samp>;
 +
* <samp>StardewValley.Shed</samp>;
 +
* and <samp>StardewValley.SlimeHutch</samp>.
 +
Defaults to the generic <samp>StardewValley.GameLocation</samp> class.
 
|-
 
|-
| <samp>preserves_jelly</samp><br /><samp>preserves_pickle</samp>
+
| <samp>NonInstancedIndoorLocation</samp>
| Allows processing the item in a [[Preserves Jar|preserves jar]] to produce a jelly or pickled variant.
+
| ''(Optional)'' The name of the existing global location to treat as the building's interior, like <samp>FarmHouse</samp> and <samp>Greenhouse</samp> for their buildings.
 +
 
 +
Each location can only be used by one building. If the location is already in use (e.g. because the player has two of this building), each subsequent building will use the <samp>IndoorMap</samp> and <samp>IndoorMapType</samp> instead. For example, the first greenhouse will use the global <samp>Greenhouse</samp> location, and any subsequent greenhouse will use a separate instanced location.
 
|-
 
|-
| <samp>seedmaker_banned</samp>
+
| <samp>MaxOccupants</samp>
| When applied to a seed item, prevents players from placing it in a [[Seed Maker|seed maker]].
+
| ''(Optional)'' The maximum number of animals who can live in this building.
 
|-
 
|-
| <samp>tapper_item</samp>
+
| <samp>AllowAnimalPregnancy</samp>
| Marks the item as a [[tapper]] or [[Heavy Tapper|heavy tapper]].
+
| ''(Optional)'' Whether animals can get pregnant and produce offspring in this building. Default false.
 
|-
 
|-
| <samp>tapper_multiplier_{{t|multiplier}}</samp>
+
| <samp>ValidOccupantTypes</samp>
| 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.
+
| ''(Optional)'' A list of building IDs whose animals to allow in this building too. For example, <code>[ "Barn", "Coop" ]</code> will allow [[barn]] and [[coop]] animals in this building. Default none.
 
|}
 
|}
   −
And informational tags which have no effect on the game logic:
+
====Item processing====
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! context tag
+
! field
 
! effect
 
! effect
 
|-
 
|-
| <samp>fish_legendary</samp><br /><samp>fish_legendary_family</samp>
+
| <samp>HayCapacity</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 [[#Custom locations|<samp>Data/Locations</samp>]].
+
| ''(Optional)'' The amount of hay that can be stored in this building. If built on the [[The Farm|farm]], this works just like [[silo]]s and contributes to the farm's available hay.
 +
|-
 +
| <samp>ItemConversions</samp>
 +
| ''(Optional)'' The item processing rules which take input items and convert them into output items using the inventories defined by <samp>Chests</samp>. This consists of a list of models with these fields:
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! effect
 
|-
 
|-
| <samp>geode</samp>
+
| <samp>Id</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 [[#Custom objects|<samp>Data/Objects</samp>]].
+
| The [[Modding:Common data field types#Unique string ID|unique string ID]] for this rule within the current list.
 
|-
 
|-
| <samp>id_{{t|item id}}</samp>
+
| <samp>RequiredTags</samp>
| ''(Added automatically)'' The [[#Custom items|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.
+
| A list of [[Modding:Items#Context tags|context tags]] to match against an input item. An item must have ''all'' of these tags to be accepted.
 
|-
 
|-
| <samp>is_machine</samp>
+
| <samp>SourceChest</samp>
| ''(Added automatically)'' Indicates the item has [[#Custom machines|machine logic]]. This is added automatically based on <samp>Data/Machines</samp>.
+
| The ID of the inventory defined in <samp>Chests</samp> from which to take input items.
 
|-
 
|-
| <samp>machine_input</samp>
+
| <samp>DestinationChest</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>:
+
| The ID of the inventory defined in <samp>Chests</samp> in which to store output items.
* if <samp>HasInput</samp> is true;
  −
* ''or'' if any output rules have an <samp>ItemPlacedInMachine</samp> trigger.
   
|-
 
|-
| <samp>machine_output</samp>
+
| <samp>ProducedItems</samp>
| ''(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>:
+
| The output items produced when an input item is converted. This consists of a list of models with these fields:
* if <samp>HasOutput</samp> is true;
  −
* ''or'' if it has any output rules.
  −
|}
  −
 
  −
====ItemContextTagManager class====
  −
For C# mods, 1.6 adds a new <samp>ItemContextTagManager</samp> class which simplifies working with [[Modding:Items#Context tags|item context tags]] and reduces repeated code.
  −
 
  −
This provides a few utility methods:
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! method
+
! field
 
! effect
 
! effect
 
|-
 
|-
| <code>GetBaseContextTags(id)</code>
+
| ''common fields''
| 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>.
+
| See [[Modding:Item queries#Item spawn fields|item spawn fields]] for the generic item fields supported by machine output.
 +
 
 +
If set to an [[Modding:Item queries|item query]] which returns multiple items, one of them will be selected at random.
 
|-
 
|-
| <code>DoesTagQueryMatch(query, tags)</code>
+
| <samp>Chance</samp>
| 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]]).
+
| ''(Optional)'' The probability that the item will be produced, as a value between 0 (never drops) and 1 (always drops). Default 1 (100% chance).
 +
|}
 
|-
 
|-
| <code>DoAllTagsMatch(requiredTags, actualTags)</code><br /><code>DoAnyTagsMatch(requiredTags, actualTags)</code>
+
| <samp>RequiredCount</samp>
| 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.
+
| ''(Optional)'' The number of the input item to consume. Default 1.
 
|-
 
|-
| <code>DoesTagMatch(requiredTag, actualTags)</code>
+
| <samp>MaxDailyConversions</samp>
| Get whether a single tag matches the actual item tags. This supports negated required tags like <samp>"!fossil_item"</samp> too.
+
| ''(Optional)'' The maximum number of the input item which can be processed each day. Each conversion rule has its own separate maximum (e.g. if you have two rules each with a max of 1, then you can convert one of each daily). Set to -1 to allow unlimited conversions. Default 1.
 +
|}
 
|-
 
|-
| <code>SanitizeContextTag(tag)</code>
+
| <samp>Chests</samp>
| ''(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>.
+
| ''(Optional)'' The input/output inventories that can be accessed from a tile on the building exterior. The allowed items are defined by the separate <samp>ItemConversions</samp> field. This is a list of models with these fields:
|}
  −
 
  −
====Other context tag changes====
  −
* Context tags are now case-insensitive.
  −
 
  −
===Inventory class===
  −
For C# mods, 1.6 adds a new <samp>Inventory</samp> class to manage a list of items. This is used for the <samp>Farmer.items</samp> and <samp>Chest.items</samp> fields. It implements <samp>IList&lt;Item&gt;</samp>, so most existing code should still work fine.
  −
 
  −
This has three main benefits:
  −
<ul>
  −
<li>It has methods to simplify many common operations. For example:
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! method
+
! field
 
! effect
 
! effect
 
|-
 
|-
| <code>HasAny()</code>
+
| <samp>Id</samp>
| Get whether the inventory contains any items (ignoring empty slots).
+
| The [[Modding:Common data field types#Unique string ID|unique string ID]] for this chest within the current list.
 +
 
 +
This is referenced from the <samp>ItemConversions</samp> field.
 
|-
 
|-
| <code>CountItemStacks()</code>
+
| <samp>Type</samp>
| Get the number of item stacks in the inventory (ignoring empty slots).
+
| The inventory type. This must be one of:
 +
* <samp>Chest</samp>: show a normal chest UI on click.
 +
* <samp>Collect</samp>: provides items for the player to collect. Clicking the tile will do nothing (if empty), grab the item directly (if it only contains one item), else show a grab-only inventory UI.
 +
* <samp>Load</samp>: lets the player add items for the building to process.
 
|-
 
|-
| <code>ContainsId(id)</code>
+
| <samp>Sound</samp>
| Get whether the inventory contains any item with the given qualified or unqualified item ID.
+
| ''(Optional)'' The sound to play once when the player clicks the chest.
 
|-
 
|-
| <code>ContainsId(id, minCount)</code>
+
| <samp>InvalidItemMessage</samp><br /><samp>InvalidCountMessage</samp><br /><samp>ChestFullMessage</samp>
| Get whether the inventory contains items with the given qualified or unqualified item ID, and their combined stack size is at least <samp>minCount</samp>.
+
| ''(Optional)'' A [[Modding:Tokenizable strings|tokenizable string]] to show when the player tries to add an item to the chest when...
 +
* it isn't a supported item;
 +
* it's supported but they don't have enough in their inventory;
 +
* the chest has no more room to accept it.
 +
If omitted, the player interaction is ignored with no message shown.
 
|-
 
|-
| <code>CountId(id)</code>
+
| <samp>InvalidItemMessageCondition</samp>
| Get the combined stack size of all items with the given qualified or unqualified item ID.
+
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether <samp>InvalidItemMessage</samp> should be shown. This can use item-related queries like <samp>ITEM_TYPE</samp>. Defaults to always true.
 
|-
 
|-
| <code>GetById(id)</code>
+
| <samp>DisplayTile</samp>
| Get a list of items in the inventory with the given qualified or unqualified item ID.
+
| ''(Optional)'' The chest's position on the building exterior, measured in tiles from the top-left corner of the building, specified in the form <samp>"{{t|x}}, {{t|y}}"</samp>. This affects the position of the 'item ready to collect' bubble. If omitted, the bubble is disabled.
 
|-
 
|-
| <code>ReduceId(id, count)</code>
+
| <samp>DisplayHeight</samp>
| Remove the given number of items matching the given qualified or unqualified item ID. This reduces the stack size for matching items until a total of <samp>count</samp> have been removed, and clears any slots which reach a stack size of zero.
+
| ''(Optional)'' If <samp>DisplayTile</samp> is set, the chest's tile height like <samp>1.5</samp>.
|}</li>
+
|}
<li>Many common operations have been unified, so previously player-only methods can now be used with chests too.</li>
+
|}
<li>It has an internal index by item ID, so operations like <code>items.ContainsId("(O)128")</code> are much more efficient since they no longer iterate the list.</li>
  −
</ul>
  −
 
  −
This replaces some previous methods:
      +
====Tile interactions====
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! game class
+
! field
! old code
+
! effect
! migration
+
|-
 +
| <samp>ActionTiles</samp>
 +
| ''(Optional)'' A list of tiles which the player can click to trigger an <samp>Action</samp> [[Modding:Maps|map tile property]]. This consists of a list of models with these fields:
 +
{| class="wikitable"
 
|-
 
|-
|rowspan="5"| <samp>Farmer</samp>
+
! field
| <code>getItemCount(id)</code><br /><code>GetTallyOfObject(id)</code><br /><code>GetTallyOfObject(id, isBigCraftable)</code><br /><code>hasItemInInventory(id, count)</code><br /><code>hasItemInInventoryNamed(name)</code><br /><code>hasItemInList(list, id, count)</code><br /><code>hasItemWithNameThatContains(name)</code>
+
! effect
| &#32;
  −
* To check an item ID, use <code>items.CountId(id)</code> or <code>Items.ContainsId(id, count)</code>.
  −
* To check Golden Walnuts or Qi Gems, use the <samp>Game1.netWorldState.Value.GoldenWalnuts</samp> and <samp>Farmer.QiGems</samp> fields.
  −
* To check category matches or <samp>-777</samp> (seasonal wild seeds), the <samp>getItemCount</samp> and <samp>getItemCountInList</samp> still exist.
   
|-
 
|-
| <code>areAllItemsNull()</code>
+
| <samp>Id</samp>
| Use <code>!items.HasAny()</code>.
+
| The [[Modding:Common data field types#Unique string ID|unique string ID]] for this entry within the current list.
 
|-
 
|-
| <code>numberOfItemsInInventory()</code>
+
| <samp>Tile</samp>
| Use <code>items.CountItemStacks()</code> to count all items, or <code>Items.Count(p => p is Object)</code> to match this method's actual behavior.
+
| The tile position, relative to the building's top-left corner tile.
 
|-
 
|-
| <code>consumeObject(id, count)</code>
+
| <samp>Action</samp>
| Use <code>items.ReduceId(id, count)</code>.
+
| The [[Modding:Tokenizable strings|tokenizable string]] for the action to perform, excluding the <samp>Action</samp> prefix. For example, <samp>"Dialogue Hi there @!"</samp> to show a messagebox like "''Hi there <player name>!''". The tokenizable string is expected before the action is raised. See the [[Modding:Maps#Tile properties 2|list of tile properties]] for useful <samp>Action</samp> values.
 +
|}
 
|-
 
|-
| <code>removeItemsFromInventory(id, count)</code>
+
| <samp>DefaultAction</samp>
| &#32;
+
| ''(Optional)'' The default tile action if the clicked tile isn't in <samp>ActionTiles</samp>. Default none.
* To remove an item by ID, use <code>removeItemsFromInventory(id, count)</code>.
  −
* To deduct Golden Walnuts or Qi Gems, change the <samp>Game1.netWorldState.Value.GoldenWalnuts</samp> and <samp>Farmer.QiGems</samp> fields.
   
|-
 
|-
|rowspan="2"| <samp>Object</samp>
+
| <samp>TileProperties</samp>
| <code>ConsumeInventoryItem(player, id, count)</code>
+
| ''(Optional)'' The [[Modding:Maps|map tile properties]] to set. This consists of a list of models with these fields:
| This was somewhat specialized and shouldn't be called by mod code, but the equivalent would be <code>(obj.autoLoadChest?.items ?? player.items).ReduceId(id, count)</code>. See also notes for <samp>Farmer.removeItemsFromInventory</samp>.
+
{| class="wikitable"
 
|-
 
|-
| <code>GetTallyOfObject(player, id)</code>
+
! field
| This was somewhat specialized and shouldn't be called by mod code, but the equivalent would be <code>(obj.autoLoadChest?.items ?? player.items).CountId(id)</code>. See also notes for <samp>Farmer.getTallyOfObject</samp>.
+
! effect
|}
+
|-
 
+
| <samp>Id</samp>
It implements a new <samp>IInventory</samp> interface, which lets mods pass their own implementations to code which works on inventories.
+
| The [[Modding:Common data field types#Unique string ID|unique string ID]] for this entry within the current list.
 
+
|-
===Furniture changes===
+
| <samp>Name</samp>
<ul>
+
| The tile property name to set.
<li>[[Modding:Items#Furniture|<samp>Data/furniture</samp>]] no longer has language variants. Translations were moved into <samp>Strings/Furniture</samp>.</li>
+
|-
<li>
+
| <samp>Value</samp>
There are a few changes in [[Modding:Items#Furniture|<samp>Data/furniture</samp>]]:
+
| ''(Optional)'' The tile property value to set, or omit to set a null value.
<ul>
+
|-
<li>Field index 6 is now placement restrictions and field index 7 is now display name. The display name field is no longer omitted in English.</li>
+
| <samp>Layer</samp>
<li>Field index 7 (display name) now allows [[Modding:Tokenizable strings|tokenizable strings]].</li>
+
| The name of the map layer whose tiles to change.
<li>Added new fields:
+
|-
 +
| <samp>TileArea</samp>
 +
| The tiles to which to add the property, relative to the top-left corner of the building's collision box. This is specified as an object with <samp>X</samp>, <samp>Y</samp>, <samp>Width</samp>, and <samp>Height</samp> fields.
 +
|}
 +
|-
 +
| <samp>AdditionalTilePropertyRadius</samp>
 +
| ''(Optional)'' When checking whether the player clicked on a <samp>TileProperties</samp> tile, an added distance around the building at which tile locations may be placed. Default 0, so only tile properties within the normal building bounds will work.
 +
|}
    +
====Advanced====
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! index
   
! field
 
! field
 
! effect
 
! effect
 
|-
 
|-
| 8
+
| <samp>Metadata</samp>
| sprite index
+
| ''(Optional)'' A list of custom properties applied to the building, which can optionally be overridden per-skin in the <samp>Skins</samp> field. Default none.
| The sprite index within the spritesheet texture to draw.
+
 
 +
The base game recognizes these properties:
 +
{| class="wikitable"
 
|-
 
|-
| 9
+
! property
| texture
+
! description
| ''(Optional)'' The asset name of the texture to draw. Defaults to <samp>TileSheets/furniture</samp>.
   
|-
 
|-
| 10
+
| <samp>ChimneyPosition: {{t|x}} {{t|y}}</samp>
| off limits for random sale
+
| ''(Optional)'' The pixel position at which to place a chimney on the building exterior, relative to the top-left corner of the sprite. This will apply the same logic as the farmhouse chimney (e.g. producing smoke if there's a lit fireplace inside the building).
| ''(Optional)'' Whether to prevent this furniture from appearing in randomly generated shop stocks and the furniture catalogue. Default false.
   
|-
 
|-
| 11
+
| <samp>ChimneyPosition{{o|upgrade level}}: {{t|x}} {{t|y}}</samp>
| context tags
+
| ''(Optional, for farmhouses/cabins only)'' Override <samp>ChimneyPosition</samp> for the given upgrade level, starting from 0 for the initial farmhouse/cabin. If there's no override for the current upgrade level, the highest override for a lower upgrade level is used (if any). For example, <samp>ChimneyPosition3</samp> would be used for the third house upgrade (and the fourth if there's no <samp>ChimneyPosition4</samp>).
| ''(Optional)'' A space-delimited list of [[Modding:Items#Context tags|context tags]] which apply to this furniture. Default none.
+
|}
|}</li>
  −
</ul>
  −
</li>
  −
</ul>
     −
===Other item changes for C# mods===
+
This can also contain arbitrary custom properties, which C# mods can read using <samp>building.GetMetadata(key)</samp>.
* Placed object changes:
+
|-
** Every placed object now has a <samp>Location</samp> property set to the location which contains it. This removes location parameters from many object methods.
+
| <samp>BuildingType</samp>
** Setting an object's tile position through <samp>obj.TileLocation</samp> now recalculcates its collision box automatically. (Setting it through the <samp>tileLocation</samp> net field directly won't though.)
+
| ''(Optional)'' The full name of the C# type to instantiate for the building instance. Defaults to a generic <samp>Building</samp> instance.
** The <samp>obj.IsScarecrow()</samp> and <samp>GetScarecrowRadius()</samp> methods now work for non-bigcraftable objects too.
+
 
* Clothing changes:
+
'''⚠ Caution:''' this is meant to support vanilla building types like <samp>StardewValley.Shed</samp>. Setting this to a non-vanilla type will cause a crash when it's written to the save file, and may cause crashes in multiplayer. If you need custom behavior, consider handling it in C# based on the building type instead of creating a custom subclass; otherwise you'll need a framework mod like {{nexus mod|1348|SpaceCore}} to handle serialization and multiplayer sync.
** <samp>Clothes.clothesType</samp> is now an enum field.
+
|-
** Clothing is no longer gender-specific. This renames <samp>indexInTileSheetMale</samp> to <samp>indexInTileSheet</samp>, obsoletes <samp>indexInTileSheetFemale</samp>, and converts gender-variant clothing into regular items.
+
| <samp>ModData</samp>
** Removed unused <samp>ClothesType.ACCESSORY</samp> value.
+
| ''(Optional)'' A string → string lookup of arbitrary <samp>modData</samp> values to attach to the building when it's constructed.
** <samp>Farmer.pants</samp> and <samp>Farmer.shirt</samp> now store the item ID instead of the sprite index.
+
|-
** In <samp>Data/TailoringRecipes</samp>, added a <samp>CraftingIdFeminine</samp> field which overrides <samp>CraftingId</samp> for female characters.
+
| <samp>CustomFields</samp>
* Crop changes:
+
| The [[#Custom data fields|custom fields]] for this entry.
** Added <samp>Game1.cropData</samp> to read crop info without constantly reloading the <samp>Data/Crops</samp> asset.
+
|}
** Removed most crop fields which only mirror the data (like <samp>harvestMethod</samp> or <samp>seasonsToGrowIn</samp>). Mods can get the info through <samp>crop.GetData()</samp> instead.
+
 
** Partly de-hardcoded fertilizer logic. Almost all fertilizer logic is now centralized into a new patchable set of <samp>HoeDirt</samp> methods (see list below). The only fertilizer logic that's still embedded elsewhere is the interaction errors in <samp>Utility.tryToPlaceItem</samp>.
+
===Build anywhere===
** HoeDirt.fertilizer.Value is now set to <samp>null</samp> when there is no fertilizer. Both qualified and unqualified IDs should be expected.
+
{{/doc status|[[Modding:Blueprint data]] and [[Modding:Maps]]|done=false}}
** Removed <samp>crop.InferSeedIndex()</samp>. This was used to support old crops, which are now fixed by a save migration instead.
+
 
* Tool changes:
+
* You can now allow building construction for any location using the [[#Map/tile property changes|new <samp>CanBuildHere</samp> and related map properties]]. The game will adjust accordingly (e.g. Robin will let you choose where to construct the building).
** Fixed various logic not handling custom tool upgrade levels.
+
* Buildings and animals are no longer hardcoded to the [[The Farm|farm]] location (except [[cabin]]s and the [[farmhouse]] which still are).
 +
* Scything hay will now add hay to silos in any location, and animals will be auto-fed from hay in any location.
 +
 
 +
===Other building changes===
 +
{{/doc status|[[Modding:Blueprint data]]|done=false}}
 +
 
 +
: ''See also: [[#Other location/map changes|other location changes]] for location-related building changes.''
 +
 
 +
; General building changes
 +
* Building display names & descriptions are now in <samp>Strings/Buildings</samp> for reuse.
 +
* Removed <samp>Data/Blueprints</samp>. This has been replaced by <samp>Data/Buildings</samp> (building data) and <samp>Strings/Buildings</samp> (display names & descriptions).
 
<ul>
 
<ul>
<li>Other item logic:<ul>
+
<li>Added methods to simplify common operations:
<li>Simplified the constructors for many item types, particularly <samp>Object</samp>.</li>
  −
<li>[[Honey]] items now have their <samp>preserve</samp> field set to a new <samp>Honey</samp> type (instead of null).</li>
  −
<li>The <samp>Object.performObjectDropInAction</samp> method now applies the <samp>probe</samp> argument much more consistently. This only affects method calls with <samp>probe: true</samp>.</li>
  −
<li>The <samp>Item.salePrice()</samp> method now has option to get the price without [[Multiplayer#Profit margins|profit margins]].</li>
  −
<li>Added new fields & methods:
  −
 
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
 
! type
 
! type
! field/method
+
! method
 
! effect
 
! effect
 
|-
 
|-
| <samp>Chest</samp>
+
|rowspan="7"| <samp>Building</samp>
| <samp>GetItemsForPlayer()</samp>
+
| <samp>CreateInstanceFromId</samp>
| Shortcut for <samp>chest.GetItemsForPlayer(Game1.player.UniqueMultiplayerID)</samp>.
+
| Create a building instance from its type ID in <samp>Data/Buildings</samp>. For example:
 +
<syntaxhighlight lang="c#">
 +
Building shippingBin = Building.CreateInstanceFromId("Shipping Bin", Vector2.Zero); // creates an instance of StardewValley.Buildings.ShippingBin
 +
</syntaxhighlight>
 
|-
 
|-
| rowspan="2"| <samp>Crop</samp>
+
| <samp>GetData</samp><br /><samp>TryGetData</samp>
| <samp>GetHarvestMethod()</samp>
+
| Get the data for the building's type from <samp>Data/Building</samp>.
| Get the method used to harvest the crop (one of <samp>HarvestMethod.Grab</samp> or <samp>HarvestMethod.Scythe</samp>).
   
|-
 
|-
| <samp>IsInSeason(location)</samp>
+
| <samp>GetMetadata</samp>
| Whether the crop can grow in the location's current season (or true if crops ignore seasons in the location, like the [[greenhouse]]).
+
| Get a value from [[#Custom buildings|the <samp>Metadata</samp> field in <samp>Data/Buildings</samp>]] for this building.
 
|-
 
|-
| rowspan="8"| <samp>HoeDirt</samp>
+
| <samp>GetPaintDataKey</samp>
| <samp>HasFertilizer()</samp>
+
| Get the key in <samp>Data/PaintData</samp> for this building, if it has any.
| Get whether the dirt has any fertilizer applied.
   
|-
 
|-
| <samp>CanApplyFertilizer(itemId)</samp>
+
| <samp>ReloadBuildingData</samp>
| Get whether a player can apply the given fertilizer to this dirt.
+
| Apply the latest data in <samp>Data/Buildings</samp> to this building.
 
|-
 
|-
| <samp>CheckApplyFertilizerRules(itemId)</samp>
+
| <samp>FinishConstruction</samp>
| Get whether a player can apply the given fertilizer to this dirt, and the reason they can't if applicable.
+
| If the building is being constructed or upgrade, instantly finish doing so.
 
|-
 
|-
| <samp>GetFertilizerSpeedBoost()</samp>
+
| <samp>UpdateTransparency</samp>
| Get the crop growth speed boost from fertilizers applied to this dirt.
+
| Update the building transparency on tick for the local player's position.
 +
 
 +
This method mainly exists to let mods override/patch the transparency logic.
 
|-
 
|-
| <samp>GetFertilizerWaterRetentionChance()</samp>
+
| <samp>Farm</samp>
| Get the water retention chance from fertilizers applied to this dirt, as a value between 0 (no change) and 1 (100% chance of staying watered).
+
| <samp>GetMainFarmHouse</samp>
 +
| Get the main [[farmhouse]] building.
 
|-
 
|-
| <samp>GetFertilizerQualityBoostLevel()</samp>
+
| <samp>GameLocation</samp>
| Get the quality boost level from fertilizers applied to this dirt, which influences the chance of producing a higher-quality crop.
+
| <samp>OnParentBuildingUpgraded</samp>
|-
+
| Called when the building containing this location is upgraded, if applicable.
| <samp>GetFertilizerSourceRect()</samp>
+
|}
| Get the pixel area within the dirt spritesheet to draw for any fertilizer applied to this dirt.
+
</li>
 +
</ul>
 +
* Added building <samp>id</samp> field, which uniquely identifies each building in the world.
 +
 
 +
; [[Junimo Hut|Junimo hut]] changes
 +
* The <samp>JunimoHut.cropHarvestRange</samp> field is now per-building and editable.
   −
(This method existed before, but no longer requires the fertilizer ID argument.)
+
; [[Fish Pond|Fish pond]] changes
 +
<ul>
 +
<li>In <samp>Data/FishPondData</samp>, added a <samp>Precedence</samp> field which sets the order in which entries are checked for a match (with lower values checked first). This ensures that the fallback entries are checked after specific fish. For consistency, vanilla entries use these values:
 +
{| class="wikitable"
 
|-
 
|-
| <samp>isWatered()</samp>
+
! precedence
| Get whether the dirt is currently watered.
+
! used for
 
|-
 
|-
|rowspan="5"| <samp>Item</samp>
+
| 0<br /><small>(default value)</small>
| <samp>IsRecipe</samp><br /><samp>Quality</samp><br /><samp>Stack</samp></samp><br /><samp>sellToStorePrice()</samp>
+
| specific fish
| Equivalent to the previous <samp>Object</samp> fields/methods, to simplify common code and avoid needing to special-case <samp>Object</samp> items.
   
|-
 
|-
| <samp>appliesProfitMargins()</samp>
+
| 100
| Get whether this item should apply [[Multiplayer#Profit margins|profit margins]] to shop prices.
+
| custom groups (e.g. desert fish)
 
|-
 
|-
| <samp>CanBeLostOnDeath()</samp>
+
| 500
| Get whether this item can be lost when the player dies, so it can be recovered from the [[Adventurer's Guild#Item Recovery Service|item recovery service]].
+
| broad fish type (e.g. ocean fish)
 
|-
 
|-
| <samp>HasTypeId(id)</samp><br /><samp>HasTypeObject()</samp><br /><samp>HasTypeBigCraftable()</samp>
+
| 1000
| Get whether the item has the given [[#Custom items|type definition ID]]. These are null-safe and double as a null check:
+
| fallback (e.g. fish category)
<syntaxhighlight lang="c#">
+
|}
if (item.HasTypeId(ItemRegistry.type_object))
+
</li>
{
+
<li>In <samp>Data/FishPondData</samp>, the reward <samp>ItemId</samp> can now be an [[Modding:Item queries|item query]].</li>
    // item is non-null and has type (O)
+
<li>[[Legendary Fish|Legendary fish]] can now be added to [[Fish Pond|fish ponds]] if they have an entry in <samp>Data/FishPondData</samp>.</li>
}
+
</ul>
</syntaxhighlight>
+
 
<samp>HasTypeObject()</samp> and <samp>HasTypeBigCraftable()</samp> are shortcuts for passing <samp>ItemRegistry.type_object</samp> and <samp>ItemRegistry.type_bigCraftable</samp> respectively.
+
==What's new for NPCs==
|-
+
===Custom NPCs===
| <samp>TryGetTempData</samp><br /><samp>SetTempData</samp>
+
{{/doc status|[[Modding:NPC data]]|done=false}}
| Get or set temporary item info that's not synchronized in multiplayer or written to the save file.
     −
For example, the game uses this to pass spawn options to the fishing minigame:
+
[[Modding:NPC data|Custom NPC data]] has been overhauled in 1.6. The new <samp>Data/Characters</samp> asset (which replaces <samp>Data/NPCDispositions</samp> + <samp>Data/spousePatios</samp> + <samp>Data/spouseRooms</samp>) uses a data model format that's easier to edit and understand, and has a lot of fields to customize previously-hardcoded data.
<syntaxhighlight lang="c#">
  −
if (spawn.IsBossFish)
  −
    fish.SetTempData(nameof(spawn.IsBossFish), true);
     −
...
+
====Format====
 +
This consists of a string → model lookup, where...
 +
* The key is a [[Modding:Common data field types#Unique string ID|unique string ID]] for the NPC like <samp>Example.ModId_NpcName</samp>, which will be used as the internal <samp>Name</samp> (not <samp>DisplayName</samp>).
 +
* The value is a model with the following fields.
   −
fish.TryGetTempData(nameof(SpawnFishData.IsBossFish), out bool bossFish);
+
<dl style="margin-left: 2em;">
</syntaxhighlight>
+
<dt>Basic info:</dt>
 +
<dd>
 +
{| class="wikitable"
 
|-
 
|-
| <samp>FishingRod</samp>
+
! field
| <samp>CanUseBait()</samp><br /><samp>CanUseTackle()</samp><br /><samp>GetBait()</samp><br /><samp>GetTackle()</samp><br /><samp>HasMagicBait()</samp><br /><samp>HasCuriosityLure()</samp>
+
! effect
| Simplifies working with the fishing rod's [[bait]] and [[tackle]].
   
|-
 
|-
|rowspan="2"| <samp>Furniture</samp>
+
| <samp>DisplayName</samp>
| <samp>SetPlacement</samp><br /><samp>SetHeldObject</samp>
+
| A [[Modding:Tokenizable strings|tokenizable string]] for the NPC's display name.
| Set the furniture's position and rotation (<samp>SetPlacement</samp>) or held object (<samp>SetHeldObject</samp>). The latter will initialize the held object's tile position to match the furniture instance.
+
|-
 
+
| <samp>Language</samp>
These are used by the game to initialize furniture in one go. For example:
+
| ''(Optional)'' The language spoken by the NPC. One of <samp>Default</samp> (the default language understood by the player) or <samp>Dwarvish</samp> (which the player can only understand after finding the [[Dwarvish Translation Guide|Dwarvish translation guide]]). Default <samp>Default</samp>.
<syntaxhighlight lang="c#">
  −
// oak table holding decorative bowl
  −
Furniture table = ItemRegistry
  −
    .Create<Furniture>("(F)1120")
  −
    .SetPlacement(5, 4, 0)
  −
    .SetHeldObject(ItemRegistry.Create<Furniture>("(F)1364"));
  −
</syntaxhighlight>
   
|-
 
|-
| <samp>IsTable()</samp>
+
| <samp>Gender</samp>
| Get whether this furniture is a table.
+
| ''(Optional)'' The NPC's gender identity. One of <samp>Female</samp>, <samp>Male</samp>, or <samp>Undefined</samp>. Default <samp>Undefined</samp>.
 
|-
 
|-
|rowspan="2"| <samp>FruitTree</samp>
+
| <samp>Age</samp>
| <samp>GetQuality()</samp>
+
| ''(Optional)'' The general age of the NPC. One of <samp>Child</samp>, <samp>Teen</samp>, or <samp>Adult</samp>. Default <samp>Adult</samp>.
| Get the quality of fruit currently being produced by the fruit tree.
+
 
 +
This affects generated dialogue lines (e.g. a child might say "stupid" and an adult might say "depressing"), generic dialogue (e.g. a child might respond to dumpster diving with "''Eww... What are you doing?''" and a teen would say "''Um... Why are you digging in the trash?''"), and the gift they choose as [[Feast of the Winter Star]] gift-giver. Children are also excluded from item delivery quests.
 
|-
 
|-
| <samp>TryAddFruit()</samp>
+
| <samp>Manner</samp>
| Add a fruit item to the tree based on [[#Custom fruit trees|its data]].
+
| ''(Optional)'' A measure of the character's general politeness, which affects some generic dialogue lines. One of <samp>Neutral</samp>, <samp>Polite</samp>, or <samp>Rude</samp>. Default <samp>Neutral</samp>.
 
|-
 
|-
| <samp>IndoorPot</samp>
+
| <samp>SocialAnxiety</samp>
| <samp>Water()</samp>
+
| ''(Optional)'' A measure of the character's comfort with social situations, which affects some generic dialogue lines. One of <samp>Neutral</samp>, <samp>Outgoing</samp>, or <samp>Shy</samp>. Default <samp>Neutral</samp>.
| Simplifies watering dirt in the [[Garden Pot|garden pot]].
   
|-
 
|-
| <samp>Object</samp>
+
| <samp>Optimism</samp>
| <samp>GetBoundingBox()</samp><br /><samp>GetBoundingBoxAt(x, y)</samp>
+
| ''(Optional)'' A measure of the character's overall optimism. One of <samp>Neutral</samp>, <samp>Negative</samp>, or <samp>Positive</samp>. Default <samp>Neutral</samp>.
| Get the pixel collision area for the item placed in the world. These replace the former <samp>getBoundingBox(position)</samp> method.
   
|-
 
|-
| <samp>Tool</samp>
+
| <samp>BirthSeason</samp>
| <samp>isScythe()</samp>
+
| ''(Optional if non-social)'' The season name (case-sensitive) for the NPC's birthday. One of <samp>spring</samp>, <samp>summer</samp>, <samp>fall</samp>, or <samp>winter</samp>. Default none.
| Equivalent to the previous <samp>MeleeWeapon</samp> method, to simplify common code and avoid needing to special-case <samp>MeleeWeapon</samp> items.
   
|-
 
|-
|rowspan="3"| <samp>Tree</samp>
+
| <samp>BirthDay</samp>
| <samp>CheckForNewTexture()</samp>
+
| ''(Optional if non-social)'' The day number for the NPC's birthday. Default 0.
| Reset the tree's texture if it would change based on [[#Custom wild trees|its data]].
   
|-
 
|-
| <samp>GetMaxSizeHere</samp>
+
| <samp>HomeRegion</samp>
| Get the maximum size the tree can grow in its current position (e.g. accounting for nearby trees blocking growth).
+
| ''(Optional)'' The region of the world in which the NPC lives (one of <samp>Desert</samp>, <samp>Town</samp>, or <samp>Other</samp>). For example, only <samp>Town</samp> NPCs are counted for the introductions [[Quests#List of Story Quests|quest]], can be selected as a secret santa for the [[Feast of the Winter Star]], or get a friendship boost from the [[Luau]]. Default <samp>Other</samp>.
 
|-
 
|-
| <samp>IsGrowthBlockedByNearbyTree</samp>
+
| <samp>IsDarkSkinned</samp>
| Get whether growth is blocked because it's too close to another fully-grown tree.
+
| ''(Optional)'' Whether the NPC has dark skin, which affects the chance of children with the player having dark skin too. Default false.
 
|}
 
|}
</li>
+
</dd>
<li>Modularized <samp>Object.CheckForAction</samp> to simplify mod patches.</li>
  −
<li>Reworked <samp>Item.getOne()</samp> implementation to avoid common pitfalls. (This only affects mods with custom item classes, or which patch <samp>Item.getOne</samp> or <samp>Item._GetOneFrom</samp>.)</li>
  −
<li>Fixed fruit trees forgetting the growth stage set in their constructor when they're updated overnight.</li>
  −
</ul>
     −
===Other item changes===
+
<dt>Social features:</dt>
* Added per-object display names (''e.g.'' for custom flavored items). See the <samp>ObjectDisplayName</samp> [[Modding:Item queries#Item spawn fields|item spawn field]], or <samp>object.displayNameFormat</samp> in C#.
  −
* [[Ginger Island#Gem Birds|Item pedestals]] are now normal item, so you can spawn them using a mod like CJB Item Spawner to display items.
  −
* Added optional <samp>Condition</samp> [[Modding:Game state queries|game state query]] field to <samp>Data/SpecialOrders</samp>.
  −
* Item data changes:
  −
** The display name field now exists in English too for <samp>Data/Boots</samp>, <samp>Data/Bundles</samp>, <samp>Data/CookingRecipes</samp>, <samp>Data/CraftingRecipes</samp>, <samp>Data/Furniture</samp>, <samp>Data/Hats</samp>, and <samp>Data/Weapons</samp>.
  −
** The randomly spawned [[The Farm#Stone|stones]], [[The Farm#Wood|twigs]], and [[weeds]] have been formalized into ''litter''. They all now have object type <samp>Litter</samp>, [[Modding:Items#Categories|category]] -999 (<samp>StardewValley.Object.litterCategory</samp>), a relevant display name/description (like ''Gold Stone'' & ''Break apart to obtain gold ore'' instead of ''Stone'' & ''...''), a price of 0 (not sellable), and edibility of -300 (inedible). This also adds all mine ore nodes to <samp>Data/Objects</samp>, so the game no longer creates invalid items to show their sprite. (Doing so in 1.6 will now show an Error Item sprite instead.)
  −
** [[Honey]] items now have the <samp>honey_item</samp> context tag.
  −
** Shirts no longer have a dynamic numeric ID range; every valid shirt is now listed in [[#Custom shirts|<samp>Data/Shirts</samp>]].
  −
** You can now apply a custom buff ID when the item is eaten, via <samp>Data/Objects</samp>'s <samp>Buff</samp> field.
  −
** The type field in <samp>Data/Objects</samp> is no longer checked using substring matching (e.g. the game now uses <code>data.Type == "Fish"</code> instead of <code>typeAndCategory.Contains("Fish")</code>), which may impact mods which depended on that undocumented behavior.
  −
* Crop changes:
  −
** Paddy crops now recheck for nearby water each day, so they'll update if you add/remove a building with water or change the map layout.
  −
** In <samp>Data/Crops</samp>, each harvest option is now self-contained. For example, you can set <samp>HarvestMinStack</samp> without <samp>ExtraHarvestChance</samp>.
  −
* Fish changes:
  −
** <samp>Data/Fish</samp> is no longer translated, so there's only one <samp>Data/Fish.xnb</samp> field. Fish display names are now taken from <samp>Data/Objects</samp>.
  −
** Added a new field (index 13) in <samp>Data/Fish</samp>, which sets whether the fish can be selected for the first-catch tutorial.
  −
* Recipe changes in <samp>Data/CookingRecipes</samp> and <samp>Data/CraftingRecipes</samp>:
  −
** These assets no longer have language variants.
  −
** The display name now supports [[Modding:Tokenizable strings|tokenizable strings]].
  −
** The display name can now be left blank to get it from the first item in the output list.
  −
* Other item logic:
  −
** Missing recipes that should already be unlocked are now added to the player automatically on save load.
  −
** <samp>Data/Bundles</samp> is now loaded later, so content packs can edit it reliably.</samp>
  −
** Chests with <samp>fridge: true</samp> are now treated as mini-fridges for the cooking menu.
  −
** Gift boxes can now contain multiple items.
  −
** Fixed furniture drawn over sitting players if it has no front texture.
  −
** Fixed tool being upgraded by Clint not affected by recursive item search logic.
  −
** Fixed <samp>tool.getOne()</samp> not copying the tool name.
  −
** Fixed cooking menu constantly creating hovered item if the item/recipe names don't match.
  −
 
  −
==What's new for locations & weather==
  −
===Custom locations===
  −
You can now add/edit locations by editing the revamped <samp>Data/Locations</samp> asset. This makes nearly everything in the location configurable — display name, default warp arrival tile, how the location is created, artifact spots / fish / forage / weeds, music, etc.
  −
 
  −
See [[Modding:Location data]] for docs on the new data format.
  −
 
  −
===Custom location contexts===
  −
====Vanilla contexts====
  −
* The game previously had two hardcoded location context enums: <samp>Default</samp> (for the valley) and <samp>Island</samp> (for [[Ginger Island]]). These have been replaced with data models which define the location context settings, loaded from the <samp>Data/LocationContexts</samp> asset.
  −
* [[The Desert|The desert]] is now part of a new <samp>Desert</samp> context (instead of <samp>Default</samp>). Some of the previously hardcoded desert logic (like always sunny weather) is now just part of the context data in <samp>Data/LocationContexts</samp>.
  −
 
  −
====Format====
  −
Custom contexts can be created by editing the new <samp>Data/LocationContexts</samp> asset, and setting the context name in the location's <samp>LocationContext</samp> [[Modding:Maps|map property]].
  −
 
  −
The data asset consists of a string → model lookup, where the key matches the <samp>Name</samp> field and the value is a model with these fields:
  −
 
  −
<dl style="margin-left: 2em;">
  −
<dt>Required fields:</dt>
   
<dd>
 
<dd>
 
{| class="wikitable"
 
{| class="wikitable"
Line 2,939: Line 2,640:  
! effect
 
! effect
 
|-
 
|-
| <samp>Name</samp>
+
| <samp>CanSocialize</samp>
| The [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for the location context.
+
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether to enable social features (like birthdays, gift giving, [[friendship]], and an entry in the social tab). Default true.
|}
+
|-
</dd>
+
| <samp>CanBeRomanced</samp>
 +
| ''(Optional)'' Whether the NPC can be dated and romanced. This enables romance features for this NPC (like a 'single' label in the social menu, bouquet gifting, and marriage). Default false.
 +
|-
 +
| <samp>CanReceiveGifts</samp>
 +
| ''(Optional)'' Whether players can give gifts to this NPC. Default true.
 +
 
 +
The NPC must also be social per <samp>CanSocialize</samp> and have an entry in <samp>Data/NPCGiftTastes</samp> to be giftable, regardless of this value.
 +
|-
 +
| <samp>CanCommentOnPurchasedShopItems</samp>
 +
| ''(Optional)'' Whether this NPC can comment on items that a player sold to a shop which then resold it to them. If null (or omitted), this will default to true if their <samp>HomeRegion</samp> is set to <samp>Town</samp>.
 +
 
 +
The NPC must also be social per <samp>CanSocialize</samp> to allow it, regardless of this value.
 +
|-
 +
| <samp>CanGreetNearbyCharacters</samp>
 +
| ''(Optional)'' Whether this NPC can show a speech bubble greeting nearby players or NPCs, and or be greeted by other NPCs. Default true.
 +
|-
 +
| <samp>CanVisitIsland</samp>
 +
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether the NPC can visit the [[Ginger Island]] resort once it's unlocked. Default true.
   −
<dt>Player actions:</dt>
+
The NPC must also be social per <samp>CanSocialize</samp> to visit the island, regardless of this value.
<dd>
+
|-
 +
| <samp>LoveInterest</samp>
 +
| ''(Optional)'' Unused.
 +
|-
 +
| <samp>Calendar</samp>
 +
| ''(Optional)'' Determines when the NPC's birthday is shown in the [[calendar]]. Possible values:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! field
+
! value
 
! effect
 
! effect
 
|-
 
|-
| <samp>AllowRainTotem</samp>
+
| <samp>HiddenAlways</samp>
| ''(Optional)'' Whether a [[Rain Totem|rain totem]] can be used to force rain in this context tomorrow. If false, using a rain totem here will show a "''this item can't be used here''" message instead.
+
| They never appear in the calendar.
 
|-
 
|-
| <samp>RainTotemAffectsContext</samp>
+
| <samp>HiddenUntilMet</samp>
| ''(Optional)'' If set, using a rain totem here will change the weather in the given context ID. For example, rain totems in the desert change weather in the valley.
+
| Until the player meets them, they don't appear in the calendar.
 
|-
 
|-
| <samp>MaxPassOutCost</samp>
+
| <samp>AlwaysShown</samp>
| ''(Optional)'' When the player passes out (due to [[energy|exhaustion]] or at 2am) in this context, the maximum amount of [[gold]] lost. If omitted or set to <samp>-1</samp>, uses the same value as the <samp>Default</samp> context ({{price|1000}} by default).
+
| They always appear in the calendar.
 +
|}
 +
 
 +
Defaults to <samp>AlwaysShown</samp>.
 
|-
 
|-
| <samp>PassOutMail</samp>
+
| <samp>SocialTab</samp>
| ''(Optional)'' When the player passes out (due to [[energy|exhaustion]] or at 2am) in this context, the possible [[Modding:Mail data|letter IDs]] to add to their mailbox (if they haven't received it before). If multiple letters are valid, one will be chosen randomly (unless one specifies <samp>SkipRandomSelection</samp>).
+
| ''(Optional)'' Determines how the NPC is shown on the [[friendship|social tab]] when unlocked. Possible values:
 
  −
This consists of a list of models with these fields:
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! field
+
! value
 
! effect
 
! effect
 
|-
 
|-
| <samp>Mail</samp>
+
| <samp>HiddenAlways</samp>
| The [[Modding:Mail data|letter ID]] to add.
+
| They never appear in the social tab.
 +
|-
 +
| <samp>HiddenUntilMet</samp>
 +
| Until the player meets them, they don't appear on the social tab.
 +
|-
 +
| <samp>UnknownUntilMet</samp>
 +
| Until the player meets them, their name on the social tab is replaced with "???".
 +
|-
 +
| <samp>AlwaysShown</samp>
 +
| They always appear in the social tab (including their name).
 +
|}
   −
The game will look for an existing letter ID in <samp>Data/mail</samp> in this order (where {{t|billed}} is <samp>Billed</samp> if they lost [[gold]] or <samp>NotBilled</samp> otherwise, and {{t|gender}} is <samp>Female</samp> or <samp>Male</samp>):
+
Defaults to <samp>UnknownUntilMet</samp>.
* <samp>{{t|letter id}}_{{t|billed}}_{{t|gender}}</samp>
+
|-
* <samp>{{t|letter id}}_{{t|billed}}</samp>
+
| <samp>SpouseAdopts</samp>
* <samp>{{t|letter id}}</samp>
+
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether the player will need to adopt children with this spouse, instead of either the player or NPC giving birth. If null, defaults to true for same-gender and false for opposite-gender spouses.
   −
If no match is found in <samp>Data/mail</samp>, the game will send <samp>passedOut2</samp> instead.
+
The <samp>Target</samp> player is the one they're married to.
 +
|-
 +
| <samp>SpouseWantsChildren</samp>
 +
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether the spouse will ask to have children. Defaults to true.
   −
If the mail ID starts with <samp>passedOut</samp>, <samp>{0}</samp> in the letter text will be replaced with the gold amount lost, and it won't appear in the [[collections]] page.
+
The <samp>Target</samp> player is the one they're married to.
 
|-
 
|-
| <samp>MaxPassOutCost</samp>
+
| <samp>SpouseGiftJealousy</samp>
| ''(Optional)'' The maximum amount of [[gold]] lost. This is applied after the context's <samp>MaxPassOutCost</samp> (i.e. the context's value is used to calculate the random amount, then this field caps the result). Defaults to unlimited.
+
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether the [[Marriage#Jealousy|spouse will get jealous of gifts to other NPCs]]. Defaults to true.
 +
 
 +
The <samp>Target</samp> player is the one they're married to, and the <samp>Target</samp> item is the one that was gifted.
 
|-
 
|-
| <samp>Condition</samp>
+
| <samp>SpouseGiftJealousyFriendshipChange</samp>
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether this entry is active. Defaults to always true.
+
| ''(Optional)'' The [[Friendship|friendship point]] effect when the <samp>SpouseGiftJealously</samp> is triggered. Default -30.
 
|-
 
|-
| <samp>SkipRandomSelection</samp>
+
| <samp>SpouseRoom</samp>
| ''(Optional)'' If true, send this mail if the <samp>Condition</samp> matches instead of choosing a random valid mail. Default false.
+
| ''(Optional)'' The [[Marriage#Spouse Rooms|NPC's spouse room]] in the farmhouse when the player marries them, if applicable. If this is omitted for a marriageable NPC, they'll use Abigail's spouse room by default.
|}
  −
|-
  −
| <samp>PassOutLocations</samp>
  −
| ''(Optional)'' When the player passes out (due to [[energy|exhaustion]] or at 2am) in this context ''and'' they started the day in a different location context, the locations where they'll wake up. (If the player started the day in the same context, they'll wake up in the last bed they slept in instead.)
     −
If the selected location doesn't contain a bed and doesn't have the [[#New map properties|<samp>AllowWakeUpWithoutBed</samp> map property]], the player will wake up in the farmhouse instead.
+
This consists of a model with these fields:
 
  −
This consists of a list of models with these fields:
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 3,002: Line 2,735:  
! effect
 
! effect
 
|-
 
|-
| <samp>Location</samp>
+
| <samp>MapAsset</samp>
| The internal location name.
+
| ''(Optional)'' The asset name for the spouse room map. The <samp>Maps/</samp> prefix is added automatically and shouldn't be included. Defaults to <samp>spouseRooms</samp>.
 
|-
 
|-
| <samp>Position</samp>
+
| <samp>MapSourceRect</samp>
| The ''default'' tile position within the location, specified as an object with <samp>X</samp> and <samp>Y</samp> fields. If the location has any bed furniture, they'll be placed in the first bed found instead.
+
| ''(Optional)'' The tile area within the <samp>MapAsset</samp> containing the spouse's room. This should usually be a 6x9 tile area, though the game will try to adjust to a different size. Specified as a model with <samp>X</samp>, <samp>Y</samp>, <samp>Width</samp>, and <samp>Height</samp> fields. Defaults to <samp>(0, 0, 6, 9)</samp>.
|-
  −
| <samp>Condition</samp>
  −
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether this entry is active. Defaults to always applied.
   
|}
 
|}
  −
If no locations are specified or none match, the player will wake up in their bed at home.
   
|-
 
|-
| <samp>ReviveLocations</samp>
+
| <samp>SpousePatio</samp>
| ''(Optional)'' If the player just got knocked out in combat, the location names where they'll wake up.
+
| ''(Optional)'' The [[Marriage#Spouse Outside Area|NPC's patio area]] on the farm when the player marries them, if any. Default none.
   −
This consists of a list of models with these fields:
+
This consists of a model with these fields:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 3,023: Line 2,751:  
! effect
 
! effect
 
|-
 
|-
| <samp>Location</samp>
+
| <samp>MapAsset</samp>
| The internal location name.
+
| ''(Optional)'' The asset name for the patio area. The <samp>Maps/</samp> prefix is added automatically and shouldn't be included. Defaults to <samp>spousePatios</samp>.
 +
|-
 +
| <samp>MapSourceRect</samp>
 +
| ''(Optional)'' The tile area within the <samp>MapAsset</samp> containing the spouse's patio area. This must be a 4x4 tile area. Specified as a model with <samp>X</samp>, <samp>Y</samp>, <samp>Width</samp>, and <samp>Height</samp> fields. Defaults to <samp>(0, 0, 4, 4)</samp>.
 
|-
 
|-
| <samp>Position</samp>
+
| <samp>SpriteAnimationFrames</samp>
| The tile position within the location, specified as an object with <samp>X</samp> and <samp>Y</samp> fields.
+
| ''(Optional)'' The spouse's animation frames when they're in the patio. Each frame is an array containing [0] the sprite index in their spritesheet, and [1] the optional duration in milliseconds (default 100). If omitted or empty, the NPC won't be animated.
 +
 
 +
For example, here is Abigail playing the flute:
 +
<syntaxhighlight lang="js">
 +
"SpriteAnimationFrames": [
 +
    [16, 500], // show index 16 for 500ms
 +
    [17, 500],
 +
    [18, 500],
 +
    [19]      // if duration is omitted, defaults to 100ms
 +
]
 +
</syntaxhighlight>
 
|-
 
|-
| <samp>Condition</samp>
+
| <samp>SpriteAnimationPixelOffset</samp>
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether this entry is active. Defaults to always applied.
+
| ''(Optional)'' The pixel offset to apply to the NPC's sprite when they're animated in the patio, specified as a model with <samp>X</samp> and <samp>Y</samp> fields. This is ignored if the NPC isn't animated via <samp>SpriteAnimationFrames</samp>. Default none.
 
|}
 
|}
 +
|-
 +
| <samp>SpouseFloors</samp><br /><samp>SpouseWallpapers</samp>
 +
| ''(Optional)'' The floors and wallpapers which the NPC may randomly apply to the farmhouse when married to the player. If omitted or empty, the NPC will randomly choose a base floor (0–39) or wallpaper (0–111).
 +
|-
 +
| <samp>IntroductionsQuest</samp>
 +
| ''(Optional)'' Whether to include this NPC in [[Quests#List of Story Quests|the ''introductions'' quest]]. If <samp>null</samp> (or omitted), this will default to true if the <samp>HomeRegion</samp> field is set to <samp>Town</samp>.
 +
|-
 +
| <samp>ItemDeliveryQuests</samp>
 +
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether this NPC can give item delivery quests. If <samp>null</samp> (or omitted), this will default to true if the <samp>HomeRegion</samp> field is set to <samp>Town</samp>.
   −
If the selected location has a standard [[Modding:Event data|event]] with the exact key <samp>PlayerKilled</samp> (with no <samp>/</samp> or preconditions in the key), that event will play when the player wakes up and the game will apply the lost items or [[gold]] logic. The game won't track this event, so it'll repeat each time the player is revived. If there's no such event, the player will wake up without an event, and no items or gold will be lost.
+
The NPC must also be social per <samp>CanSocialize</samp> to allow it, regardless of this value.
 +
|-
 +
| <samp>PerfectionScore</samp>
 +
| ''(Optional)'' Whether to include this NPC when checking whether the player has max friendships with every NPC for the perfection score. Default true.
   −
If no locations are specified or none match, the player will wake up at [[Harvey's Clinic|Harvey's clinic]].
+
The NPC must also be social per <samp>CanSocialize</samp> to be counted, regardless of this value.
|}
+
|-
</dd>
+
| <samp>EndSlideShow</samp>
 
+
| ''(Optional)'' How the NPC appears in the end-game perfection slide show. Possible values:
<dt>Season:</dt>
  −
<dd>
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! field
+
! value
 
! effect
 
! effect
 
|-
 
|-
| <samp>SeasonOverride</samp>
+
| <samp>Hidden</samp>
| ''(Optional)'' The season which is always active for locations within this context (one of <samp>spring</samp>, <samp>summer</samp>, <samp>fall</samp>, or <samp>winter</samp>). For example, setting <samp>summer</samp> will make it always [[summer]] there regardless of the calendar season. If not set, the calendar season applies.
+
| The NPC doesn't appear in the slide show.
 +
|-
 +
| <samp>MainGroup</samp>
 +
| The NPC is added to the main group of NPCs which walk across the screen.
 +
|-
 +
| <samp>TrailingGroup</samp>
 +
| The NPC is added to the trailing group of NPCs which follow the main group.
 +
|}
 +
 
 +
Defaults to <samp>MainGroup</samp>.
 +
|-
 +
| <samp>FriendsAndFamily</samp>
 +
| ''(Optional)'' The NPC's closest friends and family, as a dictionary where the key is the other NPC's internal name and the value is an optional tokenizable string for the name to use in dialogue text (like 'mom'). Default none.
 +
 
 +
This affects generic dialogue for revealing likes and dislikes to family members, and may affect <samp>inlaw_&lt;NPC&gt;</samp> dialogues. This isn't necessarily comprehensive.
 
|}
 
|}
 
</dd>
 
</dd>
   −
<dt>Weather:</dt>
+
<dt>Dumpster diving:</dt>
 
<dd>
 
<dd>
 
{| class="wikitable"
 
{| class="wikitable"
Line 3,058: Line 2,823:  
! effect
 
! effect
 
|-
 
|-
| <samp>WeatherConditions</samp>
+
| <samp>DumpsterDiveEmote</samp>
| ''(Optional)'' The weather logic to apply for locations in this context (ignored if <samp>CopyWeatherFromLocation</samp> is set). Defaults to always sunny. If multiple are specified, the first matching weather is applied.
+
| ''(Optional)'' The emote ID to show above the NPC's head when they see a player rummaging through trash. See [[Modding:event data#Emotes|emote IDs]]. If omitted or <samp>null</samp>, the default depends on the NPC's age: a child will show sad (28), a teen will show a question mark (8), and an adult will show angry (12).
 +
|-
 +
| <samp>DumpsterDiveFriendshipEffect</samp>
 +
| ''(Optional)'' The friendship point change if this NPC sees a player rummaging through trash. Default -25.
 +
|}</dd>
   −
This consists of a list of models with these fields:
+
<dt>Festivals:</dt>
 +
<dd>
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 3,067: Line 2,837:  
! effect
 
! effect
 
|-
 
|-
| <samp>Weather</samp>
+
| <samp>FlowerDanceCanDance</samp>
| The [[#Custom weather|weather ID]] to set.
+
| ''(Optional)'' Whether players can ask the NPC to dance at the Flower Dance festival. The possible values are <samp>true</samp> (can always ask), <samp>false</samp> (can never ask), or <samp>null</samp> (can ask if they're romanceable). Default <samp>null</samp>.
 +
 
 +
If the NPC can dance, you should also add the [[Modding:NPC data#Overworld_sprites|dance sprite frames]] and <samp>FlowerDance_Decline</samp> [[Modding:Dialogue|dialogue text]]. You can optionally set the <samp>FlowerDance_Accept</samp> dialogue too (though NPCs have a default accept dialogue if not).
 
|-
 
|-
| <samp>Condition</samp>
+
| <samp>WinterStarParticipant</samp>
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether to apply the weather. Defaults to always applied.
+
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether this NPC can give and receive gifts at the [[Feast of the Winter Star]]. If <samp>null</samp> (or omitted), this will default to true if the <samp>HomeRegion</samp> field is set to <samp>Town</samp>.
|}
   
|-
 
|-
| <samp>CopyWeatherFromLocation</samp>
+
| <samp>WinterStarGifts</samp>
| ''(Optional)'' The <samp>Name</samp> (i.e. unique ID) of the location context from which to inherit weather.
+
| At the [[Feast of the Winter Star]], the possible gifts this NPC can give to players. A matching entry is selected at random.
|}
     −
If a [[#Custom passive festivals|passive festival]] is active in any location within this context, the weather is sunny for the entire context regardless of these fields.
+
This consists of a list of models with these fields:
 
  −
</dd>
  −
 
  −
<dt>Music:</dt>
  −
<dd>
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 3,089: Line 2,854:  
! effect
 
! effect
 
|-
 
|-
| <samp>DefaultMusic</samp>
+
| ''common fields''
| ''(Optional)'' The [[#Custom audio|cue ID]] for the music to play when the player is in the location, unless overridden by a <samp>Music</samp> map property. Despite the name, this has a higher priority than the seasonal music fields below. Ignored if omitted.
+
| See [[Modding:Item queries#Item spawn fields|item spawn fields]] for the generic item fields.
|-
+
 
| <samp>DefaultMusicCondition</samp>
+
If set to an [[Modding:Item queries|item query]] which returns multiple items, one of them will be selected at random.
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which returns whether the <samp>DefaultMusic</samp> field should be applied (if more specific music isn't playing). Defaults to always true.
+
|}
 +
|}
 +
 
 +
<dt>Spawn rules:</dt>
 +
<dd>
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! effect
 +
|-
 +
| <samp>UnlockConditions</samp>
 +
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether the NPC should be added to the world, checked when loading a save and when ending each day. This only affects whether the NPC is added when missing; returning false won't remove an NPC that's already been added. Defaults to true.
 
|-
 
|-
| <samp>DefaultMusicDelayOneScreen</samp>
+
| <samp>SpawnIfMissing</samp>
| ''(Optional)'' When the player warps and the music changes, whether to silence the music and play the ambience (if any) until the next warp (similar to the default valley locations). Default false.
+
| ''(Optional)'' Whether to add this NPC to the world if they're missing (if the <samp>UnlockConditions</samp> match and <samp>HomeLocation</samp> is valid). Default true.
 
|-
 
|-
| <samp>Music</samp>
+
| <samp>Home</samp>
| ''(Optional)'' A list of [[#Custom audio|cue IDs]] to play before noon in this location unless it's raining, there's a <samp>Music</samp> map property, or the context has a <samp>DefaultMusic</samp> value. If multiple values are specified, the game will play one per day in sequence.
+
| ''(Optional)'' The default place where this NPC spawns and returns each day. If there are multiple entries, the first matching one is used.
   −
This consists of a list of models with these fields:
+
This consists of a list of models with these fields:  
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 3,107: Line 2,883:  
! effect
 
! effect
 
|-
 
|-
| <samp>Id</samp>
+
| <samp>ID</samp>
| ''(Optional)'' A [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] which identifies this entry within the list. Defaults to the <samp>Track</samp> value.
+
| The [[Modding:Common data field types#Unique string ID|unique string ID]] for this entry within the current list.
 +
|-
 +
| <samp>Location</samp>
 +
| ''(Optional)'' The internal name for the home location where this NPC spawns and returns each day. Default none.
 +
|-
 +
| <samp>Tile</samp>
 +
| ''(Optional)'' The tile position within the home location where this NPC spawns and returns each day. Specified as a model with <samp>X</samp> and <samp>Y</samp> fields. Defaults to <samp>(0, 0)</samp>.
 
|-
 
|-
| <samp>Track</samp>
+
| <samp>Direction</samp>
| The [[Modding:Migrate to Stardew Valley 1.6#Custom audio|audio track ID]] to play.
+
| ''(Optional)'' The default direction the NPC faces when they start each day. The possible values are <samp>down</samp>, <samp>left</samp>, <samp>right</samp>, and <samp>up</samp>. Defaults to <samp>up</samp>.
 
|-
 
|-
 
| <samp>Condition</samp>
 
| <samp>Condition</samp>
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether this entry applies. Default true.
+
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether this entry can be selected. Default true.
 
|}
 
|}
|-
  −
| <samp>DayAmbience</samp><br /><samp>NightAmbience</samp>
  −
| ''(Optional)'' The [[#Custom audio|cue ID]] for the background ambience to play when there's no music active, depending on the [[Day Cycle|time of day]]. Both default to none.
  −
|-
  −
| <samp>PlayRandomAmbientSounds</samp>
  −
| ''(Optional)'' Whether to play random outdoor ambience sounds depending on factors like the season and time of day (e.g. birds, crickets, and mysterious groan sounds in the rain). This is unrelated to the <samp>DayAmbience</samp> and <samp>NightAmbience</samp> fields. Default true.
   
|}
 
|}
 
</dd>
 
</dd>
   −
<dt>Advanced:</dt>
+
<dt>Appearance & sprite:</dt>
 
<dd>
 
<dd>
 
{| class="wikitable"
 
{| class="wikitable"
Line 3,132: Line 2,908:  
! effect
 
! effect
 
|-
 
|-
| <samp>CustomFields</samp>
+
| <samp>TextureName</samp>
| The [[#Custom data fields|custom fields]] for this entry.
+
| ''(Optional)'' The '''last segment''' of the NPC's portrait and sprite asset names. For example, set to <samp>Abigail</samp> to use <samp>Portraits/Abigail</samp> and <samp>Characters/Abigail</samp> respectively. Defaults to the internal NPC name.
|}
+
|-
</dd>
+
| <samp>Appearance</samp>
</dl>
+
| ''(Optional)'' The portrait/sprite textures to use.
   −
===Custom garbage cans===
+
This can list any number of appearance options. They'll be sorted by <samp>Precedence</samp> value (with lower values taking priority), then filtered to those whose fields match. If multiple matching appearances have precedence, one entry is randomly chosen based on their relative weight. This randomization is stable per day, so the NPC always makes the same choice until the next day. If a portrait/sprite can't be loaded (or no appearances match), the NPC will use the default asset based on <samp>TextureName</samp>.
====Format====
  −
You can now add or edit [[Garbage Can|garbage cans]] on any map by editing the new <samp>Data/GarbageCans</samp> asset (see examples below).
     −
The asset consists of a data model with these fields:
+
The NPC rechecks this field each time they change location.
    +
This consists of a list of models with these fields:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 3,149: Line 2,924:  
! effect
 
! effect
 
|-
 
|-
| <samp>DefaultBaseChance</samp>
+
| <samp>Id</samp>
| The probability that an item will be found when searching garbage cans, as a value between 0 (never) and 1 (always). If the probability check fails, only items that set <samp>IgnoreBaseChance</samp> can spawn. This can be overridden by the per-garbage-can <samp>BaseChance</samp> field. Default 0.2.
+
| The [[Modding:Common data field types#Unique string ID|unique string ID]] for this entry within the current list.
 +
|-
 +
| <samp>Season</samp>
 +
| ''(Optional)'' The season in which this appearance should be used (one of <samp>spring</samp>, <samp>summer</samp>, <samp>fall</samp>, or <samp>winter</samp>), or omit for any season. Defaults to any season.
 +
|-
 +
| <samp>Indoors</samp><br /><samp>Outdoors</samp>
 +
| ''(Optional)'' Whether this appearance should be used when indoors and/or outdoors. Both default to true.
 +
|-
 +
| <samp>Condition</samp>
 +
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether this entry can be selected. Default true.
 +
|-
 +
| <samp>Portrait</samp><br /><samp>Sprite</samp>
 +
| ''(Optional)'' The asset name for the portraits and/or sprites texture to load. If omitted or it can't be loaded, it will default to the default asset per the <samp>Texture</samp> field.
 +
|-
 +
| <samp>IsIslandAttire</samp>
 +
| ''(Optional)'' Whether this is island beach attire worn at the resort. Default false.
 +
 
 +
This is mutually exclusive: NPCs will never wear it in other contexts if it's true, and will never wear it as island attire if it's false.
 +
|-
 +
| <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. Default 0.
 +
|-
 +
| <samp>Weight</samp>
 +
| ''(Optional)'' If multiple entries with the same <samp>Precedence</samp> match, the relative weight to use when randomly choosing one. Default 1.
 +
 
 +
For example, let's say two appearance entries match: one has a weight of 2, and the other has a weight of 1. Their probability of being chosen is 2/3 and 1/3 respectively.
 +
|}
 +
 
 +
'''Note:''' the default textures based on <samp>TextureName</samp> must still exist, even if you use this field to override them.
 
|-
 
|-
| <samp>BeforeAll</samp><br /><samp>AfterAll</samp>
+
| <samp>MugShotSourceRect</samp>
| The items to prepend (<samp>BeforeAll</samp>) or append (<samp>AfterAll</samp>) to the <samp>GarbageCans</samp> → <samp>Items</samp> field for all garbage cans. These work exactly like the items in that field (e.g. subject to the garbage can's base chance).
+
| ''(Optional)'' The 16x24-pixel area in the character's sprite texture to show as their mug shot icon in the calendar, social menu, and other contexts. Defaults to part of their first sprite.
 
|-
 
|-
| <samp>GarbageCans</samp>
+
| <samp>Size</samp>
| The data for individual garbage cans. This consists of a string → model lookup with these fields:
+
| ''(Optional)'' The pixel size of the individual sprites in their overworld sprite spritesheet. Specified as a model with <samp>X</samp> and <samp>Y</samp> fields. Defaults to <samp>(16, 32)</samp>.
   −
{| class="wikitable"
+
'''Note:''' sizes bigger than 16×32 will cause issues like broken spawning, pathfinding, misalignment in the [[perfection]] end-game slide show, etc.
 
|-
 
|-
! field
+
| <samp>Breather</samp>
! effect
+
| ''(Optional)'' Whether the chest on the NPC's overworld sprite puffs in and out as they breathe. Default true</samp>.
 
|-
 
|-
| ''entry key''
+
| <samp>BreathChestRect</samp>
| The [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for this garbage can.
+
| ''(Optional)'' A [[Modding:Common data field types#Rectangle|rectangle]] pixel area within the spritesheet which expands and contracts to simulate breathing, relative to the top-left corner of the source rectangle for their current sprite. Omit to calculate it automatically. This should be omitted for most NPCs, unless they have a non-standard size.
 
|-
 
|-
| <samp>BaseChance</samp>
+
| <samp>BreathChestPosition</samp>
| ''(Optional)'' If set, overrides the root <samp>DefaultBaseChance</samp> field for this garbage can. Defaults to <samp>DefaultBaseChance</samp>.
+
| ''(Optional)'' A [[Modding:Common data field types#Point|point]] pixel offset to apply to the NPC's <samp>BreathChestPosition</samp> when drawn over the NPC. Omit to calculate it automatically. This should be omitted for most NPCs, unless they have a non-standard size.
 
|-
 
|-
| <samp>Items</samp>
+
| <samp>Shadow</samp>
| ''(Optional)'' The items to try spawning when the player searches the garbage can. The first matching item in <samp>BeforeAll</samp> + <samp>Items</samp> + <samp>AfterAll</samp> will be spawned, and any further items will be ignored. Defaults to none.
+
| ''(Optional)'' The options for the shadow to draw under the NPC, or omit to apply the default shadow behavior.
 +
 
 +
This consists of a model with these fields:
   −
This consists of a list of models with these fields:
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 3,178: Line 2,982:  
! effect
 
! effect
 
|-
 
|-
| ''common fields''
+
| <samp>Visible</samp>
| See [[Modding:Item queries#Item spawn fields|item spawn fields]] for the generic item fields supported by garbage cans.
+
| ''(Optional)'' Whether the shadow should be drawn. Default true.
 +
|-
 +
| <samp>Offset</samp>
 +
| ''(Optional)'' A [[Modding:Common data field types#Point|point]] pixel offset applied to the shadow position. Default zero.
 +
|-
 +
| <samp>Scale</samp>
 +
| ''(Optional)'' The scale at which to draw the shadow. Default 1.
   −
If set to an [[Modding:Item queries|item query]] which returns multiple items, one of them will be selected at random.
+
This is a multiplier applied to the default shadow scale, which can change based on factors like whether the NPC is jumping. For example, <samp>0.5</samp> means half the size it'd be drawn if you didn't specify a scale.
 +
|}
 
|-
 
|-
| <samp>IgnoreBaseChance</samp>
+
| <samp>EmoteOffset</samp>
| ''(Optional)'' Whether this item can spawn even if the <samp>BaseChance</samp> probability check didn't pass. Default false.
+
| ''(Optional)'' A [[Modding:Common data field types#Point|point]] pixel offset applied to emote drawn over the NPC. Default zero.
 
|-
 
|-
| <samp>IsMegaSuccess</samp>
+
| <samp>ShakePortraits</samp>
| ''(Optional)'' Whether to treat this item as a 'mega success' if it's selected, which plays a special <samp>crit</samp> sound and bigger animation. Default false.
+
| ''(Optional)'' The portrait indexes which should shake when displayed. Default none.
 
|-
 
|-
| <samp>IsDoubleMegaSuccess</samp>
+
| <samp>KissSpriteIndex</samp>
| ''(Optional)'' Whether to treat this item as an 'double mega success' if it's selected, which plays an explosion sound and dramatic animation. Default false.
+
| ''(Optional)'' If the NPC can be married, the sprite index within their <samp>Texture</samp> to use when kissing a player. Default 28.
 
|-
 
|-
| <samp>AddToInventoryDirectly</samp>
+
| <samp>KissSpriteFacingDirection</samp>
| ''(Optional)'' Whether to add the item to the player's inventory directly, opening an item grab menu if they don't have room in their inventory. If false, the item will be dropped on the ground next to the garbage can instead. Default false.
+
| ''(Optional)'' Whether the character is facing right (true) or left (false) in their <samp>KissSpriteIndex</samp>. The sprite will be flipped as needed to face the player. Default true.
|-
  −
| <samp>CreateMultipleDebris</samp>
  −
| ''(Optional)'' Whether to split the spawned item into multiple stacks which each have a stack size of one. This has no effect if <samp>AddToInventoryDirectly</samp> is enabled. Default false.
  −
|}
   
|}
 
|}
 +
</dd>
   −
If the garbage can being searched doesn't have its own entry under <samp>GarbageCans</samp>, the game will just use the <samp>BeforeAll</samp> and <samp>AfterAll</samp> fields.
+
<dt>[[Secrets#Gift Log|Hidden gift log emote]]:</dt>
 +
<dd>
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! effect
 +
|-
 +
| <samp>HiddenProfileEmoteSound</samp>
 +
| ''(Optional)'' For the [[Secrets#Gift Log|hidden gift log emote]], the [[#Custom audio|cue ID]] for the sound played when clicking the sprite. Defaults to <samp>drumkit6</samp>.
 +
|-
 +
| <samp>HiddenProfileEmoteDuration</samp>
 +
| ''(Optional)'' For the [[Secrets#Gift Log|hidden gift log emote]], how long the animation plays measured in milliseconds. Defaults to 4000 (4 seconds).
 +
|-
 +
| <samp>HiddenProfileEmoteStartFrame</samp>
 +
| ''(Optional)'' For the [[Secrets#Gift Log|hidden gift log emote]], the index within the NPC's overworld sprite spritesheet at which the animation starts. If omitted for a vanilla NPC, the game plays a default animation specific to that NPC; if omitted for a custom NPC, the game just shows them walking while facing down.
 
|-
 
|-
| <samp>CustomFields</samp>
+
| <samp>HiddenProfileEmoteFrameCount</samp>
| The [[#Custom data fields|custom fields]] for this entry.
+
| ''(Optional)'' For the [[Secrets#Gift Log|hidden gift log emote]], the number of frames in the animation. The first frame corresponds to <samp>HiddenProfileEmoteStartFrame</samp>, and each subsequent frame will use the next sprite in the spritesheet. Default 1.
|}
     −
====Example new garbage can====
+
This has no effect if <samp>HiddenProfileEmoteStartFrame</samp> isn't set.
You can add garbage cans using only [[Modding:Content Patcher|Content Patcher]] or [[Modding:Modder Guide/APIs/Content|SMAPI's content API]]. For example, this content pack adds a new garbage can entry with the ID <samp>Example.ModId_Carpenter</samp>:
+
|-
 +
| <samp>HiddenProfileEmoteFrameDuration</samp>
 +
| ''(Optional)'' For the [[Secrets#Gift Log|hidden gift log emote]], how long each animation frame is shown on-screen before switching to the next one, measured in milliseconds. Default 200.
 +
 
 +
This has no effect if <samp>HiddenProfileEmoteStartFrame</samp> isn't set.
 +
|}
 +
</dd>
 +
 
 +
<dt>Advanced:</dt>
 +
<dd>
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! effect
 +
|-
 +
| <samp>CustomFields</samp>
 +
| The [[#Custom data fields|custom fields]] for this entry.
 +
|-
 +
| <samp>FormerCharacterNames</samp>
 +
| ''(Optional)'' The former NPC names which may appear in save data. If matched, the game will rename the NPC and update related data (e.g. friendship).
 +
 
 +
A former name is only applied if:
 +
# it doesn't match a current ID in <samp>Data/Characters</samp>;
 +
# the save has an NPC with the former name;
 +
# the save doesn't already have an NPC with the new name.
 +
 
 +
For example:
 +
<syntaxhighlight lang="js">
 +
"FormerCharacterNames": [ "SomeOldName" ]
 +
</syntaxhighlight>
 +
 
 +
Former names can have any format, but they must be '''globally''' unique. They can't match the ID or <samp>FormerCharacterNames</samp> of any other NPC in <samp>Data/Characters</samp> (whether vanilla or custom).
 +
|-
 +
| <samp>FestivalVanillaActorIndex</samp>
 +
| ''(Optional, Specialized)'' The NPC's index in the <samp>Maps/characterSheet</samp> tilesheet, if applicable. This is used for placing vanilla NPCs in festivals from the map; custom NPCs should use the <samp>&lt;layer&gt;_additionalCharacters</samp> field in the festival data instead.
 +
|}
 +
</dd>
 +
</dl>
 +
 
 +
====Examples====
 +
For example, this content pack adds a new ''Amabel'' NPC with full social features:
    
{{#tag:syntaxhighlight|<nowiki>
 
{{#tag:syntaxhighlight|<nowiki>
Line 3,215: Line 3,076:  
         {
 
         {
 
             "Action": "EditData",
 
             "Action": "EditData",
             "Target": "Data/GarbageCans",
+
             "Target": "Data/Characters",
            "TargetField": [ "GarbageCans" ],
   
             "Entries": {
 
             "Entries": {
                 "Example.ModId_Carpenter": {
+
                 "{{ModId}}_Amabel": {
                     "Items": [
+
                     "DisplayName": "Amabel", // this would normally use {{i18n:}} to support translations
                        // 25% chance of pufferfish
+
                    "BirthSeason": "Fall",
                        {
+
                    "BirthDay": 14,
                            "ID": "Example.ModId_Pufferfish",
+
                    "HomeRegion": "Town",
                            "Condition": "RANDOM 0.25",
+
                    "Gender": "Female",
                            "ItemId": "(O)128"
+
                    "Age": "Teen",
                        },
+
                    "Manner": "Rude",
 +
                    "SocialAnxiety": "Outgoing",
 +
                    "Optimism": "Neutral",
 +
 
 +
                    "CanBeRomanced": true,
 +
                    "LoveInterest": "Abigail",
   −
                        // else guaranteed random House Plant item
+
                    "Home": [
 
                         {
 
                         {
                             "ID": "Example.ModId_RandomHousePlant",
+
                             "Id": "Default",
                             "ItemID": "RANDOM_ITEMS (F) 1376 1390"
+
                             "Location": "SeedShop",
 +
                            "Tile": { "X": 1, "Y": 9 },
 +
                            "Direction": "Left"
 
                         }
 
                         }
 
                     ]
 
                     ]
Line 3,239: Line 3,106:  
}</nowiki>|lang=javascript}}
 
}</nowiki>|lang=javascript}}
   −
Then you'd place an <code>Action: Garbage Example.ModId_Carpenter</code> [[Modding:Maps|map tile property]] to mark a tile as a garbage can using this data.
+
You can also add non-social NPCs which don't have birthdays or friendship points, accept gifts, give quests, etc:
 
  −
====Example change for existing garbage can====
  −
You can edit an existing garbage cans using only [[Modding:Content Patcher|Content Patcher]] or [[Modding:Modder Guide/APIs/Content|SMAPI's content API]]. For example, this content pack adds pufferfish to the Saloon garbage can, and moves it above the dish of the day.
  −
 
  −
Note that this uses <samp>TargetField</samp> to 'move into' the item list for the saloon, and then treat those items as the entry list being edited. Specifying an ID which isn't in the list will add a new entry, just like when editing a regular list asset.
  −
 
   
{{#tag:syntaxhighlight|<nowiki>
 
{{#tag:syntaxhighlight|<nowiki>
 
{
 
{
Line 3,252: Line 3,113:  
         {
 
         {
 
             "Action": "EditData",
 
             "Action": "EditData",
             "Target": "Data/GarbageCans",
+
             "Target": "Data/Characters",
            "TargetField": [ "GarbageCans", "Saloon", "Items" ],
   
             "Entries": {
 
             "Entries": {
                 // 25% chance of pufferfish
+
                 "{{ModId}}_Belwick": {
               
+
                    "DisplayName": "Belwick", // this would normally use {{i18n:}} to support translations
                "Example.ModId_Pufferfish":{
+
 
                     "ID": "Example.ModId_Pufferfish",
+
                    "SocialTab": "HiddenAlways",
                     "Condition": "RANDOM 0.25",
+
                     "CanSocialize": "FALSE",
                     "ItemId": "(O)128"
+
                     "IntroductionsQuest": false,
 +
                    "PerfectionScore": false,
 +
                     "EndSlideShow": true
 
                 }
 
                 }
             },
+
             }
            "MoveEntries": [
  −
                { "ID": "Example.ModId_Pufferfish", "BeforeId": "Base_DishOfTheDay" }
  −
            ]
   
         }
 
         }
 
     ]
 
     ]
 
}</nowiki>|lang=javascript}}
 
}</nowiki>|lang=javascript}}
   −
===Custom map actions===
+
===Custom NPC appearance===
C# mods can now handle custom <samp>Action</samp> & <samp>TouchAction</samp> [[Modding:Maps|map properties]] by calling <samp>GameLocation.RegisterTileAction</samp> & <samp>RegisterTouchAction</samp>, and passing a callback which receives the location, map property arguments, player who activated it, and tile position.
+
{{/doc status|[[Modding:NPC data]]|done=false}}
 +
 
 +
Each NPC can now have any number of custom portraits/sprites in <samp>Data/Characters</samp> with arbitrary conditions. This lets mods add features like indoor/outdoor outfits without the performance impact of reloading textures. If multiple outfits apply, the game will choose between them with a day-stable randomization.
 +
 
 +
For example, you can load indoor/outdoor outfits for a custom NPC to swap between automatically:
 +
<syntaxhighlight lang="js">
 +
// add base indoor/outdoor sprites
 +
{
 +
    "Action": "Load",
 +
    "Target": "Characters/Johnny_Indoor, Characters/Johnny_Outdoor, Portraits/Johnny_Indoor, Portraits/Johnny_Outdoor",
 +
    "FromFile": "assets/{{Target}}.png"
 +
},
   −
For example, let's say you want a locked gate which needs a custom key item. You can add a regular <code>TouchAction Example.ModId_UnlockGate</code> map property (e.g. by adding it directly in the map file, or using [[Modding:Content Patcher|Content Patcher]]'s <samp>EditMap</samp>, or using the [[Modding:Modder Guide/APIs/Content|content API]]). Then you can just handle the logic from your C# mod:
+
// apply any overlays needed
<syntaxhighlight lang="c#">
  −
internal class ModEntry : Mod
   
{
 
{
     /// <inheritdoc />
+
     "Action": "EditImage",
    public override void Entry(IModHelper helper)
+
    "Target": "Characters/Johnny_Indoor, Portraits/Johnny_Indoor",
     {
+
    "FromFile": "assets/overlays/{{Target}}_married.png",
         GameLocation.RegisterTouchAction("Example.ModId_UnlockGate", this.HandleUnlockGate);
+
     "When": {
 +
         "Spouse": "Johnny"
 
     }
 
     }
 +
},
   −
     private void HandleUnlockGate(GameLocation location, string[] args, Farmer player, Vector2 tile)
+
// add NPC
     {
+
{
         const string mailFlag = "Example.ModId_GateUnlocked";
+
     "Action": "EditData",
        const string keyId = "Example.ModId_GateKey";
+
    "Target": "Data/Characters",
 
+
     "Entries": {
        // unlock gate if locked
+
         "SomeMod.Id_Johnny": {
        if (!player.mailReceived.Contains(mailFlag))
+
            ...,
        {
+
            "Appearance": [
            if (!Game1.player.Items.ContainsId(id, count))
+
                {
            {
+
                    "Id": "Outdoors",
                Game1.activeClickableMenu = new DialogueBox("This gate is locked. I wonder where the key is?");
+
                    "Indoors": false,
                 return;
+
                    "Portrait": "Portraits/Johnny_Outdoor",
            }
+
                    "Sprite": "Characters/Johnny_Outdoor"
 
+
                },
             player.removeFirstOfThisItemFromInventory(keyId);
+
                {
            player.mailReceived.Add(mailFlag);
+
                    "Id": "Default",
 +
                    "Portrait": "Portraits/Johnny_Indoor",
 +
                    "Sprite": "Characters/Johnny_Indoor"
 +
                 }
 +
             ]
 
         }
 
         }
  −
        // apply open-gate map edit
  −
        // NOTE: this is a quick example which changes the location's current map. If another mod reloads the map
  −
        // (e.g. a content pack editing it), the change will be lost. For persistent changes, you should use the
  −
        // AssetRequested event to apply the change when the map is reloaded.
  −
        IAssetDataForMap mapHelper = this.Helper.GameContent.GetPatchHelper(location.map).AsMap();
  −
        mapHelper.PatchMap(
  −
            this.Helper.Content.Load<Map>("assets/unlocked-gate.tmx"),
  −
            targetArea: new Rectangle((int)tile.X - 1, (int)tile.Y - 1, 2, 2)
  −
        );
   
     }
 
     }
 
}
 
}
 
</syntaxhighlight>
 
</syntaxhighlight>
   −
===Custom map layers===
+
See the <samp>Appearance</samp> field in [[#Custom NPCs|custom NPC data]] for more info.
You can now add any number of [[Modding:Maps|map layers]] by suffixing a vanilla layer name (i.e. <samp>Back</samp>, <samp>Buildings</samp>, <samp>Front</samp>, or <samp>AlwaysFront</samp>) with an offset. For example, <samp>Back-1</samp> will be drawn before/under <samp>Back</samp>, and <samp>Back2</samp> will be drawn after/over it. You can increment the number to add more layers.
+
 
 +
===Custom farm animals===
 +
{{/doc status|[[Modding:Animal data]]|done=true}}
 +
 
 +
You can now create and edit [[Animals|farm animals]] by editing the revamped <samp>Data/FarmAnimals</samp> asset. This changes to a data model, adds built-in support for custom animals, and allows far more customizability per animal (like its size, growth, produce, appearance and sounds, etc).
 +
 
 +
===Custom pets===
 +
{{/doc status|[[Modding:Pets]]|done=true}}
 +
 
 +
* You can now create and customize [[Animals#Cat or Dog|pet]]s & pet breeds by editing the new <samp>Data/Pets</samp> asset.*
 +
* The pet bowl is now a building which can be constructed or moved. Each pet is assigned to an available pet bowl. For C# mods, each pet now has a <samp>guid</samp> field populated with a unique ID, and each pet bowl has a <samp>petGuid</samp> field which tracks its owner (see the <samp>PetBowl::HasPet()</samp> and <samp>PetBowl::FindPet()</samp> methods).
 +
* In the [[Modding:Event data#Basic format|event character setup]], you can now use <samp>pet</samp> to add a pet of the player's selected type. Its actor name will be <samp>PetActor</samp> in other event commands. This supersedes <samp>cat</samp> (with name <samp>Cat</samp>) and <samp>dog</samp> (with name <samp>Dog</samp>), though those still work too.
 +
* For C# mods:
 +
** All pets now use a generic <samp>Pet</samp> class, instead of <samp>Cat</samp> or <samp>Dog</samp>. The pet type is tracked by the pet's <samp>petType</samp> field.
 +
** The player's preferred pet type is tracked by <samp>Game1.player.whichPetType</samp>. The former <samp>catPerson</samp> field is now readonly and checks that field.
 +
** Added <samp>Pet.type_cat</samp> and <samp>Pet.type_dog</samp> constants for the default pet types.
 +
 
 +
===Custom monster eradication goals===
 +
{{/doc status|a new doc page|done=false}}
   −
This only affects layer rendering. Tile properties must still be set on the original layers.
+
: ''See also: [[#Monster eradication goal flag changes|Monster eradication goal flag changes]].''
   −
===Custom minecarts===
+
You can now add/edit [[Adventurer's Guild]] monster eradication goals by editing the new <samp>Data/MonsterSlayerQuests</samp> data asset.
You can now extend [[minecart]]s by editing the <samp>Data\Minecarts</samp> data asset.
      
This consists of a string → model lookup, where...
 
This consists of a string → model lookup, where...
* The key is a [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for the minecart network. When you interact with a minecart, the destinations listed for its network are shown.
+
* The key is a [[Modding:Common data field types#Unique string ID|unique string ID]] for the monster eradication goal.
 
* The value is a model with the fields listed below.
 
* The value is a model with the fields listed below.
   Line 3,331: Line 3,212:  
! effect
 
! effect
 
|-
 
|-
| <samp>Destinations</samp>
+
| <samp>DisplayName</samp>
| The destinations which the player can travel to from minecarts in this network. This consists of a list of model with these fields:
+
| A [[Modding:Tokenizable strings|tokenizable string]] for the goal's display name, shown on the board in the Adventurer's Guild.
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>Targets</samp>
! effect
+
| A list of [[Modding:Monster data#Monster IDs|monster IDs]] that are counted towards the <samp>Count</samp>.
 
|-
 
|-
| <samp>Id</samp>
+
| <samp>Count</samp>
| A [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for this destination within the network.
+
| The total number of monsters (matching the <samp>Targets</samp>) which must be defeated to complete this goal.
 
|-
 
|-
| <samp>DisplayName</samp>
+
| <samp>RewardItemId</samp>
| A [[Modding:Tokenizable strings|tokenizable string]] for the destination name shown in the minecart menu. You can use the location's display name with the <samp>LocationName</samp> token (like <code>[LocationName Desert]</code> for the [[desert]]).
+
| ''(Optional)'' The [[#Custom items|qualified ID]] for the item that can be collected from [[Gil]] when this goal is completed. Default none.
 
|-
 
|-
| <samp>TargetLocation</samp>
+
| <samp>RewardItemPrice</samp>
| The [[#Custom locations|location ID]] for the destination.
+
| ''(Optional)'' The price of the <samp>RewardItemId</samp> in [[Marlon]]'s shop after the goal is completed, or -1 to disable buying it from Marlon. Default -1.
 
|-
 
|-
| <samp>TargetTile</samp>
+
| <samp>RewardDialogue</samp><br /><samp>RewardDialogueFlag</samp>
| The destination tile position within the location, specified as a model with <samp>X</samp> and <samp>Y</samp> fields.
+
| ''(Optional)'' A [[Modding:Tokenizable strings|tokenizable string]] for custom [[Gil]] dialogue shown when talking to him after completing the goal, and an optional [[Modding:Mail data|mail flag]] to set when the player has seen the dialogue. Both default to none.
 +
 
 +
If there are reward items, they're shown after this dialogue.
 +
 
 +
If <samp>RewardDialogue</samp> is used without <samp>RewardDialogueFlag</samp>, then this dialogue will be shown each time the reward menu is opened after completing the goal, until the player collects the reward items. If the <samp>RewardItems</samp> isn't set, this can safely be omitted since the goal will be marked collected immediately.
 +
 
 +
This doesn't send a letter; see <samp>RewardMail</samp> or <samp>RewardMailAll</samp> for that.
 
|-
 
|-
| <samp>TargetDirection</samp>
+
| <samp>RewardFlag</samp><br /><samp>RewardFlagAll</samp>
| The direction the player should face after arrival (one of <samp>down</samp>, <samp>left</samp>, <samp>right</samp>, or <samp>up</samp>).
+
| ''(Optional)'' The [[Modding:Mail data|mail flag ID]] to set for the current player (<samp>RewardFlag</samp>) or all players (<samp>RewardFlagAll</samp>) when talking to [[Gil]] after completing the goal. Default none.
 +
 
 +
Note that <samp>RewardFlag</samp> is usually not needed, since the game will also set a <samp>Gil_{{t|goal ID}}</samp> flag regardless.
 +
 
 +
This doesn't send a letter; see <samp>RewardMail</samp> or <samp>RewardMailAll</samp> for that.
 
|-
 
|-
| <samp>Condition</samp>
+
| <samp>RewardMail</samp><br /><samp>RewardMailAll</samp>
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether this minecart destination is available. Defaults to always available.
+
| ''(Optional)'' The mail letter ID to add to the mailbox tomorrow for the current player (<samp>RewardMail</samp>) or all players (<samp>RewardMailAll</samp>). Default none.
|-
  −
| <samp>Price</samp>
  −
| ''(Optional)'' The gold price that must be paid each time to use this destination. Default none.
  −
|-
  −
| <samp>BuyTicketMessage</samp>
  −
| ''(Optional)'' If the destination costs money to use, a [[Modding:Tokenizable strings|tokenizable string]] for the purchase confirmation message shown. If present, <code>{0}</code> is replaced with the purchase price. Defaults to the network's <samp>BuyTicketMessage</samp> field.
   
|-
 
|-
 
| <samp>CustomFields</samp>
 
| <samp>CustomFields</samp>
| ''(Optional)'' The [[#Custom data fields|custom fields]] for this entry.
+
| The [[#Custom data fields|custom fields]] for this entry.
|}
  −
|-
  −
| <samp>UnlockCondition</samp>
  −
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether this minecart network is unlocked. Default always enabled.
  −
|-
  −
| <samp>LockedMessage</samp>
  −
| ''(Optional)'' A [[Modding:Tokenizable strings|tokenizable string]] for the message shown when interacting with a minecart when the <samp>UnlockCondition</samp> false. Defaults to an "''Out of order''" translation.
  −
|-
  −
| <samp>ChooseDestinationMessage</samp>
  −
| ''(Optional)'' A [[Modding:Tokenizable strings|tokenizable string]] for the message shown when listing destinations to choose from. Defaults to a "''Choose destination:''" translation.
  −
|-
  −
| <samp>BuyTicketMessage</samp>
  −
| ''(Optional)'' When a destination costs money to use, a [[Modding:Tokenizable strings|tokenizable string]] for the purchase confirmation message shown. If present, <code>{0}</code> is replaced with the purchase price. Defaults to a "''Buy a ticket for {0}g?''" translation.
   
|}
 
|}
   −
====Open a minecart menu====
+
===Custom phone calls===
You can use an <samp>Action: MinecartTransport {{o|network ID}} {{o|exclude destination ID}}</samp> [[Modding:Maps|map property]] to open the minecart menu. When the player interacts with the tile, it'll open the menu for the {{o|network ID}} network (default <samp>Default</samp>). if {{o|exclude destination ID}} is specified, the matching destination will be hidden from the list (usually because you're at that minecart). For example, the [[Bus Stop|bus stop]] minecart uses <code>Action: MinecartTransport Default Bus</code>.
+
{{/doc status|a new doc page|done=false}}
   −
From a C# mod, you can call <code>Game1.currentLocation.ShowMineCartMenu(networkId, excludeDestinationId)</code> which works the same way (except that <samp>networkId</samp> is required).
+
Mods can now extend the [[telephone]] with custom calls (both incoming calls, and phone numbers which the player can call).
   −
====Example====
+
====Incoming calls====
This [[Modding:Content Patcher|Content Patcher]] content pack adds the [[Railroad]] as a minecart destination, complete with a map edit adding a decorative minecart. It is available after the [[Random Events|Earthquake]] has occurred and minecarts have been unlocked.
+
You can add or customize incoming calls by editing the <samp>Data/IncomingPhoneCalls</samp> asset.
   −
{{#tag:syntaxhighlight|<nowiki>
+
This consists of a string → model lookup, where...
{
+
* The key is a [[Modding:Common data field types#Unique string ID|unique string ID]] for the incoming call data.
    "Format": "</nowiki>{{Content Patcher version}}<nowiki>",
+
* The value is a model with the fields listed below.
    "Changes": [
  −
        // add minecart destination
  −
        {
  −
            "Action": "EditData",
  −
            "Target": "Data/Minecarts",
  −
            "TargetField": [ "Default", "Destinations" ], // for the "Default" network, edit the "Destinations" field
  −
            "Entries": {
  −
                "Railroad": {
  −
                    "Id": "Railroad",
  −
                    "DisplayName": "[LocationName Railroad]",
  −
                    "Condition": "LOCATION_ACCESSIBLE Railroad",
  −
 
  −
                    "TargetLocation": "Railroad",
  −
                    "TargetTile": { "X": 16, "Y": 39 },
  −
                    "TargetDirection": "down",
  −
                }
  −
            }
  −
        },
  −
 
  −
        // add decorative minecart
  −
        {
  −
            "Action": "EditMap",
  −
            "Target": "Maps/Railroad",
  −
            "FromFile": "assets/Custom_Railroad_Minecart.tmx",
  −
            "ToArea": { "X": 15, "Y": 35, "Width": 4, "Height": 5 }
  −
        }
  −
    ]
  −
}</nowiki>|lang=javascript}}
     −
===Custom passive festivals===
  −
You can now add or modify passive festivals by editing the <samp>Data/PassiveFestivals</samp> asset.
  −
  −
(A ''passive festival'' is a [[festivals|festival]] like the [[Night Market]]. They replace a location for a period of time, the player can enter/leave them anytime, and time continues passing while at the festival.)
  −
  −
====Data format====
  −
The <samp>Data/PassiveFestivals</samp> asset consists of a string → model lookup, where...
  −
* The key is a [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for the festival.
  −
* The value is a model with the fields listed below.
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 3,433: Line 3,267:  
! effect
 
! effect
 
|-
 
|-
| <samp>DisplayName</samp>
+
| <samp>Dialogue</samp>
| A [[Modding:Tokenizable strings|tokenizable string]] for the display name shown on the [[calendar]].
+
| The dialogue text to show when the player answers the phone. This can use the full [[Modding:Dialogue|dialogue format]] (including questions and different dialogue based on the selected answer).
 
|-
 
|-
| <samp>Season</samp>
+
| <samp>FromNpc</samp>
| The [[season]] when the festival becomes active.
+
| ''(Optional)'' The internal name of the NPC making the call. If specified, that NPC's name and portrait will be shown.
 
|-
 
|-
| <samp>StartDay</samp><br /><samp>EndDay</samp>
+
| <samp>FromPortrait</samp>
| The days of month when the festival becomes active.
+
| ''(Optional)'' The asset name for the portrait spritesheet to display (like <samp>Portraits/Abigail</samp>). If <samp>FromNpc</samp> is specified too, this overrides the portrait from that NPC. If both <samp>FromNpc</samp> and <samp>FromDisplayName</samp> are null, this portrait will be shown with the display name "???".
 
|-
 
|-
| <samp>StartTime</samp>
+
| <samp>FromDisplayName</samp>
| The time of day when the festival opens each day.
+
| ''(Optional)'' A [[Modding:Tokenizable strings|tokenizable string]] for the calling NPC's display name. If <samp>FromNpc</samp> is specified too, this overrides the display name from that NPC.
 
|-
 
|-
| <samp>StartMessage</samp>
+
| <samp>MaxCalls</samp>
| A [[Modding:Tokenizable strings|tokenizable string]] for the in-game [[wikipedia:Pop-up notification|toast notification]] shown when the festival begins each day.
+
| ''(Optional)'' The maximum number of times a player can receive this phone call, or <samp>-1</samp> for no limit. Default 1.
 
|-
 
|-
| <samp>MapReplacements</samp>
+
| <samp>TriggerCondition</samp><br /><samp>RingCondition</samp>
| The locations to swap for the duration of the festival. Despite the field name, this swaps '''locations''' (e.g. as added by <samp>CustomLocations</samp> using [[Modding:Content Patcher|Content Patcher]]), and not the location's map asset.
+
| ''(Optional)'' If set, a game state query which indicates whether to trigger this phone call (<samp>TriggerCondition</samp>) or whether the phone rings when this call is received (<samp>RingCondition</samp>).
   −
This is specified as a string → string lookup, where the key is the original location to replace and the value is the new location. Both use the internal location name, as shown by the {{nexus mod|679|Debug Mode}} mod. For example, this swaps the <samp>Beach</samp> location with <samp>BeachNightMarket</samp> during the [[Night Market]]:
+
Whether a player receives this call depends on both fields: <samp>TriggerCondition</samp> is checked on the main player before sending the call to all players, then <samp>RingCondition</samp> is checked on each player to determine whether the phone rings for them.
<syntaxhighlight lang="js">
  −
"MapReplacements": {
  −
    "Beach": "BeachNightMarket"
  −
}
  −
</syntaxhighlight>
   
|-
 
|-
| <samp>Condition</samp>
+
| <samp>IgnoreBaseChance</samp>
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether the festival is enabled (subject to the other fields like <samp>StartDay</samp> and <samp>EndDay</samp>). Defaults to always enabled.
+
| ''(Optional)'' Whether to ignore the 1% base chance when checking whether to trigger an incoming call. If true, the game will check if this call can be received regardless of the base chance. Default false.
 
|-
 
|-
| <samp>ShowOnCalendar</samp>
+
| <samp>SimpleDialogueSplitBy</samp>
| ''(Optional)'' Whether the festival appears on the [[calendar]], using the same iridium-star icon as the [[Calendar#Winter|Night Market]]. Default true.
+
| ''(Optional, specialized)'' If set, marks the call as having a simple dialogue string without an NPC name and portrait, with lines split into multiple boxes by this substring. For example, <code>"SimpleDialogueSplitBy": "#"</code> will split <code>Box A#Box B#Box C</code> into three consecutive dialogue boxes.
|-
  −
| <samp>DailySetupMethod</samp><br /><samp>CleanupMethod</samp>
  −
| ''(Optional)'' A C# method which applies custom logic when the day starts (<samp>DailySetupMethod</samp>) and/or overnight after the last day of the festival (<samp>CleanupMethod</samp>).
     −
These must be specified in the form <samp>{{t|full type name}}.{{t|method name}}</samp>. The methods must be static, take zero arguments, and return void.
+
You should omit this in most cases, and use the regular dialogue format in <samp>Dialogue</samp> to split lines if needed. This is mainly intended to support some older vanilla phone calls.
 
|-
 
|-
 
| <samp>CustomFields</samp>
 
| <samp>CustomFields</samp>
Line 3,473: Line 3,299:  
|}
 
|}
   −
====NPC schedules====
+
====Custom handlers in C#====
When a passive festival is active, NPCs will check for [[Modding:Schedule data|a schedule entry]] in this order:
+
C# mods can implement <samp>StardewValley.PhoneCalls.IPhoneHandler</samp> and add it to <samp>Phone.PhoneHandlers</samp> for full control over both incoming and outgoing calls:
   −
{| class="wikitable"
+
<syntaxhighlight lang="c#">
|-
+
/// <summary>The mod entry point.</summary>
! syntax
+
internal sealed class ModEntry : Mod
! summary
+
{
|-
+
    /// <inheritdoc />
| <samp>{{t|festival ID}}_{{t|festival day}}</samp>
+
    public override void Entry(IModHelper helper)
| Applies on the given date. The {{t|festival day}} is relative, so <samp>1</samp> matches the festival <samp>StartDay</samp>.<br /><small>Example: <samp>NightMarket_3</samp> or <samp>marriage_NightMarket_3</samp></small>
+
    {
|-
+
        Phone.PhoneHandlers.Add(new CustomPhoneHandler());
| <samp>{{t|festival ID}}</samp>
+
    }
| Applies if there's no date-specific entry.<br /><small>Example: <samp>NightMarket</samp> or <samp>marriage_NightMarket</samp></small>
+
}
|}
     −
If the NPC is married to a player, they'll add a <samp>marriage_</samp> prefix to the keys (like <samp>marriage_{{t|festival ID}}_{{t|festival day}}</samp>) and ignore any entry without the prefix.
+
/// <summary>A custom phone handler.</summary>
 
+
internal sealed class CustomPhoneHandler : IPhoneHandler
===Custom weather===
+
{
You can now change the weather algorithm by editing [[#Custom location contexts|location context data]], and (with a C# mod) implement custom weathers.
+
    ...
 +
}
 +
</syntaxhighlight>
   −
Fields like <samp>Game1.weather</samp> and <samp>Game1.weatherForTomorrow</samp> are now strings to support custom mod weather IDs. The change for vanilla weather has no effect on Content Patcher packs, since the new weather IDs match the ones Content Patcher was using before (i.e. <samp>Sun</samp>, <samp>Rain</samp>, <samp>Snow</samp>, <samp>Storm</samp>, and <samp>Wind</samp>). C# mods may also see a <samp>Festival</samp> weather, while Content Patcher packs will see <samp>Sun</samp> for it. The constants like <samp>Game1.weather_sunny</samp> have the new string values (with new constants like <samp>Game1.legacy_weather_sunny</samp> for the legacy values).
+
See <samp>StardewValley.PhoneCalls.DefaultPhoneHandler</samp> in the [[Modding:Modder Guide/Get Started#decompile|decompiled game code]] for an example implementation.
   −
The base game will treat an invalid weather as sunny. C# mods can implement custom weather effects using [[Modding:Modder Guide/APIs/Events|normal SMAPI events]] like <samp>UpdateTicked</samp>, or by [[Modding:Modder Guide/APIs/Harmony|patching]] methods like <samp>Game1.ApplyWeatherForNewDay</samp> and <samp>Game1.populateDebrisWeatherArray</samp>.
+
===Custom shops===
 +
{{/doc status|[[Modding:Shops]]|done=true}}
   −
===Custom world maps===
+
You can now create and edit shops via the new <samp>Data/Shops</samp> asset. See [[Modding:Shops]] for documentation and examples.
[[File:Modding map area.png|thumb|The default world map, with the farm map area highlighted.]]
     −
You can now change the world map shown in the game menu by editing the <samp>Data/WorldMap</samp> asset. This lets you...
+
===Dialogue changes===
* add custom maps for certain locations;
+
{{/doc status|[[Modding:Dialogue]]|done=false}}
* apply texture overlays;
  −
* add/edit tooltips;
  −
* set real-time player marker positioning;
  −
* etc.
     −
The game's default map is fully defined in <samp>Data/WorldMap</samp>, including all the display text and conditional changes.
+
<ul>
 
+
<li>Added new [[Modding:Dialogue|dialogue]] keys:
See [[Modding:World map]] for more info.
  −
 
  −
===New map properties===
  −
1.6 adds several new [[Modding:Maps|map properties]].
  −
 
  −
====Building construction====
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! property
+
! asset
! explanation
+
! key format
 +
! description
 +
|-
 +
|rowspan="22"| <samp>Characters/Dialogue/&lt;name&gt;</samp>
 
|-
 
|-
| <samp>CanBuildHere T</samp><br />''(valid in any outdoor location)''
+
| <samp>AcceptBirthdayGift_{{t|id}}</samp><br /><samp>AcceptBirthdayGift_{{t|tag}}</samp><br /><samp>AcceptBirthdayGift_{{t|taste}}</samp><br /><samp>AcceptBirthdayGift_Negative</samp><br /><samp>AcceptBirthdayGift_Positive</samp><br /><samp>AcceptBirthdayGift</samp>
| Whether to allow constructing buildings in this location. The game will adjust automatically to account for it (e.g. Robin will let you choose where to build). See [[#Build anywhere|''build anywhere'' in what's new]].
+
| Shown when receiving a birthday gift from the player. If omitted, defaults to the generic translations for all NPCs.
 +
 
 +
The first matching dialogue is used in this order:
 +
# by item ID (like <samp>AcceptBirthdayGift_(O)128</samp>);
 +
# by context tag (like <samp>AcceptBirthdayGift_category_fish</samp>);
 +
# by gift taste (one of <samp>AcceptBirthdayGift_Loved</samp>, <samp>AcceptBirthdayGift_Liked</samp>, <samp>AcceptBirthdayGift_Neutral</samp>, <samp>AcceptBirthdayGift_Disliked</samp>, or <samp>AcceptBirthdayGift_Hated</samp>);
 +
# <samp>AcceptBirthdayGift_Negative</samp> (hated or disliked gift) or <samp>AcceptBirthdayGift_Positive</samp> (neutral, liked, or loved gift);
 +
# for all items (via <samp>AcceptBirthdayGift</samp>).
 +
 
 
|-
 
|-
| <samp>BuildConditions {{t|query}}</samp><br />''(valid in any outdoor location)''
+
| <samp>AcceptBouquet</samp>
| If <samp>CanBuildHere</samp> is set, an optional [[Modding:Game state queries|game state query]] which indicates whether building is allowed currently.
+
| Shown when the NPC accepts a [[bouquet]] from the player. Defaults to a generic dialogue.
 
|-
 
|-
| <samp>LooserBuildRestrictions T</samp><br />''(valid in any outdoor location)''
+
| <samp>AcceptGift_{{t|id}}</samp><br /><samp>AcceptGift_{{t|tag}}</samp>
| If set, tiles don't need to be marked <samp>Buildable T</samp> or <samp>Diggable T</samp> in their properties. Tiles can be blocked with <samp>Buildable F</samp> instead. The other restrictions still apply.
+
| Shown when receiving a non-birthday gift from the player. This can be by item ID (like <samp>AcceptGift_(O)128</samp>) or context tag (like <samp>AcceptGift_category_fish</samp>). If omitted, defaults to the dialogue in <samp>Data/NPCGiftTastes</samp>.
 
|-
 
|-
| <samp>ValidBuildRect {{t|x}} {{t|y}} {{t|width}} {{t|height}}</samp><br />''(valid in any outdoor location)''
+
| <samp>DumpsterDiveComment</samp>
| The tile area within the map where buildings may be placed. If omitted, buildings may be placed in any open space in the map.
+
| Shown when the NPC catches the player digging through a trash can. Defaults to a generic dialogue based on the NPC's age.
|}
  −
 
  −
====Crops====
  −
{| class="wikitable"
   
|-
 
|-
! property
+
| <samp>HitBySlingshot</samp>
! explanation
+
| Shown when the player shoots them with a [[slingshot]]. Defaults to a generic dialogue.
 
|-
 
|-
| <samp>AllowGiantCrops T</samp>
+
| <samp>RejectBouquet_Divorced</samp><br /><samp>RejectBouquet_NotDatable</samp><br /><samp>RejectBouquet_NpcAlreadyMarried</samp><br /><samp>RejectBouquet_VeryLowHearts</samp><br /><samp>RejectBouquet_LowHearts</samp><br /><samp>RejectBouquet</samp>
| If set with any non-blank value, [[Crops#Giant Crops|giant crops]] can grow in this location (if crops are also allowed per the [[#Custom crops|crop data]] or [[#Custom location contexts|<samp>PlantableLocations</samp> context field]]).
+
| Shown when the NPC rejects a [[bouquet]].
 +
 
 +
A specific dialogue is shown if possible:
 +
* <samp>RejectBouquet_Divorced</samp>: the NPC won't accept this bouquet because you divorced them.
 +
* <samp>RejectBouquet_NotDatable</samp>: the NPC isn't romanceable.
 +
* <samp>RejectBouquet_NpcAlreadyMarried</samp>: the NPC is already married to another player. You can use <samp>{0}</samp> in the dialogue for the other player's name.
 +
* <samp>RejectBouquet_VeryLowHearts</samp>: you have less than 4 hearts with the NPC.
 +
* <samp>RejectBouquet_LowHearts</samp>: you have less than 8 hearts with the NPC.
 +
 
 +
If the specific dialogue isn't set, the game will use the <samp>RejectBouquet</samp> dialogue (if set), else it'll default to generic dialogue for each case.
 
|-
 
|-
| <samp>DirtDecayChance {{t|chance}}</samp>
+
| <samp>RejectGift_Divorced</samp>
| The probability that each dirt tile will disappear overnight if it doesn't contain a crop, as a value between 0 (never) and 1 (always). Defaults to 0 (greenhouses), 0.1 (farms), and 1 (anywhere else).
+
| Shown when the NPC rejects a gift because you divorced them.
|}
  −
 
  −
====Farmhouse interior====
  −
{| class="wikitable"
   
|-
 
|-
! property
+
| <samp>RejectItem_{{t|id}}</samp><br /><samp>RejectItem_{{t|tag}}</samp>
! explanation
+
| If set, the NPC will refuse to accept any matching item and show this dialogue instead. This can be by item ID (like <samp>RejectItem_(O)128</samp>) or context tag (like <samp>RejectItem_category_fish</samp>). This can prevent gifting, movie tickets, bouquets, mermaid pendants, etc. However it won't prevent accepting an item for an active quest or special order.
 
|-
 
|-
| <samp>FarmHouseStarterGift [{{t|id}} {{o|count}}]+</samp>
+
| <samp>RejectMermaidPendant_Divorced</samp><br /><samp>RejectMermaidPendant_NeedHouseUpgrade</samp><br /><samp>RejectMermaidPendant_NotDatable</samp><br /><samp>RejectMermaidPendant_NpcWithSomeoneElse</samp><br /><samp>RejectMermaidPendant_PlayerWithSomeoneElse</samp><br /><samp>RejectMermaidPendant_Under8Hearts</samp><br /><samp>RejectMermaidPendant_Under10Hearts</samp><br /><samp>RejectMermaidPendant_Under10Hearts_AskedAgain</samp><br /><samp>RejectMermaidPendant</samp>
| The items that should appear in the initial gift box placed in the farmhouse when the save is created. This consists of one or more pairs of item ID (which can be qualified or unqualified) and count. The count is optional on the last entry.
+
| Shown when the NPC rejects a [[Mermaid's Pendant|mermaid's pendant]].
   −
For example, this will add 10 pufferfish (object 128) and a blobfish mask (hat 56):
+
A specific dialogue is shown if possible. The cases are checked in this order:
<pre>FarmHouseStarterGift (O)128 10 (H)56 1</pre>
+
# <samp>RejectMermaidPendant_PlayerWithSomeoneElse</samp>: the player is already engaged or married to someone else. You can use <samp>{0}</samp> in the dialogue for the player's spouse name.
 +
# <samp>RejectMermaidPendant_NotDatable</samp>: the NPC isn't romanceable.
 +
# <samp>RejectMermaidPendant_Divorced</samp>: you divorced them, so they won't accept gifts or proposals from you.
 +
# <samp>RejectMermaidPendant_NpcWithSomeoneElse</samp>: the NPC is already engaged or married to someone else. You can use <samp>{0}</samp> in the dialogue for the other player's name.
 +
# <samp>RejectMermaidPendant_Under8Hearts</samp>: you have under 8 hearts with the NPC.
 +
# <samp>RejectMermaidPendant_Under10Hearts</samp>: you have under 10 hearts with the NPC.
 +
# <samp>RejectMermaidPendant_Under10Hearts_AskedAgain</samp>: you have under 10 hearts with the NPC, and asked again after they already said no. (Defaults to the previous dialogue if not set.)
 +
# <samp>RejectMermaidPendant_NeedHouseUpgrade</samp>: you need to upgrade your house before they can accept.
   −
If omitted, the default items (usually a 15 parsnip seeds) are added instead.
+
If the specific dialogue isn't set, the game will use the <samp>RejectMermaidPendant</samp> dialogue (if set), else it'll default to generic dialogue for each case.
|}
+
|-
 +
| <samp>RejectMovieTicket_AlreadyInvitedBySomeoneElse</samp><br /><samp>RejectMovieTicket_AlreadyWatchedThisWeek</samp><br /><samp>RejectMovieTicket_Divorced</samp><br /><samp>RejectMovieTicket_DontWantToSeeThatMovie</samp><br /><samp>RejectMovieTicket</samp>
 +
| Show when the NPC rejects a [[Movie Ticket|movie ticket]].
   −
====Warps & map positions====
+
A specific dialogue is shown if possible:
{| class="wikitable"
+
* <samp>RejectMovieTicket_AlreadyInvitedBySomeoneElse</samp>: someone else already invited the NPC to a movie. You can use <samp>{0}</samp> in the dialogue for the other player's name.
 +
* <samp>RejectMovieTicket_AlreadyWatchedThisWeek</samp>: the NPC already watched a movie this week.
 +
* <samp>RejectMovieTicket_Divorced</samp>: you divorced the NPC, so they won't accept gifts from you.
 +
* <samp>RejectMovieTicket_DontWantToSeeThatMovie</samp>: the movie data marks that NPC as unwilling to watch it (e.g. kids for horror movies).
 +
 
 +
If the specific dialogue isn't set, the game will use the <samp>RejectMovieTicket</samp> dialogue (if set), else it'll default to generic dialogue for each case.
 
|-
 
|-
! property
+
| <samp>SpouseFarmhouseClutter</samp>
! explanation
+
| Shown by an NPC spouse when they couldn't pathfind to their kitchen standing spot in the farmhouse.
 
|-
 
|-
| <samp>AllowWakeUpWithoutBed {{t|allow}}</samp>
+
| <samp>SpouseGiftJealous</samp>
| Whether the player can wake up in this location without a bed, similar to the island farmhouse. This is typically used with <samp>PassOutLocations</samp> in [[#Custom location contexts|<samp>Data/LocationContexts</samp>]].
+
| Shown by an NPC spouse when you gave a gift to another eligible NPC of the same gender as your spouse (unless it's their birthday). You can use <samp>{0}</samp> in the dialogue for the other NPC's name, and <samp>{1}</samp> for the gifted item name.
 
|-
 
|-
| <samp>DefaultWarpLocation {{t|x}} {{t|y}}</samp><br />''(valid in any location)''
+
| <samp>Spouse_MonstersInHouse</samp>
| The default arrival tile, used when a player or NPC is added to the location without a target tile (e.g. using [[Modding:Console commands|debug commands]] like <samp>debug warp</samp> or <samp>debug eventbyid</samp>).
+
| Shown by an NPC spouse when they're in the farmhouse and there's a monster close to them.
 
|-
 
|-
| <samp>PetBowlLocation {{t|x}} {{t|y}}</samp><br />''(valid in the farm)''
+
| <samp>SpouseStardrop</samp>
| The default position of the pet bowl
+
| Shown when receiving the [[stardrop]] from your spouse.
 
|-
 
|-
| <samp>SpouseRoomPosition {{t|x}} {{t|y}}</samp><br />''(valid in farmhouse)''
+
| <samp>Fair_Judging</samp>
| The top-left position at which to place the [[Marriage#Spouse Rooms|spouse room]].
+
| Shown at the [[Stardew Valley Fair]] while Lewis is judging the grange displays. If omitted, the NPC will keep their normal festival dialogue.
 +
 
 +
If this is set without <samp>Fair_Judged*</samp>, the NPC will keep this dialogue after judging is done.
 +
 
 +
''This replaces the previously hardcoded translations in <samp>Strings/StringsFromCSFiles</samp>: <samp>Event.cs.1602</samp> (Marnie), <samp>Event.cs.1604</samp> (Pierre), and <samp>Event.cs.1606</samp> (Willy).''
 
|-
 
|-
| <samp>TravelingCartPosition {{t|x}} {{t|y}}</samp><br />''(valid in the forest)''
+
| <samp>Fair_Judged_PlayerLost_PurpleShorts</samp><br /><samp>Fair_Judged_PlayerLost_Skipped</samp><br /><samp>Fair_Judged_PlayerLost</samp><br /><samp>Fair_Judged_PlayerWon</samp><br /><samp>Fair_Judged</samp>
| The top-left position at which to place the [[Traveling Cart]]. This is the top-left corner of the collision box, so the roof will extend two tiles above this tile.
+
| Shown at the [[Stardew Valley Fair]] after Lewis finishes judging the grange displays.
|}
+
 
 +
The first matching dialogue is used in this order:
 +
# <samp>Fair_Judged_PlayerLost_PurpleShorts</samp>: the player put the [[Secrets#Lucky Purple Shorts|lucky purple shorts]] in their display (which is an automatic loss).  Defaults to <samp>Fair_Judged_PlayerLost</samp> if omitted.
 +
# <samp>Fair_Judged_PlayerLost_Skipped</samp>: the player didn't put anything in their display. Defaults to <samp>Fair_Judged_PlayerLost</samp> if omitted.
 +
# <samp>Fair_Judged_PlayerLost</samp> or <samp>Fair_Judged_PlayerWon</samp>: the player didn't/did win first place. Defaults to <samp>Fair_Judged</samp> if omitted.
 +
# <samp>Fair_Judged</samp>: shown if a more specific dialogue didn't match. If omitted, the NPC will keep their current dialogue.
   −
===Other map property changes===
+
''These replace the previously hardcoded translations in <samp>Strings/StringsFromCSFiles</samp>: <samp>Event.cs.1591</samp> (Pierre when he won), <samp>Event.cs.1593</samp> (Pierre when the player won), <samp>Event.cs.1595</samp> (Marnie), <samp>Event.cs.1597</samp> (Willy), and <samp>Event.cs.1600</samp> (Marnie for the purple shorts).''
{| class="wikitable"
   
|-
 
|-
! map property
+
| <samp>FlowerDance_Accept_Roommate</samp><br /><samp>FlowerDance_Accept_Spouse</samp><br /><samp>FlowerDance_Accept</samp>
! changes
+
| Shown at the [[Flower Dance]] when the NPC agrees to dance. The game will prefer the <samp>_Roommate</samp> (if roommates) or <samp>_Spouse</samp> (if married) variant if applicable, else it'll check for the normal key. If omitted, defaults to a generic accept dialogue.
 +
 
 +
''This replaces the previously hardcoded translations in <samp>Strings/StringsFromCSFiles</samp> (<samp>Event.cs.1613</samp>, <samp>Event.cs.1615</samp>, <samp>Event.cs.1617</samp>, <samp>Event.cs.1619</samp>, <samp>Event.cs.1621</samp>, <samp>Event.cs.1623</samp>, <samp>Event.cs.1625</samp>, <samp>Event.cs.1627</samp>, <samp>Event.cs.1629</samp>, and <samp>Event.cs.1631</samp>).''
 
|-
 
|-
| <samp>Arch</samp><br /><samp>asdf</samp><br /><samp>Debris</samp><br /><samp>Fish</samp>
+
| <samp>FlowerDance_Decline</samp>
| Removed (these were unused).
+
| Shown at the [[Flower Dance]] when the NPC declines to dance. This replaces the former <samp>danceRejection</samp> key (which still works as a fallback).
 
|-
 
|-
| <samp>FarmHouseFlooring</samp><br /><samp>FarmHouseFurniture</samp><br /><samp>FarmHouseStarterSeedsPosition</samp><br /><samp>FarmHouseWallpaper</samp>
+
| <samp>WinterStar_GiveGift_Before_Roommate</samp><br /><samp>WinterStar_GiveGift_Before_Spouse</samp><br /><samp>WinterStar_GiveGift_Before</samp><br /><samp>WinterStar_GiveGift_After_Roommate</samp><br /><samp>WinterStar_GiveGift_After_Spouse</samp><br /><samp>WinterStar_GiveGift_After</samp>
| These now work independently. For example, you can now use <samp>FarmHouseFlooring</samp> without needing to set <samp>FarmHouseFurniture</samp> too.
+
| Shown at the [[Feast of the Winter Star]] when the NPC gives the player their gift (before and after the player opens it). The game will prefer the <samp>_Roommate</samp> (if roommates) or <samp>_Spouse</samp> (if married) variant if applicable, else it'll check for the normal key. If omitted, the before/after dialogues each separately default to a generic translation for all NPCs.
 
|-
 
|-
| <samp>Music</samp>
+
| <samp>WinterStar_ReceiveGift_{{t|id}}</samp><br /><samp>WinterStar_ReceiveGift_{{t|tag}}</samp><br /><samp>WinterStar_ReceiveGift</samp>
| Deprecated; use the music fields in [[#Custom locations|<samp>Data/Locations</samp>]] instead. This property is only applied if the location has no music in <samp>Data/Locations</samp>. This was removed from all vanilla maps.
+
| Shown at the [[Feast of the Winter Star]] when receiving their gift from the player. This can be by item ID (like <samp>WinterStar_ReceiveGift_(O)128</samp>), context tag (like <samp>WinterStar_ReceiveGift_category_fish</samp>), or for any item (like <samp>WinterStar_ReceiveGift</samp>). If omitted, defaults to the generic translation for all NPCs.
 
|-
 
|-
| <samp>NPCWarp</samp><br /><samp>Warp</samp>
+
| <samp>WipedMemory</samp>
| Now fault-tolerant. They'll automatically ignore extra spaces, log an informative warning if parsing still fails, and continue with the next warp if possible.
+
| Shown the first time you talk to the NPC after erasing their memory using the [[Dark Shrine of Memory]].
|-
  −
| <samp>Stumps</samp>
  −
| Now works in all locations.
  −
|-
  −
| <samp>UniquePortrait</samp><br /><samp>UniqueSprite</samp>
  −
| Deprecated; use [[#Custom NPC appearance|custom NPC appearances]] instead. These properties will override NPC appearances. This was removed from all vanilla maps.
   
|}
 
|}
 
+
</li>
===Tile property changes===
+
<li>Added new [[Modding:Dialogue|dialogue]] commands:
<ul>
  −
<li>You can now override a tile index property by setting it as a tile property.</li>
  −
<li>Added new <samp>Action</samp> [[Modding:Maps|tile properties]]:
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! layer
+
! command
! property
+
! description
! explanation
+
|- id="gender-switch"
 +
| <samp>${male^female}$</samp><br /><samp>${male^female^non-binary}$</samp>
 +
| Change text depending on the player's gender. This largely supersedes the <samp>^</samp> dialogue token (which still works), and is supported in many more places than that token. This is applied before most other commands or parsing, so it can safely be used in cases where <samp>^</samp> might have a different meaning (e.g. mail text). For example: <code>Ahoy there ${lad^lass}$!</code> or <code>Ahoy there ${lad^lass^matey}$!</code>.
 +
 
 +
You can optionally use <samp>¦</samp> instead of <samp>^</samp>, in which case any <samp>^</samp> characters are left as-is.
 +
 
 +
Note that the non-binary value is only used if a mod overrides the player's gender, since the in-game UI only allows male or female.
 
|-
 
|-
| <samp>Buildings</samp>
+
| <samp>$action {{t|action}}</samp>
| <samp>Action BuildingSilo</samp>
+
| Run a [[Modding:Trigger actions|trigger action string]], like <samp>$action AddMoney 500</samp> to add {{price|500}} to the current player.
| If a building covers this tile, enables [[silo]] interactions on this tile subject to the building's <samp>HayCapacity</samp> field in <samp>Data/Buildings</samp>.
   
|-
 
|-
| <samp>Buildings</samp>
+
| <samp>$query {{t|query}}#{{t|if true}}&#124;{{t|if false}}</samp>
| <samp>Action BuildingToggleAnimalDoor</samp>
+
| Show different dialogue text depending on the [[Modding:Game state queries|game state query]] in {{t|query}}. For example:
| If a building covers this tile, opens or closes its animal door.
+
<syntaxhighlight lang="js">
 +
"Mon": "$query !PLAYER_VISITED_LOCATION Current Mine#Did you know there's an old abandoned mine up in the mountain? Apparently it's crawling with monsters!|I heard you went into the old mines up in the mountain!#Did you find anything tasty?$h"
 +
</syntaxhighlight>
 
|-
 
|-
| <samp>Buildings</samp>
+
| <samp>$t {{t|topic ID}} {{o|day length}}</samp>
| <samp>Action Dialogue</samp>
+
| Add a [[Modding:Dialogue#Conversation topics|conversation topic]] for the next {{o|day length}} days (default 4 days).
| &#32;
  −
* The message can now be a [[Modding:Tokenizable strings|tokenizable string]].
  −
* Fixed the cursor not changing to the inspection icon when hovering on an <samp>Action Dialogue</samp> tile.
   
|-
 
|-
| <samp>Buildings</samp>
+
| <samp>$v {{t|event id}} {{o|check preconditions}} {{o|skip if seen}}</samp>
| <samp>Action Forge</samp>
+
| Immediately start an [[Modding:Event data|event]] and end the current dialogue, subject to the conditions:
| Opens the [[Forge]] menu.
+
* {{o|check preconditions}}: whether to ignore the command if the [[Modding:Event data#Event preconditions|event's preconditions]] don't match (one of <samp>true</samp> or <samp>false</samp>). Default true.
|-
+
* {{o|skip if seen}}: whether to ignore the command if the player has already seen the given event. Default true.
| <samp>Buildings</samp>
+
 
| <samp>Action None</samp>
+
If the event is not played, the dialogue continues to the next line instead.
| Does nothing. This is used to mark the tile interactive if the click will be handled separately.
  −
|-
  −
| <samp>Buildings</samp>
  −
| <samp>Action ObeliskWarp {{t|location name}} {{t|x}} {{t|y}} {{o|whether to dismount}}</samp>
  −
| Warps the player to the specified location name and position with the [[Warp Totem|Obelisk]] animation/sound effects.
  −
|-
  −
| <samp>Buildings</samp>
  −
| <samp>Action OpenShop {{t|shop id}} {{o|from direction}} {{o|open time}} {{o|close time}} {{o|owner tile area}}</samp>
  −
| Open the [[#Custom shops|shop]] with the given {{t|shop id}}. All arguments besides the ID are optional:
  −
* {{o|from direction}}: if specified, the player must be standing in this direction relative to the shop (one of <samp>down</samp>, <samp>up</samp>, <samp>left</samp>, <samp>right</samp>, or <samp>none</samp>). Setting this to <samp>none</samp> disables the requirement. The default for most vanilla shops is <samp>down</samp>.
  −
* {{o|open time}} and {{o|close time}}: the start & end times in 26-hour format when the shop is available. Interacting with the tile outside those times does nothing.
  −
* {{o|owner tile area}}: if specified, the tile area which must contain one of the shop owners for the shop to be available. For a custom shop, these are defined by its <samp>Owners</samp> field. This can be specified in two forms: <samp>{{t|x}} {{t|y}}</samp> for a single tile, or <samp>{{t|x}} {{t|y}} {{t|width}} {{t|height}}</samp> for a multi-tile area.
  −
|-
  −
| <samp>Buildings</samp>
  −
| <samp>Action PlayEvent {{t|event id}} {{o|check preconditions}} {{o|skip if seen}} {{o|fallback action}}</samp>
  −
| Immediately start an [[Modding:Event data|event]], subject to the conditions:
  −
* {{o|check preconditions}}: whether to ignore the action if the [[Modding:Event data#Event preconditions|event's preconditions]] don't match (one of <samp>true</samp> or <samp>false</samp>). Default true.
  −
* {{o|skip if seen}}: whether to ignore the action if the player has already seen the given event. Default true.
     −
If the event doesn't start for any reason (including the preceding conditions):
+
For example, <code>$v 60367 false false</code> will replay the bus arrival event from the start of the game. <code>$v SomeMod.Test true false#$b#Wow! Good timing!$1</code> will play the event "SomeMod.Test" if the player meets the precondition requirements. If they do not, the dialogue "Wow! Good timing!$1" will play instead.
* If {{o|fallback action}} is specified, it'll be run as an action. This can be any <samp>Action</samp> tile property (without the "Action " prefix), like <code>Action PlayEvent 60367 true true PlayEvent 520702 false false</code> to play a different event.
  −
* Otherwise the action is silently ignored.
     −
For example, <code>Action PlayEvent 60367 false false</code> will replay the bus arrival event from the start of the game.
+
Note: The command will only work if it is at the very start of the dialogue. Adding any dialogue or other commands before it will cause it not to trigger the event and display the event commands as dialogue instead.  
 
|}
 
|}
 
</li>
 
</li>
<li>Added new <samp>TouchAction</samp> [[Modding:Maps|tile properties]]:
+
<li>Improved dialogue commands:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! layer
+
! command
! property
+
! changes
! explanation
   
|-
 
|-
| <samp>Back</samp>
+
| <samp>$p</samp>
| <samp>TouchAction PlayEvent {{t|event id}} {{o|check preconditions}} {{o|skip if seen}} {{o|fallback action}}</samp>
+
| You can now check multiple answer IDs. For example, this will show the first dialogue if the player chose dialogue answer 17, 18, or 19:
| Equivalent to <samp>Action PlayEvent</samp>, but activated on touch. Note that {{o|fallback action}} is an <samp>Action</samp> tile property, ''not'' a <samp>TouchAction</samp> tile property.
+
<pre>$p 17|18|19#I guess you think nothing would happen, right?$u|Maybe a wicked ghost would appear!</pre>
 
|}</li>
 
|}</li>
<li>Changed existing tile properties:
+
<li>[[Modding:Dialogue#Response IDs|Dialogue response IDs]] are now [[Modding:Common data field types#Unique string ID|unique string IDs]].</li>
{| class="wikitable"
+
<li>[[Secrets#Item Spawn Cheat|Item spawn codes]] now use string item IDs. That means you can spawn any item using its [[#Custom items|qualified item ID]] (like <code>[(F)1664]</code> for a [[Mystic Rug]]), but can no longer prepend zeros (e.g. <code>[128]</code> is a pufferfish but <code>[0128]</code> is an error item).</li>
|-
+
<li>For C# mods, <samp>Dialogue</samp> now tracks the translation key used to build it (when applicable). For example, you can detect when the player is rejected at the [[Flower Dance]] (derived from {{github|spacechase0/StardewValleyMods|Three-Heart Dance Partner}}):
! layer
+
<syntaxhighlight lang="c#">
! property
+
private void OnMenuChanged(object sender, MenuChangedEventArgs e)
! reason
+
{
|-
+
    bool isDanceRejection =
|rowspan="4"| <samp>Back</samp>
+
        Game1.currentLocation?.currentEvent?.FestivalName == "Flower Dance"
| <samp>NoSpawn</samp>
+
        && e.NewMenu is DialogueBox dialogueBox
| Added <samp>NoSpawn false</samp> form, which disables any previous <samp>NoSpawn</samp> property on the tile. For example, this can be used to enable spawning on a tile which has a <samp>NoSpawn</samp> tile index property.
+
        && dialogueBox.characterDialogue is {} dialogue
|-
+
        && dialogue.TranslationKey == $"Characters\\Dialogue\\{dialogue.speaker?.Name}:danceRejection";
| <samp>TouchAction Bus</samp>
+
}
| Removed. This wasn't used by the game or mods.
+
</syntaxhighlight>
|-
+
 
| <samp>TouchAction Emote</samp>
+
For C# mods that create <samp>Dialogue</samp> instances directly, there's a few ways to do it now:
| Fixed error if the specified NPC isn't found.
+
<syntaxhighlight lang="c#">
|-
+
// from a translation key
| <samp>Treasure</samp>
+
var dialogue = new Dialogue(npc, "Strings\\StringsFromCSFiles:Utility.cs.5360");
| Added <samp>Treasure Item {{t|item ID}}</samp> form which accepts a [[#Custom items|qualified or unqualified item ID]].
+
 
|-
+
// from custom text (with or without a translation key)
|rowspan="2"| <samp>Buildings</samp>
+
var dialogue = new Dialogue(npc, null, "Some arbitrary text to show as-is");
| <samp>Action ItemChest</samp><br /><samp>Action Minecart</samp><br /><samp>Action RemoveChest</samp>
+
 
| Removed. These weren't used by the game or mods.
+
// from a translation with tokens
|-
+
var dialogue = Dialogue.FromTranslation(npc, "Data\\ExtraDialogue:PurchasedItem_2_QualityLow_Willy", whatToCallPlayer, particle, i.DisplayName);
| <samp>Action Kitchen</samp>
+
</syntaxhighlight>
| Now works in any location (including those without a fridge).
+
 
|}
+
You can also easily add fallback logic using <samp>Dialogue.TryGetDialogue</samp> or <samp>npc.TryGetDialogue</samp>. For example:
 +
<syntaxhighlight lang="c#">
 +
Dialogue dialogue =
 +
    npc.TryGetDialogue($"rejection_{itemId}_{locationName}_{x}_{y}")
 +
    ?? npc.TryGetDialogue($"rejection_{itemId}_{locationName}")
 +
    ?? npc.TryGetDialogue($"rejection_{itemId}")
 +
    ?? new Dialogue(npc, "Strings\\StringsFromCSFiles:NPC.cs.3971");
 +
</syntaxhighlight>
 
</li>
 
</li>
 +
<li>For C# mods, added a <samp>dialogue.sideEffects</samp> field to run code when the dialogue is displayed.</li>
 +
<li>The 'reveal taste' dialogue command now uses the format <samp>%revealtaste:{{t|npc name}}:{{t|item ID}}</samp> to support item IDs. (The previous <samp>%revealtaste{{t|npc name}}{{t|item index}}</samp> format still works to support old content packs, but the item index can only be a number.)</li>
 +
<li>NPCs no longer override the portrait for a gift taste dialogue that uses a portrait command explicitly.</li>
 +
<li>Fixed unknown [[Modding:Dialogue|dialogue]] commands starting with <samp>$</samp> being parsed as a portrait number when not numeric.</li>
 +
<li>Fixed NPCs only using a <code>{day name}{hearts}_{year}</code> dialogue if they also have a <code>{day name}{hearts}</code> one.</li>
 +
<li>Fixed NPCs only using the <code>MovieInvitation</code> dialogue key in English.</li>
 
</ul>
 
</ul>
   −
===Other location/map changes===
+
===Schedule changes===
* Farm data:
+
{{/doc status|[[Modding:Schedule data]]|done=false}}
** Added <samp>SpawnMonstersByDefault</samp> field to <samp>Data/AdditionalFarms</samp> to set the default value of the 'spawn monsters at night' [[Options#Advanced Game Options|advanced save option]].
+
 
** Fixed crash on new-save screen if the farm type's tooltip has no description.
+
<ul>
* General location data:
+
<li>Schedule keys are now case-insensitive.</li>
** All locations can now have animals. The <samp>IAnimalLocation</samp> is now obsolete and implemented by <samp>GameLocation</samp>.
+
<li>Added a new <samp>{{t|day of week}}_{{t|min hearts}}</samp> schedule key.</li>
** Added new [[Modding:Fish data|fishing areas]] to simplify compatibility between fish & map mods (specifically for hilltop farm, wilderness farm, town, and desert).
+
<li>Added an <samp>NPC.ScheduleKey</samp> field which always matches their loaded schedule.</li>
** Added a descriptive error when a required location or layer isn't found. Mods can use <samp>map.RequireLayer</samp> and <samp>Game1.RequireLocation</samp> to get a location with similar error-checking.
+
<li>Schedule commands now trim surrounding whitespace, so they can be multilined for readability. For example:
** Added <samp>WarpPathfindingCache</samp> for C# mods, which modularizes the NPC warp route logic. You can edit its <samp>IgnoreLocationNames</samp>, <samp>OverrideTargetNames</samp>, and <samp>GenderRestrictions</samp> fields if needed for custom locations.
+
<syntaxhighlight lang="js">"Wed": "
** Game logic which checks tile indexes is now more fault-tolerant, so it won't crash if an expected tile was edited.
+
    1000 ArchaeologyHouse 11 9 0/
** Finished migrating <samp>DecoratableLocation</samp> flooring/wallpaper areas to string IDs (started in Stardew Valley 1.5.5).
+
    1800 Town 47 87 0/
* General map changes:
+
    2200 SeedShop 1 9 3 abigail_sleep
** Added validation for [[Modding:Maps|map properties and tile properties]]. If the format is invalid, the game will now log a detailed error and skip it.
+
"</syntaxHighlight></li>
** Removed unused [[Modding:Maps#Paths layer|path tiles]] in <samp>Maps/paths</samp> and all map files.
+
<li>Removed an unintended schedule fallback to a <samp>{season}_spring_{hearts}</samp> key. It'll skip to the <samp>spring</samp> default instead.</li>
* Location context data:
+
<li>Schedules are now fault-tolerant:
** Building interiors now inherit their parent's location context by default.
+
* Fixed crash if a selected schedule can't be parsed. The NPC now logs an error and continues with the next fallback instead.
** Added <samp>Game1.locationContextData</samp> to cache the data from <samp>Data/LocationContexts</samp>.
+
* Fixed crash if certain hardcoded schedules aren't present (like Penny's <samp>marriageJob</samp> or Pam's <samp>bus</samp>).
** Added constants for the vanilla context IDs like <samp>LocationContexts.IslandId</samp>.
+
* Fixed error if a schedule command is empty.</li>
** Added validation for required location context IDs (and <samp>LocationContexts.Require(id)</samp> for mod logic).
+
</ul>
** Removed the <samp>Name</samp> field in <samp>Data/LocationContexts</samp>, which duplicated the ID.
+
 
 +
===Other NPC changes===
 +
{{/doc status|[[Modding:NPC data]] as needed|done=false}}
 +
 
 
<ul>
 
<ul>
<li>Added methods to simplify common operations:
+
<li>Added <samp>Game1.characterData</samp> and <samp>Game1.farmAnimalData</samp> to read NPC/animal info without constantly reloading the <samp>Data/Characters</samp> or <samp>Data/FarmAnimals</samp> asset.</li>
 +
<li>All translated NPC names are now in <samp>Strings/NPCNames</samp>.
 +
<li>Added new fields & methods for C# mods:
 +
 
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
 
! type
 
! type
! method
+
! field/method
 
! effect
 
! effect
 
|-
 
|-
|rowspan="7"| <samp>Building</samp>
+
|rowspan="2"| <samp>AdventureGuild</samp>
| <samp>GetParentLocation</samp>
+
| <samp>IsComplete(data)</samp>
| Get the location which contains this building.
+
| Get whether an [[Adventurer's Guild]] monster eradication goal has been completed, regardless of whether the player collected its rewards yet.
 
|-
 
|-
| <samp>IsInCurrentLocation</samp>
+
| <samp>HasCollectedReward(player, id)</samp>
| Get whether the building is in the same location as the current player.
+
| Get whether a given player has completed an [[Adventurer's Guild]] monster eradication goal and collected its rewards. For example:
 +
<syntaxhighlight lang="c#">
 +
bool isPhoneUnlocked = AdventureGuild.HasCollectedReward(Game1.player, "Gil_FlameSpirits");
 +
</syntaxhighlight>
 
|-
 
|-
| <samp>HasIndoors</samp>
+
| <samp>AnimalHouse</samp>
| Get whether the building has an interior location.
+
| <samp>adoptAnimal</samp>
 +
| Add an animal to this location and set the location as the animal's home.
 
|-
 
|-
| <samp>GetIndoors</samp>
+
| <samp>AnimatedSprite</samp>
| Get the location within this building, if applicable.
+
| <samp>Owner</samp>
 +
| The NPC which owns the sprite.
 
|-
 
|-
| <samp>HasIndoorsName</samp>
+
|rowspan="3"| <samp>Character</samp>
| Get whether the building has an interior location and its unique name matches the given value (like <code>building.HasIndoorsName("FarmHouse")</code>).
+
| <samp>IsVillager</samp>
 +
| Whether this is an NPC-type villager (i.e. not a monster, horse, pet, player's child, etc). In other words, this checks whether the NPC would use data from <samp>Data/Characters</samp> (regardless of whether they currently have an entry in the asset).
 
|-
 
|-
| <samp>GetIndoorsName</samp>
+
| <samp>StandingPixel</samp>
| Get the unique name of the location within this building, if applicable.
+
| The character's cached pixel position within the current location, based on the center pixel of their bounding box.
 
|-
 
|-
| ...
+
| <samp>Tile</samp><br /><samp>TilePoint</samp>
| ''see also [[#Other building changes|other building changes]] for non-location methods.''
+
| The character's cached tile position within their current location. <samp>Tile</samp> is their exact non-integer position, and <samp>TilePoint</samp> is their integer tile position.
 
|-
 
|-
|rowspan="7"|<samp>Cabin</samp><br /><samp>FarmHouse</samp>
+
|rowspan="7"| <samp>FarmAnimal</samp>
| <samp>GetCellar</samp>
+
| <samp>isAdult</samp>
| Get the [[cellar]] location linked to this cabin, if any.
+
| Get whether the farm animal is fully grown (opposite of <samp>isBaby()</samp>).
 
|-
 
|-
| <samp>CanAssignFarmhand</samp><br /><samp>AssignFarmhand</samp>
+
| <samp>CanGetProduceWithTool</samp>
| ''(Cabin only)'' Check whether the cabin is available to assign to a farmhand, or perform the assignment.
+
| Get whether the farm animal's produce can be collected with a given tool (e.g. milk pail for a cow).
 
|-
 
|-
| <samp>HasOwner</samp>
+
| <samp>CanLiveIn</samp>
| Get whether the home has an assigned player, regardless of whether they've finished creating their character.
+
| Get whether the animal can be added to a building.
 
|-
 
|-
| <samp>OwnerId</samp>
+
| <samp>GetDisplayName</samp><br /><samp>GetShopDescription</samp>
| Get the unique ID of the player who owns this home, if any.
+
| Get the translated display name or shop description for this animal.
 
|-
 
|-
| <samp>IsOwnedByCurrentPlayer</samp>
+
| <samp>GetHarvestType</samp>
| Get whether the cabin belongs to the current player.
+
| Get whether the animal's produce is dropped or collected with a tool.
 
|-
 
|-
| <samp>IsOwnerActivated</samp>
+
| <samp>growFully</samp>
| Get whether the home has an assigned player and they've finished creating their character.
+
| Instantly age the animal to adulthood if it's still a baby.
 
|-
 
|-
| <samp>HasNpcSpouse</samp>
+
| <samp>ReloadTextureIfNeeded</samp>
| Get whether the player who owns this home is married to any NPC (when used like <samp>HasNpcSpouse()</samp>) or a specific NPC (like <samp>HasNpcSpouse(name)</samp>). This also replaces <samp>shouldShowSpouseRoom()</samp>.
+
| Update the animal sprite based on the current state + data.
 
|-
 
|-
|rowspan="2"| <samp>Farm</samp>
+
| rowspan="2"| <samp>Farmer</samp>
| <samp>GetStarterFarmhouseLocation</samp>
+
| <samp>GetDisplayPants</samp><br /><samp>GetDisplayShirt</samp>
| Get the default tile position for the farmhouse. (See also <samp>farm.GetMainFarmHouseEntry()</samp>.)
+
| Get the texture and sprite index to draw for the player's pants or shirt. This accounts for override clothing, worn clothing, and the default clothing drawn when the farmer isn't wearing anything.
 +
 
 +
For example:
 +
<syntaxhighlight lang="c#">
 +
Game1.player.GetDisplayShirt(out Texture2D texture, out int spriteIndex);
 +
</syntaxhighlight>
 
|-
 
|-
| <samp>GetStarterPetBowlLocation</samp>
+
| <samp>CanDyePants</samp><br /><samp>CanDyeShirt</samp>
| Get the default tile position for the pet bowl.
+
| Get whether the currently equipped pants or shirt can be [[Dyeing|dyed]].
 
|-
 
|-
|rowspan="19"| <samp>GameLocation</samp>
+
| <samp>Monster</samp>
| <samp>AddDefaultBuildings</samp>
+
| <samp>GetDisplayName(name)</samp>
| Can be overridden to add custom buildings when the location is created and/or loaded. These can either be re-added whenever they're missing (like the vanilla farmhouse), or only built once on save creation (like the vanilla pre-built cabins).
+
| Get the translated display name for a monster type.
 
  −
This replaces the former <samp>farm.AddModularShippingBin()</samp> method.
   
|-
 
|-
| <samp>GetFridge</samp><br /><samp>GetFridgePosition</samp>
+
|rowspan="4"| <samp>NPC</samp>
| Get the fridge's chest or tile position, if the location has one.
+
| <samp>CanReceiveGifts</samp>
 +
| Get whether this NPC can receive gifts from the player (regardless of whether they've already received one today).
 
|-
 
|-
| <samp>GetSeason</samp><br /><samp>GetSeasonIndex</samp><br /><samp>GetSeasonKey</samp>
+
| <samp>GetData</samp><br /><samp>NPC.TryGetData</samp>
| Get the local season that applies within the location as an enum, number (like <samp>0</samp> for spring), or string (like <samp>spring</samp>) respectively. For example, it's always summer on [[Ginger Island]].
+
| Get the underlying data from <samp>Data/Characters</samp> for this NPC, if any.
 
|-
 
|-
| <samp>GetWeather</samp><br /><samp>IsDebrisWeatherHere</samp><br /><samp>IsLightningHere</samp><br /><samp>IsRainingHere</samp><br /><samp>IsSnowingHere</samp>
+
| <samp>NPC.GetDisplayName(name)</samp>
| Get the current weather in this location's context, regardless of whether the player is indoors and sheltered from it.
+
| Get the translated display name in the current language for an NPC by their internal name.
 
|-
 
|-
| <samp>InDesertContext</samp><br /><samp>InIslandContext</samp><br /><samp>InValleyContext</samp>
+
| <samp>hasDarkSkin</samp>
| Get whether this location is within the <samp>Island</samp> or <samp>Default</samp> location context respectively.
+
| Whether this character has dark skin for the purposes of child genetics.
 
|-
 
|-
| <samp>IsActiveLocation</samp>
+
| <samp>Pet</samp>
| Get whether this location is actively synced to the current player (see [[Modding:Modder Guide/Game Fundamentals#Farmhand shadow world|farmhand shadow world]]).
+
| <samp>GetPetData</samp><br /><samp>TryGetData</samp>
 +
| Get the underlying data from <samp>Data/Pets</samp> for this pet, if any.
 
|-
 
|-
| <samp>IsTemporary</samp>
+
| <samp>ShopMenu</samp>
| Get whether this is a temporary location for a festival or minigame. This is cached based on the location name (e.g. locations starting with <samp>Temp</samp> or some other specific names).
+
| <samp>ShopId</samp>
|-
+
| A key which identifies the current shop. This may be the unique shop ID in <samp>Data/Shops</samp> for a standard shop, <samp>Dresser</samp> or <samp>FishTank</samp> for furniture, etc. This is guaranteed to be set to a relevant shop ID.
| <samp>GetLocationContextId</samp>
  −
| Get the ID of the location context in <samp>Data/LocationContexts</samp> which contains this building.
  −
|-
  −
| <samp>GetContainingBuilding</samp>
  −
| Get the building instance which contains this location (like the cabin for a cabin interior), if applicable.
  −
|-
  −
| <samp>GetParentLocation</samp>
  −
| Get the parent location which contains this one (like the farm for a cabin interior), or <samp>null</samp> if it has no parent.
  −
|-
  −
| <samp>GetRootLocation</samp>
  −
| Get the parent location which contains this one (like the farm for a cabin interior), or the location itself if it has no parent.
  −
|-
  −
| <samp>GetInstancedBuildingInteriors</samp>
  −
| Get all building interiors within this location which are instanced to the building (i.e. not in <samp>Game1.locations</samp> separately).
  −
|-
  −
| <samp>GetMapPropertySplitBySpaces</samp><br /><samp>GetTilePropertySplitBySpaces</samp>
  −
| Get the value of a map/tile property and split it into individual words. If the map/tile property isn't defined, returns an empty array.
     −
For example:
+
This replaces the former <samp>shopContext</samp> field, and will usually have the same value in cases where that was set to a unique shop ID.
<syntaxhighlight lang="c#">
  −
string[] fields = Game1.currentLocation.GetMapPropertySplitBySpaces("ScreenshotRegion");
  −
</syntaxhighlight>
   
|-
 
|-
| <samp>HasMapPropertyWithValue</samp>
+
| <samp>Utility</samp>
| Get whether a map property is defined and has a non-empty value.
+
| <samp>getAllVillagers</samp>
 +
| Get all villager NPCs (excluding horses, pets, monsters, player children, etc). This works just like <samp>getAllCharacters</samp> with an added filter.
 +
|}
 +
</li>
 +
<li>NPCs now update on save loaded when their home data changes.</li>
 +
<li><samp>NPC.reloadSprite()</samp> now has an argument to only reload the appearance, without changing other data.</li>
 +
<li><samp>Utility.getAllCharacters()</samp> now returns a plain <samp>List&lt;NPC&gt;</samp> value instead of a custom <samp>DisposableList&lt;NPC&gt;</samp>, so you can use normal LINQ querying on it.</li>
 +
<li><samp>Utility.GetHorseWarpRestrictionsForFarmer(player)</samp> now returns an enum (which is more efficient and easier for mods to patch), and added a new <samp>Utility.GetHorseWarpErrorMessage(restrictions)</samp> method to get the error message to show for it.</li>
 +
<li><samp>Farmer.hasAFriendWithHeartLevel</samp> now has an optional max-hearts argument.</li>
 +
<li>Removed most <samp>FarmAnimal</samp> fields/properties which just mirror the underlying data.</li>
 +
<li>Removed invalid item IDs in <samp>Data/NPCGiftTastes</samp>.</li>
 +
<li>Fixed NPCs sometimes duplicated on save load (particularly if their home location changed).</li>
 +
<li>Fixed child NPCs like [[Jas]] or [[Vincent]] ignoring relative titles like "mom" in <samp>Data/NPCDispositions</samp> (now <samp>Data/Characters</samp>) for reveal-gift-taste dialogues.</li>
 +
<li>Fixed custom NPCs ignoring dialogue when they use a subclass of <samp>NPC</samp>.</li>
 +
<li>Fixed monsters not loading their display name from <samp>Data/Monsters</samp> for English players.</li>
 +
<li>Fixed player children not applying the <samp>IsInvisible</samp> flag.</li>
 +
</ul>
 +
 
 +
==What's new for everything else==
 +
===Buff overhaul===
 +
{{/doc status|a new doc page|done=false}}
 +
 
 +
: ''See also: [[#Custom buffs|custom buffs]].''
 +
 
 +
1.6 rewrites buffs to work more consistently and be more extensible:
 +
 
 +
* Buff logic is unified into <samp>Game1.player.buffs</samp>, which is the single source of truth for buff data. This replaces the previous <samp>player.added*</samp> and <samp>player.appliedBuffs</samp> fields, <samp>BuffsDisplay</samp> logic, enchantment stat bonuses, and boots/ring attribute changes on (un)equip.
 +
* This also removes limitations on buff types (e.g. buffs can add weapon bonuses and weapons can add attribute buffs) and buffable equipment (e.g. equipped tools can have buffs too).
 +
* Buff effects are now fully recalculated when they change, to fix a range of longstanding bugs like attribute drift and double-debuffs. Just like before, the buffs are managed locally; only the buff IDs and aggregate attribute effects are synced.
 +
 
 +
'''For C# mods:'''
 +
* Each buff now has a unique string ID. You can apply a new buff with the same ID to replace it (so you no longer need to manually find and remove previous instances of the buff).
 +
* The buff duration can now be set to <samp>Buff.ENDLESS</samp> to remove the duration. It'll last all day until the player sleeps.
 +
* You can add standard buff effects to any equipment by overriding <samp>Item.AddEquipmentEffects</samp>, or add custom behaviour/buffs by overriding <samp>Item.onEquip</samp> and <samp>Item.onUnequip</samp>.
 +
* You can add custom food or drink buffs by overriding <samp>Item.GetFoodOrDrinkBuffs()</samp>.
 +
* The <samp>Buff</samp> constructor now supports a custom icon texture, sprite index, display name, description, and millisecond duration to fully support custom buffs.
 +
* You can change how buff attributes are displayed (or add new attributes) by extending the <samp>BuffsDisplay.displayAttributes</samp> list.
 +
* You can have invisible buffs by setting <samp>buff.visible = false</samp>.
 +
 
 +
For example, here's how to add a custom buff which adds +3 speed:
   −
For example:
   
<syntaxhighlight lang="c#">
 
<syntaxhighlight lang="c#">
bool canUseCasks = Game1.currentLocation.HasMapPropertyWithValue("CanCaskHere");
+
Buff buff = new Buff(
 +
    id: "Example.ModId_ZoomZoom",
 +
    displayName: "Zoom Zoom", // can optionally specify description text too
 +
    iconTexture: this.Helper.ModContent.Load<Texture2D>("assets/zoom.png"),
 +
    iconSheetIndex: 0,
 +
    duration: 30_000, // 30 seconds
 +
    effects: new BuffEffects()
 +
    {
 +
        Speed = { 10 } // shortcut for buff.Speed.Value = 10
 +
    }
 +
);
 +
Game1.player.applyBuff(buff);
 
</syntaxhighlight>
 
</syntaxhighlight>
|-
  −
| <samp>StoreHayInAnySilo</samp>
  −
| Add hay to any silo with free space (preferring silos in the current location, then the farm, then anywhere).
  −
|-
  −
| <samp>TryGetMapProperty</samp>
  −
| Get a map property value as a string, if it's defined.
     −
For example:
+
You can also implement your own custom effects in code by checking if the buff is active, like <code>Game1.player.hasBuff("Example.ModId_ZoomZoom")</code>.
<syntaxhighlight lang="c#">
+
 
if (this.TryGetMapProperty("Warps", out string warps))
+
===Custom audio===
{
+
{{/doc status|[[Modding:Audio]]|done=true}}
    // ...
+
 
}
+
You can now add or edit music tracks or sound effects by editing the new <samp>Data/AudioChanges</samp> asset. New cues are added to the game's soundbank, so they can be used anywhere normal audio can be used (e.g. the <samp>Music</samp> [[Modding:Maps|map property]]). This supports <samp>.ogg</samp> and <samp>.wav</samp> files, and the vanilla audio features (e.g. randomizing audio from one ID).
</syntaxhighlight>
+
 
 +
Audio is also more fault-tolerant in 1.6: the game no longer crashes when playing audio which doesn't exist, it now logs an error and returns a default quiet click sound instead. (If you use <code>try..catch</code> to check if an audio cue exists, you should check <code>Game1.soundbank.Exists(name)</code> instead.)
 +
 
 +
===Custom buffs===
 +
{{/doc status|a new doc page|done=false}}
 +
 
 +
: ''See also: [[#Buff overhaul|buff overhaul]].''
 +
 
 +
You can now define custom buffs by editing the new <samp>Data/Buffs</samp> asset. You can then use the buff from other places like <samp>Data/Object</samp>'s <samp>Buff</samp> field or the C# <samp>Buff</samp> constructor.
 +
 
 +
This consists of a string → model lookup, where...
 +
* The key is a [[Modding:Common data field types#Unique string ID|unique string ID]] for the buff.
 +
* The value is a model with the fields listed below.
 +
 
 +
{| class="wikitable"
 
|-
 
|-
| <samp>TryGetMapPropertyAs</samp>
+
! field
| Get a map property and parse it into into a <samp>bool</samp>, <samp>double</samp>, <samp>Point</samp>, <samp>Rectangle</samp>, or <samp>Vector2</samp> value.
+
! purpose
 
  −
For example:
  −
<syntaxhighlight lang="c#">
  −
if (!this.TryGetMapPropertyAs("MailboxLocation", out Point position))
  −
{
  −
    position = new Point(68, 16); // default value
  −
}
  −
</syntaxhighlight>
   
|-
 
|-
| <samp>removeObjectsAndSpawned</samp>
+
| <samp>DisplayName</samp>
| Remove all objects, bushes, resource clumps, and terrain features within a tile area.
+
| A [[Modding:Tokenizable strings|tokenizable string]] for the buff name.
 
|-
 
|-
| <samp>OnBuildingConstructed</samp><br /><samp>OnBuildingMoved</samp><br /><samp>OnBuildingDemolished</samp>
+
| <samp>Description</samp>
| These methods are called for all players when any player constructs, moves, or demolishes a building.
+
| ''(Optional)'' A [[Modding:Tokenizable strings|tokenizable string]] for the buff name. Default none.
 
|-
 
|-
|rowspan="3"| <samp>LibraryMuseum</samp>
+
| <samp>IsDebuff</samp>
| <samp>HasDonatedArtifacts()</samp>
+
| ''(Optional)'' >Whether this buff counts as a debuff, so its duration should be halved when wearing a [[Sturdy Ring|sturdy ring]]. Default false.
| Get whether any items have been donated to the [[museum]].
   
|-
 
|-
| <samp>HasDonatedArtifactAt(tile)</samp>
+
| <samp>GlowColor</samp>
| Get whether any donated item is currently placed at the given tile position within the [[museum]].
+
| ''(Optional)'' The glow color to apply to the player. See [[#Color fields|color format]]. Default none.
 
|-
 
|-
| <samp>HasDonatedArtifact(itemId)</samp>
+
| <samp>Duration</samp>
| Get whether an artifact with the given qualified or unqualified item ID has been donated to the [[museum]].
+
| The duration in milliseconds for which the buff should be active. This can be set to value <samp>-2</samp> for a buff that should last for the rest of the day.
 
|-
 
|-
|rowspan="2"| <samp>MineShaft</samp>
+
| <samp>MaxDuration</samp>
| <samp>GetLevelName</samp>
+
| ''(Optional)'' The maximum buff duration in milliseconds. If specified and larger than <samp>Duration</samp>, a random value between <samp>Duration</samp> and <samp>MaxDuration</samp> will be selected for each buff. Default none.
| Get the location name for a generated [[The Mines|mine]] or [[Skull Cavern]] level.
+
|-
 
+
| <samp>IconTexture</samp>
For example:
+
| The asset name for the texture containing the buff's sprite.
<syntaxhighlight lang="c#">
  −
string locationName = MineShaft.GetLevelName(10); // returns "UndergroundMine10"
  −
Game1.warpFarmer(locationName, 0, 0, false);
  −
</syntaxhighlight>
   
|-
 
|-
| <samp>IsGeneratedLevel</samp>
+
| <samp>IconSpriteIndex</samp>
| Get whether a location or location name is a generated [[The Mines|mine]] or [[Skull Cavern]] level.
+
| ''(Optional)'' The sprite index for the buff icon within the <samp>IconTexture</samp>. Default 0.
 
  −
For example:
  −
<syntaxhighlight lang="c#">
  −
string locationName = "UndergroundMine10";
  −
bool isMine = MineShaft.IsGeneratedLevel(locationName, out int level); // returns true, 10
  −
</syntaxhighlight>
   
|-
 
|-
| <samp>VolcanoDungeon</samp>
+
| <samp>Effects</samp>
| <samp>GetLevelName</samp><br /><samp>IsGeneratedLevel</samp>
+
| ''(Optional)'' The buff attributes to apply. Default none.
| Equivalent to the matching <samp>MineShaft</samp> methods, but for the [[Volcano Dungeon]].
  −
|}
  −
</li>
  −
</ul>
  −
* Added map/tile property <samp>TryAdd</samp>/<samp>TryGetValue</samp> extensions in <samp>StardewValley.Extensions</samp> for string property values. For example, this lets you do <samp>map.Properties.TryGetValue(key, out string value)</samp>.
  −
* <samp>MineShaft.tryToAddMonster</samp> now returns whether a monster was added.
  −
* <samp>Game1.GetNumberBuildingsConstructed</samp> and <samp>location.getNumberBuildingsConstructed</samp> now have overloads to count all building types and/or specify whether to count under-construction buildings.
  −
* Fixed <samp>location.refurbishMapPortion</samp> copying <samp>Back</samp> source properties to the <samp>Building</samp> target layer.
  −
* Fixed door warps in custom indoor locations not consistently detected by the game.
     −
==What's new for buildings==
+
This consists of a model with any combination of these fields:
===Custom buildings===
  −
You can now add custom buildings by editing the <samp>Data/Buildings</samp> asset. This consists of a string → model lookup, where...
  −
* The key is a [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for the building type.
  −
* The value is a model with the fields listed below.
  −
 
  −
====Required fields====
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
 
! field
 
! field
! effect
+
! purpose
 
|-
 
|-
| <samp>Name</samp><br /><samp>Description</samp>
+
| <samp>FarmingLevel</samp><br /><samp>FishingLevel</samp><br /><samp>ForagingLevel</samp><br /><samp>LuckLevel</samp><br /><samp>MiningLevel</samp>
| A [[Modding:Tokenizable strings|tokenizable string]] for the display name and description (e.g. shown in the construction menu).
+
| ''(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>Texture</samp>
+
| <samp>Attack</samp><br /><samp>Defense</samp><br /><samp>MagneticRadius</samp><br /><samp>MaxStamina</samp><br /><samp>Speed</samp>
| The asset name for the texture under the game's Content folder.
+
| ''(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.
 
|}
 
|}
  −
====Construction====
  −
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>ActionsOnApply</samp>
! effect
+
| ''(Optional)'' Run any number of [[Modding:Trigger actions|trigger action strings]] when the buff is applied to the current player. For example, this increments a player stat:
 +
<syntaxhighlight lang="js">
 +
"ActionsOnApply": [
 +
    "IncrementStat {{ModId}}_NumberEaten 1"
 +
]
 +
</syntaxhighlight>
 
|-
 
|-
| <samp>Builder</samp>
+
| <samp>CustomFields</samp>
| ''(Optional)'' The NPC from whom you can request construction. The vanilla values are [[Carpenter's Shop|<samp>Robin</samp>]] and [[Wizard's Tower#Buildings|<samp>Wizard</samp>]], but you can specify a different name if a C# mod opens a construction menu for them. Defaults to <samp>Robin</samp>. If omitted, it won't appear in any menu.
+
| ''(Optional)'' The [[#Custom data fields|custom fields]] for this entry.  
|-
  −
| <samp>BuildCost</samp>
  −
| ''(Optional)'' The gold cost to construct the building. Defaults to {{price|0}}.
  −
|-
  −
| <samp>BuildMaterials</samp>
  −
| ''(Optional)'' The materials you must provide to start construction, as a list of models with these fields:
  −
{| class="wikitable"
  −
|-
  −
! field
  −
! effect
  −
|-
  −
| <samp>Id</samp>
  −
| ''(Optional)'' The [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for this entry within the current list. Defaults to the <samp>ItemId</samp> if not specified.
  −
|-
  −
| <samp>ItemId</samp>
  −
| The required item ID (qualified or unqualified).
  −
|-
  −
| <samp>Amount</samp>
  −
| The number of the item required.
   
|}
 
|}
|-
+
 
| <samp>BuildDays</samp>
+
===Custom data fields===
| ''(Optional)'' The number of days needed to complete construction (e.g. <samp>1</samp> for a building completed the next day). If set to 0, construction finishes instantly. Defaults to 0.
+
{{/doc status|[[Modding:Common data field types#Custom fields]]|done=true}}
|-
+
 
| <samp>BuildCondition</samp>
+
Many data assets now have a <samp>CustomFields</samp> field. This is ignored by the game, but lets mods add their own data (e.g. to enable mod framework features).
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether the building should be available in the construction menu. Defaults to always available.
+
 
|-
+
For example, a content pack can [[#Custom crops|add a crop]] with custom fields:
| <samp>BuildMenuDrawOffset</samp>
+
{{#tag:syntaxhighlight|<nowiki>
| ''(Optional)'' A pixel offset to apply to the building sprite when drawn in the construction menu. Default none.
+
{
|-
+
    "Format": "</nowiki>{{Content Patcher version}}<nowiki>",
| <samp>AdditionalPlacementTiles</samp>
+
    "Changes": [
| ''(Optional)'' The extra tiles to treat as part of the building when placing it through the construction menu. For example, the farmhouse uses this to make sure the stairs are clear. This consists of a list of models with these fields:
+
        {
{| class="wikitable"
+
            "Action": "EditData",
|-
+
            "Target": "Data/Crops",
! field
+
            "Entries": {
 +
                "Example.Id_CucumberSeeds": {
 +
                    "Seasons": [ "summer" ],
 +
                    "DaysInPhase": [ 1, 2, 2, 2 ],
 +
                    "HarvestItemId": "Example.Id_Cucumber",
 +
                    "Texture": "{{InternalAssetKey: assets/crops.png}}",
 +
                    "SpriteIndex": 0,
 +
 
 +
                    "CustomFields": {
 +
                        "Example.FrameworkMod/WetTexture": "{{InternalAssetKey: assets/crops-wet.png}}"
 +
                    }
 +
                }
 +
            }
 +
        }
 +
    ]
 +
}</nowiki>|lang=javascript}}
 +
 
 +
And then a C# mod could handle the custom field if it's set:
 +
<syntaxhighlight lang="c#">
 +
if (Game1.currentLocation.IsRainingHere())
 +
{
 +
    CropData data = crop.GetData();
 +
    if (data != null && data.CustomFields.TryGetValue("Example.FrameworkMod/WetTexture", out string textureName))
 +
    {
 +
        // do magic
 +
    }
 +
}
 +
</syntaxhighlight>
 +
 
 +
See <samp>CustomFields</samp> in the docs for each asset type to see if it's supported. Besides the sections listed on this page, custom fields were also added to <samp>Data/AdditionalFarms</samp>, <samp>Data/AdditionalLanguages</samp>, <samp>Data/FishPondData</samp>, <samp>Data/HomeRenovations</samp>, <samp>Data/Movies</samp>, and <samp>Data/SpecialOrders</samp>.
 +
 
 +
See [[Modding:Common data field types#Custom fields]] for the main docs.
 +
 
 +
===Custom giant crops===
 +
{{/doc status|a new doc page|done=false}}
 +
 
 +
You can now add/edit [[Crops#Giant Crops|giant crops]] by editing the <samp>Data/GiantCrops</samp> data asset.
 +
 
 +
This consists of a string → model lookup, where...
 +
* The key is a [[Modding:Common data field types#Unique string ID|unique string ID]] for the giant crop.
 +
* The value is a model with the fields listed below.
 +
 
 +
{| class="wikitable"
 +
|-
 +
! field
 
! effect
 
! effect
 
|-
 
|-
| <samp>TileArea</samp>
+
| <samp>FromItemId</samp>
| The tile area relative to the top-left corner of the building, specified as an object with <samp>X</samp>, <samp>Y</samp>, <samp>Width</samp>, and <samp>Height</samp> fields.
+
| The [[#Custom items|item ID]] (qualified or unqualified) for the harvest ID of the regular crop which can turn into this giant crop. For example, <samp>(O)254</samp> is [[melon]].
 +
 
 +
Any number of giant crops can use the same <samp>FromItemId</samp> value. The first giant crop whose other fields match (if any) will spawn.
 
|-
 
|-
| <samp>OnlyNeedsToBePassable</samp>
+
| <samp>HarvestItems</samp>
| ''(Optional)'' Whether this area allows tiles that would normally not be buildable, so long as they are passable. For example, this is used to ensure that an entrance is accessible. Default false.
+
| The items which can be dropped when you break the giant crop. If multiple items match, they'll all be dropped.
|}
+
 
|-
+
This consists of a list of models with these fields:
| <samp>IndoorItems</samp>
  −
| ''(Optional)'' The items to place in the building interior when it's constructed or upgraded. This consists of a list of models with these fields:
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 3,989: Line 3,876:  
! effect
 
! effect
 
|-
 
|-
| <samp>Id</samp>
+
| ''common fields''
| The [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for this entry within the current list.
+
| See [[Modding:Item queries#Item spawn fields|item spawn fields]] for the generic item fields supported for harvest items.
|-
+
 
| <samp>ItemId</samp>
+
If set to an [[Modding:Item queries|item query]] which returns multiple items, one of them will be selected at random.
| The [[#Custom items|qualified item ID]] for the item to place.
+
|-
 +
| <samp>Chance</samp>
 +
| ''(Optional)'' The probability that this entry is selected, as a value between 0 (never drops) and 1 (always drops). Default 1 (100% chance).
 
|-
 
|-
| <samp>Tile</samp>
+
| <samp>ForShavingEnchantment</samp>
| The tile position at which to place the item, specified as an object with <samp>X</samp> and <samp>Y</samp> fields.
+
| ''(Optional)'' Whether this item is only dropped for [[Enchantments#Tool enchantments|Shaving enchantment]] drops (<samp>true</samp>), only when the giant crop is broken (<samp>false</samp>), or both (<samp>null</samp>). Default both.
 
|-
 
|-
| <samp>Indestructible</samp>
+
| <samp>ScaledMinStackWhenShaving</samp><br /><samp>ScaledMaxStackWhenShaving</samp>
| ''(Optional)'' Whether to prevent the player from destroying, picking up, or moving the item. Default false.
+
| ''(Optional)'' If set, the min/max stack size when this item is dropped due to the [[Forge#Enchantments|shaving enchantment]], scaled to the tool's power level.
 +
 
 +
This value is multiplied by the health deducted by the tool hit which triggered the enchantment. For example, an iridium axe which reduced the giant crop's health by 3 points will produce three times this value per hit.
 +
 
 +
If both fields are set, the stack size is randomized between them. If only one is set, it's applied as a limit after the generic fields. If neither is set, the generic <samp>MinStack</samp>/<samp>MaxStack</samp> fields are applied as usual without scaling.
 
|}
 
|}
 
|-
 
|-
| <samp>MagicalConstruction</samp>
+
| <samp>Texture</samp>
| ''(Optional)'' Whether the building is magical. This changes the carpenter menu to a mystic theme while this building's blueprint is selected, and completes the construction instantly when placed.
+
| The asset name for the texture containing the giant crop's sprite.
 +
|-
 +
| <samp>TexturePosition</samp>
 +
| ''(Optional)'' The top-left pixel position of the sprite within the <samp>Texture</samp>, specified as a model with <samp>X</samp> and <samp>Y</samp> fields. Defaults to (0, 0).
 +
|-
 +
| <samp>TileSize</samp>
 +
| ''(Optional)'' The area in tiles occupied by the giant crop, specified as a model with <samp>X</samp> and <samp>Y</samp> fields. This affects both its sprite size (which should be 16 pixels per tile) and the grid of crops needed for it to grow. Note that giant crops are drawn with an extra tile's height. Defaults to (3, 3).
 +
|-
 +
| <samp>Health</samp>
 +
| ''(Optional)'' The health points that must be depleted to break the giant crop. The number of points depleted per [[axe]] chop depends on the axe power level. Default 3.
 +
|-
 +
| <samp>Chance</samp>
 +
| ''(Optional)'' The percentage chance that a given grid of crops will grow into the giant crop each night, as a value between 0 (never) and 1 (always). Default 0.01 (1%).
 +
 
 +
Note that the chance is checked for each giant crop that applies. If three giant crops each have a 1% chance of spawning for the same crop, then there's a 3% chance that one of them will spawn.
 +
|-
 +
| <samp>Condition</samp>
 +
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether this giant crop is available to spawn. Defaults to always true.
 
|-
 
|-
| <samp>AddMailOnBuild</samp>
+
| <samp>CustomFields</samp>
| ''(Optional)'' A list of [[Modding:Mail data|letter IDs]] to send to all players when the building is constructed for the first time.
+
| The [[#Custom data fields|custom fields]] for this entry.
 
|}
 
|}
   −
====Upgrades====
+
===Custom jukebox tracks===
 +
{{/doc status|a new doc page|done=false}}
 +
 
 +
You can now change [[jukebox]] audio tracks by editing the new <samp>Data/JukeboxTracks</samp> data asset.
 +
 
 +
This consists of a string → model lookup, where...
 +
* The key is the [[#Custom audio|audio cue ID]] to play (case-sensitive).
 +
* The value is a model with the fields listed below.
 +
 
 +
If the player has heard a music track not listed in <samp>Data/JukeboxTracks</samp>, it's automatically available with the title set to the cue name. To disable a track, add an entry with <samp>"Available": false</samp>.
 +
 
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 4,015: Line 3,935:  
! effect
 
! effect
 
|-
 
|-
| <samp>BuildingToUpgrade</samp>
+
| <samp>Name</samp>
| ''(Optional)'' The ID of the building for which this is an upgrade, or omit to allow constructing it as a new building. For example, the [[Coop|Big Coop]] sets this to <samp>"Coop"</samp>. Any numbers of buildings can be an upgrade for the same building, in which case the player can choose one upgrade path.
+
| ''(Optional)'' A [[Modding:Tokenizable strings|tokenizable string]] for the music track's in-game title. Defaults to the ID.
 
|-
 
|-
| <samp>IndoorItemMoves</samp>
+
| <samp>Available</samp>
| ''(Optional)'' When applied as an upgrade to an existing building, the placed items in its interior to move when transitioning to the new map. This is a list of models with these fields:
+
| ''(Optional)'' Whether the track should be shown in the jukebox menu. This can be <samp>true</samp> (always shown), <samp>false</samp> (never shown), or <samp>null</samp> (show if the player has heard it before). Default <samp>null</samp>.
{| class="wikitable"
+
 
 +
Tracks with <samp>"Available": true</samp> are listed first in the jukebox menu.
 
|-
 
|-
! field
+
| <samp>AlternativeTrackIds</samp>
! effect
+
| ''(Optional)'' A list of other cue names for this audio track (not case-sensitive). If the player has heard any of these track IDs, this entry is available in the menu. Default none.
|-
+
 
| <samp>Id</samp>
+
For example, this can be used when renaming a track to keep it unlocked for existing players:
| The [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for this entry within the current list.
+
<syntaxhighlight lang="js">
|-
+
"{{ModId}}_TrackName": {
| <samp>Source</samp>
+
    "Name": "{{i18n: track-name}}",
| The tile position on which any item will be moved.
+
    "AlternativeTrackIds": [ "OldTrackName" ]
|-
+
}
| <samp>Destination</samp>
+
</syntaxhighlight>
| The tile position to which to move the item.
  −
|-
  −
| <samp>Size</samp>
  −
| ''(Optional)'' The tile size of the area to move, specified as a model with <samp>X</samp> and <samp>Y</samp> fields. Defaults to a 1×1 area. If this is multiple tiles, the <samp>Source</samp> and <samp>Destination</samp> specify the top-left coordinate of the area.
  −
|}
  −
|-
  −
| <samp>UpgradeSignTile</samp>
  −
| ''(Optional)'' The tile position relative to the top-left corner of the building where the upgrade sign will be placed when Robin is building an upgrade, in the form <samp>"{{t|x}}, {{t|y}}"</samp>. Defaults to approximately <samp>"5, 1"</samp> if the building interior type is <samp>Shed</samp>, else <samp>"0, 0"</samp>.
  −
|-
  −
| <samp>UpgradeSignHeight</samp>
  −
| ''(Optional)'' The pixel height of the upgrade sign when Robin is building an upgrade. Defaults to 0.
   
|}
 
|}
   −
====Exterior behavior====
+
===Custom movies===
 +
{{/doc status|[[Modding:Movie theater data]]|done=false}}
 +
 
 +
: ''See also: [[#Custom movie concessions|custom movie concessions]].''
 +
 
 +
[[Modding:Movie theater data#Movie data|Movie data]] was previously very limited and prone to mod conflicts, since (a) we needed incrementing movie IDs like <samp>spring_movie_3</samp>, (b) we were limited to one movie per season, and (c) all sprites for each movie had to be in the vanilla <samp>LooseSprites/Movies</samp> spritesheet.
 +
 
 +
Stardew Valley 1.6 revamps how movies work to address those limitations.
 +
 
 +
<dl>
 +
<dt>Movie selection</dt>
 +
<dd><p>Movies were previously selected based on a specific ID pattern: <samp>spring_movie_0</samp> would play in spring the year you built the movie theater, <samp>spring_movie_1</samp> would play in spring the next year, etc. That meant it'd take two in-game years to see the first custom movie, and ID conflicts had to be managed manually.</p>
 +
 
 +
In 1.6, we can now have multiple movies per month based on the new fields listed below. If multiple movies can play in the same season, each movie will be shown for an equal block of days within the month (e.g. four movies will each play for seven consecutive days). If there are more movies than days, 28 movies will be chosen at random to play that month.</dd>
 +
 
 +
<dt>New data fields</dd>
 +
<dd>
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 4,051: Line 3,977:  
! effect
 
! effect
 
|-
 
|-
| <samp>Size</samp>
+
| <samp>Seasons</samp>
| ''(Optional)'' The building's width and height when constructed, measured in tiles. Defaults to a 1 x 1 area.
+
| ''(Optional)'' The seasons when the movie should play, or omit for any season. For example:
 +
<syntaxhighlight lang="js">"Seasons": [ "Spring", "Summer" ]</syntaxhighlight>
 
|-
 
|-
| <samp>CollisionMap</samp>
+
| <samp>YearModulus</samp><br /><samp>YearRemainder</samp>
| ''(Optional)'' An ASCII text block which indicates which of the building's tiles the players can walk onto, where each character can be <samp>X</samp> (blocked) or <samp>O</samp> (passable). Defaults to all tiles blocked.
+
| ''(Optional)'' If set, plays the movie on alternating years based on the formula <samp>theater_age % modulus == remainder</samp>, where <samp>theater_age</samp> is the number of years since the movie theater was built. If omitted, the movie plays in any year.
   −
For example, a [[stable]] covers a 2x4 tile area with the front two tiles passable:
+
For example:
<pre>XXXX
  −
XOOX</pre>
     −
When the collision map is parsed, leading/trailing whitespace is trimmed (both for the entire map and for each line). In JSON, you can specify it in two forms:
   
<syntaxhighlight lang="js">
 
<syntaxhighlight lang="js">
// single line with \n line breaks
+
// play in the first year, and every second year thereafter
"CollisionMap": "XXXX\nXOOX"
+
"YearModulus": 2,
 
+
"YearRemainder": 0
// multi-line with optional indentation
+
</syntaxhighlight>
"CollisionMap": "
+
<syntaxhighlight lang="js">
    XXXX
+
// play in the second year, and every second year thereafter
    XOOX
+
"YearModulus": 2,
"
+
"YearRemainder": 1
 
</syntaxhighlight>
 
</syntaxhighlight>
 
|-
 
|-
| <samp>HumanDoor</samp>
+
| <samp>Texture</samp>
| ''(Optional)'' The position of the door that can be clicked to warp into the building interior. This is measured in tiles relative to the top-left corner tile. Defaults to disabled.
+
| ''(Optional)'' The asset name for the movie poster and screen images, or omit to use <samp>LooseSprites\Movies</samp>.
 +
 
 +
This must be a spritesheet with one 490×128 pixel row per movie. A 13×19 area in the top-left corner of the row should contain the movie poster. With a 16-pixel offset from the left edge, there should be two rows of five 90×61 pixel movie screen images, with a six-pixel gap between each image. (The movie doesn't need to use all of the image slots.)
 
|-
 
|-
| <samp>AnimalDoor</samp>
+
| <samp>CranePrizes</samp>
| ''(Optional)'' The position and size of the door that animals use to enter/exit the building, if the building interior is an animal location, specified as an object with <samp>X</samp>, <samp>Y</samp>, <samp>Width</samp>, and <samp>Height</samp> fields. This is measured in tiles relative to the top-left corner tile. Defaults to disabled.
+
| ''(Optional)'' The items to add to the [[Movie Theater#Crane Game|crane game]] prize pool on days when this movie is playing, if any.
|-
  −
| <samp>AnimalDoorOpenDuration</samp><br /><samp>AnimalDoorCloseDuration</samp>
  −
| ''(Optional)'' The duration of the open/close animation for the animal door, measured in milliseconds. If omitted, the door switches to the open/closed state instantly.
  −
|-
  −
| <samp>AnimalDoorOpenSound</samp><br /><samp>AnimalDoorCloseSound</samp>
  −
| ''(Optional)'' The sound which is played once each time the animal door is opened/closed. Disabled by default.
  −
|}
     −
====Exterior appearance====
+
This consists of a list of models with these fields:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 4,092: Line 4,011:  
! effect
 
! effect
 
|-
 
|-
| <samp>SourceRect</samp>
+
| ''common fields''
| ''(Optional)'' The building's pixel area within the <samp>Texture</samp>, specified as an object with <samp>X</samp>, <samp>Y</samp>, <samp>Width</samp>, and <samp>Height</samp> fields. Defaults to the entire texture.
+
| 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.
 
|-
 
|-
| <samp>Skins</samp>
+
| <samp>Rarity</samp>
| ''(Optional)'' The appearances which can be selected from Robin's menu (like stone/plank/log [[cabin]]s), in addition to the default appearance based on <samp>Texture</samp>. This consists of a list of models with these fields:
+
| ''(Optional)'' The prize pool to add the item to. The possible values are <samp>1</samp> (common), <samp>2</samp> (rare), and <samp>3</samp> (deluxe). Default <samp>1</samp>.
{| class="wikitable"
+
|}
 
|-
 
|-
! field
+
| <samp>ClearDefaultCranePrizeGroups</samp>
! effect
+
| ''(Optional)'' The prize pools whose default items to discard, so only those specified by <samp>CranePrizes</samp> are available. Default none.
|-
+
 
| <samp>Id</samp>
+
For example:
| The [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for the skin.
+
<syntaxhighlight lang="js">"ClearDefaultCranePrizeGroups": [ 2, 3 ]</syntaxhighlight>
|-
+
|}
| <samp>Name</samp><br /><samp>Description</samp>
+
</dd>
| [[Modding:Tokenizable strings|Tokenizable strings]] for the skin's display name and description.
+
 
 +
<dt>Other changes</dt>
 +
<dd>
 +
* <samp>Data/Movies</samp>, <samp>Data/Concessions</samp>, and <samp>Data/MoviesReactions</samp> no longer have language variants. Instead translations were moved into <samp>Strings/*</samp> assets, and the data assets use [[Modding:Tokenizable strings|tokenizable strings]] to get text.
 +
* <samp>Data/Movies</samp> is now a list instead of a dictionary. The order determines the order movies are shown within a season. Content packs can edit them the same way as before.
 +
* Added a <samp>debug movieSchedule {{o|year}}</samp> command to help troubleshoot movie selection.
 +
* Added methods for C# mods: <samp>MovieTheater.GetMovieToday()</samp>, <samp>GetUpcomingMovie()</samp>, and <samp>GetUpcomingMovie(afterDate)</samp>.
 +
</dd>
 +
</dl>
 +
 
 +
For example, this content pack adds a new 'Pufferchick II' movie which plays in winter every third year:
 +
{{#tag:syntaxhighlight|<nowiki>
 +
{
 +
    "Format": "</nowiki>{{Content Patcher version}}<nowiki>",
 +
    "Changes": [
 +
        {
 +
            "Action": "EditData",
 +
            "Target": "Data/Movies",
 +
            "Entries": {
 +
                "{{ModId}}_PufferchickII": {
 +
                    "Id": "{{ModId}}_PufferchickII", // must specify ID again when creating a new entry
 +
 
 +
                    "Seasons": [ "winter" ],
 +
                    "YearModulus": 3,
 +
                    "YearRemainder": 0,
 +
 
 +
                    "Title": "Pufferchick II", // display text should usually use {{i18n}} for translations in actual usage
 +
                    "Description": "A sequel to the breakthrough adventure anime Pufferchick. The world is saved; what happens next?",
 +
                    "Tags": [ "family", "adventure" ],
 +
 
 +
                    "Texture": "{{InternalAssetKey: assets/movie.png}}", // an image in your content pack
 +
                    "SheetIndex": 0,
 +
 
 +
                    "Scenes": [ ... ]
 +
                }
 +
            }
 +
        }
 +
    ]
 +
}</nowiki>|lang=javascript}}
 +
 
 +
===Custom wedding event===
 +
{{/doc status|a new doc page|done=false}}
 +
 
 +
The [[Marriage#The Wedding|wedding]] event can now be changed by editing the <samp>Data\Weddings</samp> data asset, which consists of a data model with two relevant fields (listed below).
 +
 
 +
{| class="wikitable"
 
|-
 
|-
| <samp>Texture</samp>
+
! field
| The asset name for the texture under the game's Content folder.
+
! effect
 
|-
 
|-
| <samp>Condition</samp>
+
| <samp>EventScript</samp>
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether this skin should be available to apply. This doesn't change buildings which already have it applied. Defaults to always true.
+
| The [[Modding:Event data|event scripts]] which play the wedding. The game will use the script for the spouse NPC/player if it exists, otherwise it'll use the default script.
|-
+
 
| <samp>BuildDays</samp><br /><samp>BuildCost</samp><br /><samp>BuildMaterials</samp>
+
This consists of a string → string dictionary, where...
| ''(Optional)'' If set, overrides the equivalent field in the building data.
+
* The key is an NPC internal name (like <samp>Abigail</samp>), unique player ID, or <samp>default</samp> for the default script (which handles marrying either an NPC or player);
 +
* The value is a [[Modding:Tokenizable strings|tokenizable strings]] for the event script to play.
 +
 
 +
The event scripts also have access to three extra tokens:
 +
{| class="wikitable"
 
|-
 
|-
| <samp>ShowAsSeparateConstructionEntry</samp>
+
! token
| ''(Optional)'' Whether this skin should be shown as a separate building option in the construction menu (like cabins). Default false.
+
! effect
 
|-
 
|-
| <samp>Metadata</samp>
+
| <samp>[SetupContextualWeddingAttendees]</samp>
| ''(Optional)'' Equivalent to the <samp>Metadata</samp> field on the building. Properties defined in this field are added to the building's metadata when this skin is active, overwriting the previous property with the same name if applicable. Default none.
+
| The concatenated <samp>Setup</samp> values for each of the <samp>Attendees</samp> present in the wedding.
|}
   
|-
 
|-
| <samp>FadeWhenBehind</samp>
+
| <samp>[ContextualWeddingCelebrations]</samp>
| ''(Optional)'' Whether the building should become semi-transparent when the player is behind it. Default true.
+
| The concatenated <samp>Celebration</samp> values for each of the <samp>Attendees</samp> present in the wedding.
 
|-
 
|-
| <samp>DrawOffset</samp>
+
| <samp>[SpouseActor]</samp>
| ''(Optional)'' A pixel offset applied to the building sprite's placement in the world. Default 0.
+
| The actor ID for the NPC or other player being married (like <samp>Abigail</samp> for an NPC or <samp>farmer2</samp> for a player). This can be used in event commands like <code>faceDirection [SpouseActor] 1</code>.
 +
 
 +
(You can also use <samp>spouse</samp> as an actor ID, but that will only work when marrying an NPC.)
 +
|}
 
|-
 
|-
| <samp>SeasonOffset</samp>
+
| <samp>Attendees</samp>
| ''(Optional)'' A pixel offset to apply each season. This is applied to the <samp>SourceRect</samp> position by multiplying the offset by 0 (spring), 1 (summer), 2 (fall), or 3 (winter). Default 0, so all seasons use the same source rect.
+
| The other NPCs which should attend the wedding (unless they're the spouse). This consists of a string → model lookup, where the key is the internal NPC name, and the value is a model with these fields:
|-
  −
| <samp>SortTileOffset</samp>
  −
| ''(Optional)'' A Y tile offset applied when figuring out render layering. For example, a value of <samp>2.5</samp> will treat the building as if it was 2.5 tiles further up the screen for the purposes of layering. Default 0.
  −
|-
  −
| <samp>DrawLayers</samp>
  −
| ''(Optional)'' A list of textures to draw over or behind the building, with support for conditions and animations. This consists of a list of models with these fields:
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 4,143: Line 4,109:  
! effect
 
! effect
 
|-
 
|-
| <samp>Id</samp>
+
| <samp>ID</samp>
| The [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for this entry within the current list.
+
| The internal NPC name.
 
|-
 
|-
| <samp>SourceRect</samp>
+
| <samp>Setup</samp>
| The pixel area within the <samp>texture</samp> to draw, formatted like <samp>"{{t|x}} {{t|y}} {{t|width}} {{t|height}}"</samp>. If the overlay is animated via <samp>FrameCount</samp>, this is the area of the first frame.
+
| The NPC's tile position and facing direction when they attend. This is equivalent to field index 2 in the [[Modding:Event data#Basic format|event basic data]].
 
|-
 
|-
| <samp>DrawPosition</samp>
+
| <samp>Celebration</samp>
| The tile position at which to draw the top-left corner of the texture, relative to the building's top-left corner tile.
+
| ''(Optional)'' The [[Modding:Event data|event script]] to run during the celebration, like <samp>faceDirection Pierre 3 true</samp> which makes Pierre turn to face left. This can contain any number of script commands.
 
|-
 
|-
| <samp>Texture</samp>
+
| <samp>Condition</samp>
| ''(Optional)'' The asset name of the texture to draw. Defaults to the building's default <samp>Texture</samp> field.
+
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether the NPC should attend. Defaults to true.
 
|-
 
|-
| <samp>DrawInBackground</samp>
+
| <samp>IgnoreUnlockConditions</samp>
| ''(Optional)'' Whether to draw the texture behind the building sprite (i.e. underlay) instead of over it.
+
| ''(Optional)'' Whether to add the NPC even if their entry in <samp>Data/Characters</samp> has an <samp>UnlockConditions</samp> field which doesn't match. Default false.
|-
+
|}
| <samp>SortTileOffset</samp>
+
|}
| ''(Optional)'' A Y tile offset applied when figuring out render layering. For example, a value of <samp>2.5</samp> will treat the texture as if it was 2.5 tiles further up the screen for the purposes of layering. Default 0.
+
 
|-
+
===Game state queries===
| <samp>OnlyDrawIfChestHasContents</samp>
+
{{/doc status|[[Modding:Game state queries]]|done=true}}
| ''(Optional)'' The ID of a chest defined in the <samp>Chests</samp> field which must contain items. If it's empty, this overlay won't be rendered. Default none.
  −
|-
  −
| <samp>FrameCount</samp><br /><samp>FramesPerRow</samp><br /><samp>FrameDuration</samp>
  −
| ''(Optional)'' If <samp>FrameCount</samp> is more than one, the building overlay will be animated automatically. For each frame, the <samp>SourceRect</samp> will be offset by its <samp>Width</samp> to the right up to <samp>FramesPerRow - 1</samp> times, and then down by its <samp>Height</samp>. Each frame will be rendered on-screen for <samp>FrameDuration</samp> milliseconds before switching to the next frame.
     −
For example, if you set <samp>FrameCount</samp> to 6 and <samp>FramesPerRow</samp> to 3, the building will expect the frames to be laid out like this in the spritesheet (where frame 1 matches <samp>SourceRect</samp>):
+
A ''game state query'' is a new vanilla way to specify conditions for some content like [[#Custom shops|shop data]], inspired by [[Modding:Content Patcher|Content Patcher]]'s conditions.
<pre>
  −
┌───┬───┬───┐
  −
│ 1 │ 2 │ 3 │
  −
├───┼───┼───┤
  −
│ 4 │ 5 │ 6 │
  −
└───┴───┴───┘
  −
</pre>
  −
|-
  −
| <samp>AnimalDoorOffset</samp>
  −
| ''(Optional)'' A pixel offset applied to the draw layer when the animal door is open. While the door is opening, the percentage open is applied to the offset (e.g. 50% open = 50% offset).
  −
|}
  −
|-
  −
| <samp>DrawShadow</samp>
  −
| ''(Optional)'' Whether to draw an automatic shadow along the bottom edge of the building's sprite. Default true.
  −
|}
     −
====Interior====
+
===Gender changes===
{| class="wikitable"
+
{{/doc status|[[Modding:Dialogue]]|done=false}}
|-
  −
! field
  −
! effect
  −
|-
  −
| <samp>IndoorMap</samp>
  −
| ''(Optional)'' The name of the map asset under <samp>Maps</samp> to load for the building interior. For example, <samp>"Shed"</samp> will load the [[shed]]'s <samp>Maps/Shed</samp> map.
  −
|-
  −
| <samp>IndoorMapType</samp>
  −
| ''(Optional)'' The full name of the C# location class which will manage the building's interior location. This must be one of the vanilla types to avoid a crash when saving. There are too many to list here, but the most useful types are likely...
  −
* <samp>StardewValley.AnimalHouse</samp>;
  −
* <samp>StardewValley.Locations.Cabin</samp>;
  −
* <samp>StardewValley.Locations.Cellar</samp>;
  −
* <samp>StardewValley.Locations.DecoratableLocation</samp>;
  −
* <samp>StardewValley.Locations.FarmCave</samp>;
  −
* <samp>StardewValley.Locations.FarmHouse</samp>;
  −
* <samp>StardewValley.Shed</samp>;
  −
* and <samp>StardewValley.SlimeHutch</samp>.
  −
Defaults to the generic <samp>StardewValley.GameLocation</samp> class.
  −
|-
  −
| <samp>NonInstancedIndoorLocation</samp>
  −
| ''(Optional)'' The name of the existing global location to treat as the building's interior, like <samp>FarmHouse</samp> and <samp>Greenhouse</samp> for their buildings.
     −
Each location can only be used by one building. If the location is already in use (e.g. because the player has two of this building), each subsequent building will use the <samp>IndoorMap</samp> and <samp>IndoorMapType</samp> instead. For example, the first greenhouse will use the global <samp>Greenhouse</samp> location, and any subsequent greenhouse will use a separate instanced location.
+
* Added an [[#gender-switch|''inline gender-switch token'']] to change text depending on the player's gender. This reduces duplicate text, works in more places than the <samp>^</samp> dialogue token, works in mail and other places where <samp>^</samp> has a different meaning, and supports non-binary gender.
|-
+
* For C# mod authors, added a unified <samp>Gender</samp> field for players and NPCs with the possible values <samp>Male</samp>, <samp>Female</samp>, and <samp>Unspecified</samp>. This replaces <samp>Farmer.isMale</samp> and the numeric NPC gender constants. Note that vanilla still only sets players to male or female, though mods can override it.
| <samp>MaxOccupants</samp>
+
* Gender-specific clothing variants can now be worn by any gender.
| ''(Optional)'' The maximum number of animals who can live in this building.
+
* Removed French-only support for using <samp>^</samp> dialogue token in non-dialogue text. This is superseded by the new inline gender-switch command.
|-
+
 
| <samp>AllowAnimalPregnancy</samp>
+
===Item queries===
| ''(Optional)'' Whether animals can get pregnant and produce offspring in this building. Default false.
+
{{/doc status|[[Modding:Item queries]]|done=true}}
|-
  −
| <samp>ValidOccupantTypes</samp>
  −
| ''(Optional)'' A list of building IDs whose animals to allow in this building too. For example, <code>[ "Barn", "Coop" ]</code> will allow [[barn]] and [[coop]] animals in this building. Default none.
  −
|}
     −
====Item processing====
+
''Item queries'' are a new built-in way to choose one or more items dynamically, instead of specifying a single item ID. These are used in various places like [[#Custom machines|machine data]] and [[#Custom shops|shop data]].
{| class="wikitable"
  −
|-
  −
! field
  −
! effect
  −
|-
  −
| <samp>HayCapacity</samp>
  −
| ''(Optional)'' The amount of hay that can be stored in this building. If built on the [[The Farm|farm]], this works just like [[silo]]s and contributes to the farm's available hay.
  −
|-
  −
| <samp>ItemConversions</samp>
  −
| ''(Optional)'' The item processing rules which take input items and convert them into output items using the inventories defined by <samp>Chests</samp>. This consists of a list of models with these fields:
  −
{| class="wikitable"
  −
|-
  −
! field
  −
! effect
  −
|-
  −
| <samp>Id</samp>
  −
| The [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for this rule within the current list.
  −
|-
  −
| <samp>RequiredTags</samp>
  −
| A list of [[Modding:Items#Context tags|context tags]] to match against an input item. An item must have ''all'' of these tags to be accepted.
  −
|-
  −
| <samp>SourceChest</samp>
  −
| The ID of the inventory defined in <samp>Chests</samp> from which to take input items.
  −
|-
  −
| <samp>DestinationChest</samp>
  −
| The ID of the inventory defined in <samp>Chests</samp> in which to store output items.
  −
|-
  −
| <samp>ProducedItems</samp>
  −
| The output items produced when an input item is converted. 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 by machine output.
     −
If set to an [[Modding:Item queries|item query]] which returns multiple items, one of them will be selected at random.
+
For example, a shop can sell a random [[House Plant|house plant]] using the <samp>RANDOM_ITEMS</samp> query:
|-
+
<syntaxhighlight lang="js">
| <samp>Chance</samp>
+
{
| ''(Optional)'' The probability that the item will be produced, as a value between 0 (never drops) and 1 (always drops). Default 1 (100% chance).
+
    "ItemId": "RANDOM_ITEMS (F) 1376 1390",
|}
+
    "MaxItems": 1
|-
+
}
| <samp>RequiredCount</samp>
+
</syntaxhighlight>
| ''(Optional)'' The number of the input item to consume. Default 1.
+
 
|-
+
===Item spawn fields===
| <samp>MaxDailyConversions</samp>
+
{{/doc status|[[Modding:Item queries#Item spawn fields]]|done=true}}
| ''(Optional)'' The maximum number of the input item which can be processed each day. Each conversion rule has its own separate maximum (e.g. if you have two rules each with a max of 1, then you can convert one of each daily). Set to -1 to allow unlimited conversions. Default 1.
+
 
|}
+
Several data assets (like [[#Custom machines|machines]] and [[#Custom shops|shops]]) let you configure items to create using item queries. For consistency, these all share a set of common fields.
|-
+
 
| <samp>Chests</samp>
+
===Color fields===
| ''(Optional)'' The input/output inventories that can be accessed from a tile on the building exterior. The allowed items are defined by the separate <samp>ItemConversions</samp> field. This is a list of models with these fields:
+
{{/doc status|[[Modding:Common data field types#Color]]|done=true}}
{| class="wikitable"
  −
|-
  −
! field
  −
! effect
  −
|-
  −
| <samp>Id</samp>
  −
| The [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for this chest within the current list.
     −
This is referenced from the <samp>ItemConversions</samp> field.
+
1.6 adds a standardized color format used in various data fields. This can be a color name, hexadecimal color code, or 8-bit RGB color code.
|-
  −
| <samp>Type</samp>
  −
| The inventory type. This must be one of:
  −
* <samp>Chest</samp>: show a normal chest UI on click.
  −
* <samp>Collect</samp>: provides items for the player to collect. Clicking the tile will do nothing (if empty), grab the item directly (if it only contains one item), else show a grab-only inventory UI.
  −
* <samp>Load</samp>: lets the player add items for the building to process.
  −
|-
  −
| <samp>Sound</samp>
  −
| ''(Optional)'' The sound to play once when the player clicks the chest.
  −
|-
  −
| <samp>InvalidItemMessage</samp><br /><samp>InvalidCountMessage</samp><br /><samp>ChestFullMessage</samp>
  −
| ''(Optional)'' A [[Modding:Tokenizable strings|tokenizable string]] to show when the player tries to add an item to the chest when...
  −
* it isn't a supported item;
  −
* it's supported but they don't have enough in their inventory;
  −
* the chest has no more room to accept it.
  −
If omitted, the player interaction is ignored with no message shown.
  −
|-
  −
| <samp>InvalidItemMessageCondition</samp>
  −
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether <samp>InvalidItemMessage</samp> should be shown. This can use item-related queries like <samp>ITEM_TYPE</samp>. Defaults to always true.
  −
|-
  −
| <samp>DisplayTile</samp>
  −
| ''(Optional)'' The chest's position on the building exterior, measured in tiles from the top-left corner of the building, specified in the form <samp>"{{t|x}}, {{t|y}}"</samp>. This affects the position of the 'item ready to collect' bubble. If omitted, the bubble is disabled.
  −
|-
  −
| <samp>DisplayHeight</samp>
  −
| ''(Optional)'' If <samp>DisplayTile</samp> is set, the chest's tile height like <samp>1.5</samp>.
  −
|}
  −
|}
     −
====Tile interactions====
+
For example, you can set debris color in [[#Custom wild trees|<samp>Data/WildTrees</samp>]]:
{| class="wikitable"
+
<syntaxhighlight lang="js">
|-
+
"DebrisColor": "White"
! field
+
</syntaxhighlight>
! effect
+
 
|-
+
===<samp>modData</samp> field changes===
| <samp>ActionTiles</samp>
+
The <samp>modData</samp> fields are dictionaries of arbitrary string values which are synchronized in multiplayer and persisted in the save file, so mods can store custom data about the instances. The game already has the field for buildings, characters (including NPCs and players), items, locations, and terrain features.
| ''(Optional)'' A list of tiles which the player can click to trigger an <samp>Action</samp> [[Modding:Maps|map tile property]]. This consists of a list of models with these fields:
  −
{| class="wikitable"
  −
|-
  −
! field
  −
! effect
  −
|-
  −
| <samp>Id</samp>
  −
| The [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for this entry within the current list.
  −
|-
  −
| <samp>Tile</samp>
  −
| The tile position, relative to the building's top-left corner tile.
  −
|-
  −
| <samp>Action</samp>
  −
| The [[Modding:Tokenizable strings|tokenizable string]] for the action to perform, excluding the <samp>Action</samp> prefix. For example, <samp>"Dialogue Hi there @!"</samp> to show a messagebox like "''Hi there <player name>!''". The tokenizable string is expected before the action is raised. See the [[Modding:Maps#Tile properties 2|list of tile properties]] for useful <samp>Action</samp> values.
  −
|}
  −
|-
  −
| <samp>DefaultAction</samp>
  −
| ''(Optional)'' The default tile action if the clicked tile isn't in <samp>ActionTiles</samp>. Default none.
  −
|-
  −
| <samp>TileProperties</samp>
  −
| ''(Optional)'' The [[Modding:Maps|map tile properties]] to set. This consists of a list of models with these fields:
  −
{| class="wikitable"
  −
|-
  −
! field
  −
! effect
  −
|-
  −
| <samp>Id</samp>
  −
| The [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for this entry within the current list.
  −
|-
  −
| <samp>Name</samp>
  −
| The tile property name to set.
  −
|-
  −
| <samp>Value</samp>
  −
| ''(Optional)'' The tile property value to set, or omit to set a null value.
  −
|-
  −
| <samp>Layer</samp>
  −
| The name of the map layer whose tiles to change.
  −
|-
  −
| <samp>TileArea</samp>
  −
| The tiles to which to add the property, relative to the top-left corner of the building's collision box. This is specified as an object with <samp>X</samp>, <samp>Y</samp>, <samp>Width</samp>, and <samp>Height</samp> fields.
  −
|}
  −
|-
  −
| <samp>AdditionalTilePropertyRadius</samp>
  −
| ''(Optional)'' When checking whether the player clicked on a <samp>TileProperties</samp> tile, an added distance around the building at which tile locations may be placed. Default 0, so only tile properties within the normal building bounds will work.
  −
|}
     −
====Advanced====
+
Stardew Valley 1.6...
{| class="wikitable"
+
* Adds <samp>modData</samp> fields to the <samp>Crop</samp>, <samp>Projectile</samp>, and <samp>Quest</samp> types too.
|-
+
* Moves <samp>ModDataDictionary</samp> into the <samp>StardewValley.Mods</samp> namespace.
! field
+
* Fixes <samp>Item.modData</samp> not copied when performing special equipment replacement (e.g. for the [[Pans|copper pan]] work as a hat).
! effect
  −
|-
  −
| <samp>Metadata</samp>
  −
| ''(Optional)'' A list of custom properties applied to the building, which can optionally be overridden per-skin in the <samp>Skins</samp> field. Default none.
     −
The base game recognizes these properties:
+
===Quantity modifiers===
{| class="wikitable"
+
{{/doc status|[[Modding:Common data field types#Quantity_modifiers]]|done=true}}
|-
+
 
! property
+
''Quantity modifiers'' apply dynamic changes to a numeric field in a data asset like [[#Custom shops|<samp>Data/Shops</samp>]] or [[#Custom machines|<samp>Data/Machines</samp>]]. For example, you can multiply a shop item's price or increase a machine output's quality. You can specify any number of modifiers for the same field.
! description
  −
|-
  −
| <samp>ChimneyPosition: {{t|x}} {{t|y}}</samp>
  −
| ''(Optional)'' The pixel position at which to place a chimney on the building exterior, relative to the top-left corner of the sprite. This will apply the same logic as the farmhouse chimney (e.g. producing smoke if there's a lit fireplace inside the building).
  −
|-
  −
| <samp>ChimneyPosition{{o|upgrade level}}: {{t|x}} {{t|y}}</samp>
  −
| ''(Optional, for farmhouses/cabins only)'' Override <samp>ChimneyPosition</samp> for the given upgrade level, starting from 0 for the initial farmhouse/cabin. If there's no override for the current upgrade level, the highest override for a lower upgrade level is used (if any). For example, <samp>ChimneyPosition3</samp> would be used for the third house upgrade (and the fourth if there's no <samp>ChimneyPosition4</samp>).
  −
|}
     −
This can also contain arbitrary custom properties, which C# mods can read using <samp>building.GetMetadata(key)</samp>.
+
===Tokenizable string format===
|-
+
{{/doc status|[[Modding:Tokenizable strings]]|done=true}}
| <samp>BuildingType</samp>
  −
| ''(Optional)'' The full name of the C# type to instantiate for the building instance. Defaults to a generic <samp>Building</samp> instance.
     −
'''⚠ Caution:''' this is meant to support vanilla building types like <samp>StardewValley.Shed</samp>. Setting this to a non-vanilla type will cause a crash when it's written to the save file, and may cause crashes in multiplayer. If you need custom behavior, consider handling it in C# based on the building type instead of creating a custom subclass; otherwise you'll need a framework mod like {{nexus mod|1348|SpaceCore}} to handle serialization and multiplayer sync.
+
Stardew Valley 1.6 adds ''tokenizable strings'', which support any combination of literal text and token values. That includes a set of built-in tokens like <samp>FarmName</samp>, <samp>LocalizedText</samp>, etc.
|-
  −
| <samp>ModData</samp>
  −
| ''(Optional)'' A string → string lookup of arbitrary <samp>modData</samp> values to attach to the building when it's constructed.
  −
|-
  −
| <samp>CustomFields</samp>
  −
| The [[#Custom data fields|custom fields]] for this entry.
  −
|}
     −
===Build anywhere===
+
For example, previously you often needed to load text from a [[Modding:Common data field types#Translation key|translation key]]. With this new format, you can use the literal text directly in the asset instead (including [[Modding:Content Patcher|Content Patcher]] tokens):
* You can now allow building construction for any location using the [[#Map/tile property changes|new <samp>CanBuildHere</samp> and related map properties]]. The game will adjust accordingly (e.g. Robin will let you choose where to construct the building).
  −
* Buildings and animals are no longer hardcoded to the [[The Farm|farm]] location (except [[cabin]]s and the [[farmhouse]] which still are).
  −
* Scything hay will now add hay to silos in any location, and animals will be auto-fed from hay in any location.
     −
===Other building changes===
+
<syntaxhighlight lang="js">
: ''See also: [[#Other location/map changes|other location changes]] for location-related building changes.''
+
// before
 +
"Dialogue": "Strings\\StringsFromCSFiles:ShopMenu.cs.11488",
   −
; General building changes
+
// after: any combination of literal text and tokens
* Building display names & descriptions are now in <samp>Strings/Buildings</samp> for reuse.
+
"Dialogue": "Welcome to Pierre's, {{PlayerName}}! How is [FarmName] doing?",
* Removed <samp>Data/Blueprints</samp>. This has been replaced by <samp>Data/Buildings</samp> (building data) and <samp>Strings/Buildings</samp> (display names & descriptions).
  −
<ul>
  −
<li>Added methods to simplify common operations:
  −
{| class="wikitable"
  −
|-
  −
! type
  −
! method
  −
! effect
  −
|-
  −
|rowspan="7"| <samp>Building</samp>
  −
| <samp>CreateInstanceFromId</samp>
  −
| Create a building instance from its type ID in <samp>Data/Buildings</samp>. For example:
  −
<syntaxhighlight lang="c#">
  −
Building shippingBin = Building.CreateInstanceFromId("Shipping Bin", Vector2.Zero); // creates an instance of StardewValley.Buildings.ShippingBin
   
</syntaxhighlight>
 
</syntaxhighlight>
|-
  −
| <samp>GetData</samp><br /><samp>TryGetData</samp>
  −
| Get the data for the building's type from <samp>Data/Building</samp>.
  −
|-
  −
| <samp>GetMetadata</samp>
  −
| Get a value from [[#Custom buildings|the <samp>Metadata</samp> field in <samp>Data/Buildings</samp>]] for this building.
  −
|-
  −
| <samp>GetPaintDataKey</samp>
  −
| Get the key in <samp>Data/PaintData</samp> for this building, if it has any.
  −
|-
  −
| <samp>ReloadBuildingData</samp>
  −
| Apply the latest data in <samp>Data/Buildings</samp> to this building.
  −
|-
  −
| <samp>FinishConstruction</samp>
  −
| If the building is being constructed or upgrade, instantly finish doing so.
  −
|-
  −
| <samp>UpdateTransparency</samp>
  −
| Update the building transparency on tick for the local player's position.
     −
This method mainly exists to let mods override/patch the transparency logic.
+
Tokenizable strings are only usable in specific fields (as indicated in their wiki or code docs).
|-
+
 
| <samp>Farm</samp>
+
See [[Modding:Tokenizable strings]] for usage.
| <samp>GetMainFarmHouse</samp>
+
 
| Get the main [[farmhouse]] building.
+
===[[Modding:Event data|Event]] changes===
|-
+
{{/doc status|[[Modding:Event data]]|done=false}}
| <samp>GameLocation</samp>
  −
| <samp>OnParentBuildingUpgraded</samp>
  −
| Called when the building containing this location is upgraded, if applicable.
  −
|}
  −
</li>
  −
</ul>
  −
* Added building <samp>id</samp> field, which uniquely identifies each building in the world.
     −
; [[Junimo Hut|Junimo hut]] changes
+
====High-level changes====
* The <samp>JunimoHut.cropHarvestRange</samp> field is now per-building and editable.
+
* Event IDs are now [[Modding:Common data field types#Unique string ID|unique string IDs]], so mods can use a unique key instead of hoping no other mod uses the same number. Unconditional events must have an empty precondition in their key (like <samp>"Example.ModId_EventName/"</samp>) to distinguish them from forks.
 +
* Event/festival commands with a direction argument now allow both case-insensitive names (like <samp>up</samp>) and numeric values.
 +
* Event script errors are now logged (in addition to being shown in the chatbox like before).
 +
* For C# mods:
 +
** You can now add custom event preconditions & commands using new <samp>Event</samp> methods (<samp>RegisterPrecondition</samp>, <samp>RegisterPreconditionAlias</samp>, <samp>RegisterCommand</samp>, and <samp>RegisterCommandAlias</samp>).
 +
** Added <samp>Event.fromAssetName</samp>, which indicates which data asset (if any) the event was loaded from.
 +
** Added <samp>Game1.eventsSeenSinceLastLocationChange</samp> to track the events that played since the player arrived in their current location.
   −
; [[Fish Pond|Fish pond]] changes
+
====Precondition changes====
 
<ul>
 
<ul>
<li>In <samp>Data/FishPondData</samp>, added a <samp>Precedence</samp> field which sets the order in which entries are checked for a match (with lower values checked first). This ensures that the fallback entries are checked after specific fish. For consistency, vanilla entries use these values:
+
<li>Added validation for preconditions. If a format or assumption is invalid, the game now logs a detailed error.</li>
{| class="wikitable"
+
<li>Added case-insensitive readable names for all preconditions. For example, <code>j 4/t 800 1300/a 0 54/H</code> can now optionally be written <code>daysPlayed 4/time 800 1300/tile 0 54/isHost</code>.
|-
+
{{collapse|list of new names|content=
! precedence
+
List of new event precondition names:
! used for
+
<pre>
|-
+
alias | readable name
| 0<br /><small>(default value)</small>
+
----- | ------------------------------
| specific fish
+
*    | WorldState
 +
*n    | HostOrLocalMail
 +
a    | Tile
 +
b    | ReachedMineBottom
 +
B    | SpouseBed
 +
C    | CommunityCenterOrWarehouseDone
 +
c    | FreeInventorySlots
 +
D    | Dating
 +
e    | SawEvent
 +
f    | Friendship
 +
g    | Gender
 +
H    | IsHost
 +
h    | MissingPet
 +
Hn    | HostMail
 +
i    | HasItem
 +
j    | DaysPlayed
 +
J    | JojaBundlesDone
 +
L    | InUpgradedHouse
 +
m    | EarnedMoney
 +
M    | HasMoney
 +
N    | GoldenWalnuts
 +
n    | LocalMail
 +
O    | Spouse
 +
p    | NpcVisibleHere
 +
q    | ChoseDialogueAnswers
 +
r    | Random
 +
R    | Roommate
 +
S    | SawSecretNote
 +
s    | Shipped
 +
t    | Time
 +
u    | DayOfMonth
 +
v    | NpcVisible
 +
w    | Weather
 +
x    | SendMail
 +
y    | Year
 +
</pre>
 +
And for deprecated preconditions (e.g. <code>NotSeason</code> is superseded by <code>!Season</code>):
 +
<pre>
 +
alias | readable name
 +
----- | ---------------------------------
 +
*l    | NotHostOrLocalMail
 +
A    | NotActiveDialogueEvent
 +
d    | NotDayOfWeek
 +
F    | NotFestivalDay
 +
Hl    | NotHostMail
 +
k    | NotSawEvent
 +
l    | NotLocalMail
 +
o    | NotSpouse
 +
Rf    | NotRoommate
 +
U    | NotUpcomingFestival
 +
X    | NotCommunityCenterOrWarehouseDone
 +
z    | NotSeason
 +
</pre>
 +
}}
 +
</li>
 +
<li>Event & preconditions are now quote-aware, so you can escape spaces and slashes in arguments like <code>/G "SEASON Spring"/</code>.</li>
 +
<li>Added new preconditions:
 +
{| class="wikitable"
 
|-
 
|-
| 100
+
! precondition
| custom groups (e.g. desert fish)
+
! description
 
|-
 
|-
| 500
+
| <samp>!</samp>
| broad fish type (e.g. ocean fish)
+
| Prefixing <samp>!</samp> to any other precondition will now invert it. For example, <code>!spouse Abigail</code> will match if the player is ''not'' married to Abigail.
 
|-
 
|-
| 1000
+
| <samp>ActiveDialogueEvent {{t|id}}</samp>
| fallback (e.g. fish category)
+
| The special dialogue event with the given ID (including [[Modding:Dialogue#Conversation_topics|Conversation Topics]]) is in progress.
|}
  −
</li>
  −
<li>[[Legendary Fish|Legendary fish]] can now be added to [[Fish Pond|fish ponds]] if they have an entry in <samp>Data/FishPondData</samp>.</li>
  −
</ul>
  −
 
  −
==What's new for NPCs==
  −
===Custom NPCs===
  −
[[Modding:NPC data|Custom NPC data]] has been overhauled in 1.6. The new <samp>Data/Characters</samp> asset (which replaces <samp>Data/NPCDispositions</samp> + <samp>Data/spousePatios</samp> + <samp>Data/spouseRooms</samp>) uses a data model format that's easier to edit and understand, and has a lot of fields to customize previously-hardcoded data.
  −
 
  −
====Format====
  −
This consists of a string → model lookup, where...
  −
* The key is a [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for the NPC like <samp>Example.ModId_NpcName</samp>, which will be used as the internal <samp>Name</samp> (not <samp>DisplayName</samp>).
  −
* The value is a model with the following fields.
  −
 
  −
<dl style="margin-left: 2em;">
  −
<dt>Basic info:</dt>
  −
<dd>
  −
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>DayOfWeek {{t|day}}+</samp>
! effect
+
| Today is one of the specified days (may specify multiple days). This can be a case-insensitive three-letter abbreviation (like <samp>Mon</samp>) or full name (like <samp>Monday</samp>).
 
|-
 
|-
| <samp>DisplayName</samp>
+
| <samp>FestivalDay</samp>
| A [[Modding:Tokenizable strings|tokenizable string]] for the NPC's display name.
+
| Today is a [[Festivals|festival]] day.
 
|-
 
|-
| <samp>Language</samp>
+
| <samp>GameStateQuery {{t|query}}</samp>
| ''(Optional)'' The language spoken by the NPC. One of <samp>Default</samp> (the default language understood by the player) or <samp>Dwarvish</samp> (which the player can only understand after finding the [[Dwarvish Translation Guide|Dwarvish translation guide]]). Default <samp>Default</samp>.
+
| A [[Modding:Game state queries|game state query]] matches, like <code>G !WEATHER Here Sun</code> for 'not sunny in this location'.
 
|-
 
|-
| <samp>Gender</samp>
+
| <samp>Season {{t|season}}+</samp>
| ''(Optional)'' The NPC's gender identity. One of <samp>Female</samp>, <samp>Male</samp>, or <samp>Undefined</samp>. Default <samp>Undefined</samp>.
+
| The current season is one of the given values (may specify multiple seasons).
 
|-
 
|-
| <samp>Age</samp>
+
| <samp>Skill {{t|skill name}} {{t|min level}}</samp>
| ''(Optional)'' The general age of the NPC. One of <samp>Child</samp>, <samp>Teen</samp>, or <samp>Adult</samp>. Default <samp>Adult</samp>.
+
| The current farmer has reached at least {{t|min level}} for the given {{t|skill name}} (one of <samp>Combat</samp>, <samp>Farming</samp>, <samp>Fishing</samp>, <samp>Foraging</samp>, <samp>Luck</samp>, or <samp>Mining</samp>).
 
  −
This affects generated dialogue lines (e.g. a child might say "stupid" and an adult might say "depressing"), generic dialogue (e.g. a child might respond to dumpster diving with "''Eww... What are you doing?''" and a teen would say "''Um... Why are you digging in the trash?''"), and the gift they choose as [[Feast of the Winter Star]] gift-giver. Children are also excluded from item delivery quests.
   
|-
 
|-
| <samp>Manner</samp>
+
| <samp>UpcomingFestival {{t|day offset}}</samp>
| ''(Optional)'' A measure of the character's general politeness, which affects some generic dialogue lines. One of <samp>Neutral</samp>, <samp>Polite</samp>, or <samp>Rude</samp>. Default <samp>Neutral</samp>.
+
| A [[Festivals|festival]] day will occur within the given number of days.
 +
|}</li>
 +
<li>Changed specific preconditions:
 +
{| class="wikitable"
 
|-
 
|-
| <samp>SocialAnxiety</samp>
+
! name
| ''(Optional)'' A measure of the character's comfort with social situations, which affects some generic dialogue lines. One of <samp>Neutral</samp>, <samp>Outgoing</samp>, or <samp>Shy</samp>. Default <samp>Neutral</samp>.
+
! changes
 
|-
 
|-
| <samp>Optimism</samp>
+
| <samp>ChoseDialogueAnswers</samp> (<samp>q</samp>)
| ''(Optional)'' A measure of the character's overall optimism. One of <samp>Neutral</samp>, <samp>Negative</samp>, or <samp>Positive</samp>. Default <samp>Neutral</samp>.
+
| &#32;
 +
* Fixed precondition ignoring every second answer ID.
 
|-
 
|-
| <samp>BirthSeason</samp>
+
| <samp>InUpgradedHouse</samp> (<samp>L</samp>)
| ''(Optional if non-social)'' The season name (case-sensitive) for the NPC's birthday. One of <samp>spring</samp>, <samp>summer</samp>, <samp>fall</samp>, or <samp>winter</samp>. Default none.
+
| &#32;
 +
* Added optional argument for the min upgrade level.
 
|-
 
|-
| <samp>BirthDay</samp>
+
| <samp>MissingPet</samp> (<samp>h</samp>)
| ''(Optional if non-social)'' The day number for the NPC's birthday. Default 0.
+
| &#32;
 +
* You can now specify any pet type ID.
 +
* You can now omit the argument to check for a pet of any type.
 
|-
 
|-
| <samp>HomeRegion</samp>
+
| <samp>NotDayOfWeek</samp> (<samp>d</samp>)
| ''(Optional)'' The region of the world in which the NPC lives (one of <samp>Desert</samp>, <samp>Town</samp>, or <samp>Other</samp>). For example, only <samp>Town</samp> NPCs are counted for the introductions [[Quests#List of Story Quests|quest]], can be selected as a secret santa for the [[Feast of the Winter Star]], or get a friendship boost from the [[Luau]]. Default <samp>Other</samp>.
+
| &#32;
 +
* You can now specify a full name like <samp>Monday</samp>.
 +
* The day of week is now case-insensitive.
 
|-
 
|-
| <samp>IsDarkSkinned</samp>
+
| <samp>NotSeason</samp> (<samp>z</samp>)
| ''(Optional)'' Whether the NPC has dark skin, which affects the chance of children with the player having dark skin too. Default false.
+
| &#32;
|}
+
* You can now list values (like <code>notSeason spring summer fall</code> instead of <code>notSeason fall/notSeason winter/notSeason fall</code>).
</dd>
  −
 
  −
<dt>Social features:</dt>
  −
<dd>
  −
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>ReachedMineBottom</samp> (<samp>b</samp>)
! effect
+
| &#32;
 +
* Argument is now optional (default 1).
 
|-
 
|-
| <samp>CanSocialize</samp>
+
| <samp>SendMail</samp> (<samp>x</samp>)
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether to enable social features (like birthdays, gift giving, [[friendship]], and an entry in the social tab). Default true.
+
| &#32;
 +
* Deprecated; see [[#Send-mail (x) precondition deprecated|''Send-mail (x) precondition deprecated'']] for more info.
 
|-
 
|-
| <samp>CanBeRomanced</samp>
+
| <samp>Tile</samp> (<samp>a</samp>)
| ''(Optional)'' Whether the NPC can be dated and romanced. This enables romance features for this NPC (like a 'single' label in the social menu, bouquet gifting, and marriage). Default false.
+
| &#32;
|-
+
* Now also works when the player isn't currently warping, in which case it checks their current tile instead of their warp arrival tile.
| <samp>CanReceiveGifts</samp>
+
|}</li>
| ''(Optional)'' Whether players can give gifts to this NPC. Default true.
+
</ul>
   −
The NPC must also be social per <samp>CanSocialize</samp> and have an entry in <samp>Data/NPCGiftTastes</samp> to be giftable, regardless of this value.
+
====Command changes====
 +
<ul>
 +
<li>Added validation for event commands. If a format or assumption is invalid, the game now logs a detailed error and (if applicable) skips the command, instead of crashing or silently ignoring it. This also means event arguments are stricter (e.g. you can no longer set a true/false field to an invalid value, inner quotes in quoted arguments now need to be escaped, etc).</li>
 +
<li>Event commands are now quote-aware, so you can escape spaces and slashes in arguments like <code>/speak "I'm running A/B tests"/</code>.</li>
 +
<li>Event commands now trim surrounding whitespace, so they can be multilined for readability. Line breaks must be before or after the <samp>/</samp> delimiter. For example:
 +
<syntaxhighlight lang="js">
 +
"SomeEventId/": "
 +
    none/
 +
    -1000 -1000/
 +
    farmer 5 7 0/
 +
    ...
 +
"
 +
</syntaxHighlight>
 +
This can be also combined with the [[Modding:Event data#Comments|comment syntax]] to add notes. For example:
 +
<syntaxhighlight lang="js">
 +
"SomeEventId/": "
 +
    none/            -- music/
 +
    -1000 -1000/    -- initial viewport position/
 +
    farmer 5 7 0/    -- actor positions/
 +
    ...
 +
"
 +
</syntaxHighlight>
 +
</li>
 +
<li>You can now mark NPCs optional in event commands by suffixing their name with <code>?</code>. For example, <code>jump Kent?</code> won't log an error if Kent is missing. When used in the initial event positions, the NPC is only added in they exist in <samp>Data/Characters</samp> and their <samp>UnlockConditions</samp> match.</li>
 +
<li>Added new event commands:
 +
{| class="wikitable"
 +
|-
 +
! command
 +
! description
 +
|-
 +
| <samp>action {{t|action}}</samp>
 +
| Run a [[Modding:Trigger actions|trigger action string]], like <samp>action AddMoney 500</samp> to add {{price|500}} to the current player.
 
|-
 
|-
| <samp>CanCommentOnPurchasedShopItems</samp>
+
| <samp>addItem {{t|item ID}} {{o|count}} {{o|quality}}</samp>
| ''(Optional)'' Whether this NPC can comment on items that a player sold to a shop which then resold it to them. If null (or omitted), this will default to true if their <samp>HomeRegion</samp> is set to <samp>Town</samp>.
+
| Add an item to the player inventory (or open a grab menu if their inventory is full). The {{t|item ID}} is the [[#Custom items|qualified or unqualified item ID]], and {{o|quality}} is a [[Modding:Items#Quality|numeric quality value]].
 
  −
The NPC must also be social per <samp>CanSocialize</samp> to allow it, regardless of this value.
   
|-
 
|-
| <samp>CanGreetNearbyCharacters</samp>
+
| <samp>addSpecialOrder {{t|order ID}}</samp><br /><samp>removeSpecialOrder {{t|order ID}}</samp>
| ''(Optional)'' Whether this NPC can show a speech bubble greeting nearby players or NPCs, and or be greeted by other NPCs. Default true.
+
| Add or remove a special order to the player team. This affects all players, since special orders are shared.
 
|-
 
|-
| <samp>CanVisitIsland</samp>
+
| <samp>eventSeen {{t|event ID}} {{o|seen}}</samp>
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether the NPC can visit the [[Ginger Island]] resort once it's unlocked. Default true.
+
| Add or remove an event ID from the player's list of seen events, based on {{o|seen}} (default <samp>true</samp> to add).
   −
The NPC must also be social per <samp>CanSocialize</samp> to visit the island, regardless of this value.
+
An event can mark ''itself'' unseen using <samp>eventSeen {{t|event ID}} false</samp>. This takes effect immediately (i.e. the event won't be added to the list when it completes), but the game will prevent the event from playing again until the player changes location to avoid event loops. The event will still replay when re-entering the location.
 
|-
 
|-
| <samp>LoveInterest</samp>
+
| <samp>mailToday {{t|mail key}}</samp>
| ''(Optional)'' Unused.
+
| Adds a letter to the mailbox immediately, given the {{t|mail key}} in <samp>Data/Mail</samp>.
 
|-
 
|-
| <samp>Calendar</samp>
+
| <samp>questionAnswered {{t|answer ID}} {{o|answered}}</samp>
| ''(Optional)'' Determines when the NPC's birthday is shown in the [[calendar]]. Possible values:
+
| Add or remove an answer ID from the player's list of chosen dialogue answers, based on {{o|answered}} (default <samp>true</samp> to add).
{| class="wikitable"
   
|-
 
|-
! value
+
| <samp>replaceWithClone {{t|NPC name}}</samp>
! effect
+
| Replace an NPC already in the event with a temporary copy. This allows changing the NPC for the event without affecting the real NPC.
 +
 
 +
For example, this event changes Marnie's name/portrait only within the event:
 +
<syntaxhighlight lang="js">
 +
"Some.ModId_ExampleEvent/": "continue/64 15/farmer 64 15 2 Marnie 64 17 0/replaceWithClone Marnie/changeName Marnie Pufferchick/changePortrait Marnie Pufferchick/[...]/end"
 +
</syntaxhighlight>
 
|-
 
|-
| <samp>HiddenAlways</samp>
+
| <samp>setSkipActions {{o|actions}}</samp>
| They never appear in the calendar.
+
| Set [[Modding:Trigger actions|trigger actions]] that should run if the player skips the event. You can list multiple actions delimited with <samp>#</samp>, or omit {{o|actions}} so no actions are run. When the player skips, the last <samp>setSkipActions</samp> before that point is applied.
 +
 
 +
For example, this adds the [[Garden Pot|garden pot]] recipe and item to the player if the event is skipped, but avoids adding the item if the event already did it:
 +
<pre>
 +
/setSkipActions AddCraftingRecipe Current "Garden Pot"#AddItem (BC)62
 +
/skippable
 +
/...
 +
/addItem (BC)62
 +
/setSkipActions AddCraftingRecipe Current "Garden Pot"
 +
</pre>
 +
 
 +
Skip actions aren't applied if the event completes normally without being skipped.
 
|-
 
|-
| <samp>HiddenUntilMet</samp>
+
| <samp>stopSound {{t|sound ID}} {{o|immediate}}</samp>
| Until the player meets them, they don't appear in the calendar.
+
| Stop a sound started with the <samp>startSound</samp> command. This has no effect if the sound has already stopped playing on its own (or hasn't been started). If you started multiple sounds with the same ID, this will stop all of them (e.g. <code>startSound fuse/startSound fuse/stopSound fuse</code>).
|-
  −
| <samp>AlwaysShown</samp>
  −
| They always appear in the calendar.
  −
|}
     −
Defaults to <samp>AlwaysShown</samp>.
+
By default the sound will stop immediately. For looping sounds, you can pass <samp>false</samp> to the {{o|immediate}} argument to stop the sound when it finishes playing the current iteration instead (e.g. <code>stopSound fuse false</code>).
 
|-
 
|-
| <samp>SocialTab</samp>
+
| <samp>temporaryAnimatedSprite ...</samp>
| ''(Optional)'' Determines how the NPC is shown on the [[friendship|social tab]] when unlocked. Possible values:
+
| Add a temporary animated sprite to the event, using these space-delimited fields:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! value
+
! index
 +
! field
 
! effect
 
! effect
 
|-
 
|-
| <samp>HiddenAlways</samp>
+
| 0
| They never appear in the social tab.
+
| <samp>texture</samp>
 +
| The asset name for texture to draw.
 
|-
 
|-
| <samp>HiddenUntilMet</samp>
+
| 1&ndash;4
| Until the player meets them, they don't appear on the social tab.
+
| <samp>rectangle</samp>
 +
| The pixel area within the <samp>texture</samp> to draw, in the form <samp>{{t|x}} {{t|y}} {{t|width}} {{t|height}}</samp>.
 
|-
 
|-
| <samp>UnknownUntilMet</samp>
+
| 5
| Until the player meets them, their name on the social tab is replaced with "???".
+
| <samp>interval</samp>
 +
| The millisecond duration for each frame in the animation.
 
|-
 
|-
| <samp>AlwaysShown</samp>
+
| 6
| They always appear in the social tab (including their name).
+
| <samp>frames</samp>
|}
+
| The number of frames in the animation.
 
  −
Defaults to <samp>UnknownUntilMet</samp>.
   
|-
 
|-
| <samp>SocialTabIconSourceRect</samp>
+
| 7
| ''(Optional)'' The pixel area in the character's sprite texture to show as their icon in the social menu. This should be approximately 24x24 pixels or smaller. Defaults to part of their first sprite.
+
| <samp>loops</samp>
 +
| The number of times to repeat the animation.
 
|-
 
|-
| <samp>SpouseAdopts</samp>
+
| 8&ndash;9
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether the player will need to adopt children with this spouse, instead of either the player or NPC giving birth. If null, defaults to true for same-gender and false for opposite-gender spouses.
+
| <samp>tile</samp>
 
+
| The tile position at which to draw the sprite, in the form <samp>{{t|x}} {{t|y}}</samp>.
The <samp>Target</samp> player is the one they're married to.
   
|-
 
|-
| <samp>SpouseWantsChildren</samp>
+
| 10
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether the spouse will ask to have children. Defaults to true.
+
| <samp>flicker</samp>
 
+
| Causes the sprite to flicker in and out of view repeatedly. (one of <samp>true</samp> or <samp>false</samp>).
The <samp>Target</samp> player is the one they're married to.
   
|-
 
|-
| <samp>SpouseGetsJealousOfGifts</samp>
+
| 11
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether the [[Marriage#Jealousy|spouse will get jealous of gifts to other NPCs]]. Defaults to true.
+
| <samp>flip</samp>
 
+
| Whether to flip the sprite horizontally when it's drawn (one of <samp>true</samp> or <samp>false</samp>).
The <samp>Target</samp> player is the one they're married to, and the <samp>Target</samp> item is the one that was gifted.
   
|-
 
|-
| <samp>SpouseRoom</samp>
+
| 12
| ''(Optional)'' The [[Marriage#Spouse Rooms|NPC's spouse room]] in the farmhouse when the player marries them, if applicable. If this is omitted for a marriageable NPC, they'll use Abigail's spouse room by default.
+
| <samp>sort tile Y</samp>
 
+
| The tile Y position to use in the layer depth calculation, which affects which sprite is drawn on top if two sprites overlap. The larger the number, the higher layer the sprite is on.
This consists of a model with these fields:
  −
{| class="wikitable"
   
|-
 
|-
! field
+
| 13
! effect
+
| <samp>alpha fade</samp>
 +
| Fades out the sprite based on alpha set. The larger the number, the faster the fade out. 1 is instant.
 
|-
 
|-
| <samp>MapAsset</samp>
+
| 14
| ''(Optional)'' The asset name for the spouse room map. The <samp>Map/</samp> prefix is added automatically and shouldn't be included. Defaults to <samp>spouseRooms</samp>.
+
| <samp>scale</samp>
 +
| A multiplier applied to the sprite size (in addition to the normal 4× pixel zoom).
 
|-
 
|-
| <samp>MapSourceRect</samp>
+
| 15
| ''(Optional)'' The tile area within the <samp>MapAsset</samp> containing the spouse's room. This should usually be a 6x9 tile area, though the game will try to adjust to a different size. Specified as a model with <samp>X</samp>, <samp>Y</samp>, <samp>Width</samp>, and <samp>Height</samp> fields. Defaults to <samp>(0, 0, 6, 9)</samp>.
+
| <samp>scale change</samp>
|}
+
| Changes the scale based on the multiplier applied on top of the normal zoom. Continues endlessly.
 
|-
 
|-
| <samp>SpousePatio</samp>
+
| 16
| ''(Optional)'' The [[Marriage#Spouse Outside Area|NPC's patio area]] on the farm when the player marries them, if any. Default none.
+
| <samp>rotation</samp>
 
+
| The rotation to apply to the sprite, measured in [[wikipedia:radians|radians]].
This consists of a model with these fields:
  −
{| class="wikitable"
   
|-
 
|-
! field
+
| 17
! effect
+
| <samp>rotation change</samp>
 +
| Continuously rotates the sprite, causing it to spin. The speed is determined by input value.
 
|-
 
|-
| <samp>MapAsset</samp>
+
| 18+
| ''(Optional)'' The asset name for the patio area. The <samp>Map/</samp> prefix is added automatically and shouldn't be included. Defaults to <samp>spousePatios</samp>.
+
| ''flags''
 +
| Any combination of these space-delimited flags:
 +
* <samp>color {{t|color}}</samp>: apply a [[#Color fields|standard color]] to the sprite.
 +
* <samp>hold_last_frame</samp>: after playing the animation once, freeze the last frame as long as the sprite is shown.
 +
* <samp>ping_pong</samp>: Causes the animation frames to play forwards and backwards alternatingly. Example: An animation with the frames 0, 1, 2 will play "0 1 2 0 1 2" without the ping_pong flag and play "0 1 2 1 0" with the ping_pong flag.
 +
* <samp>motion {{t|x}} {{t|y}}</samp>: Sprite moves based on the values set. Numbers can be decimals or negative.
 +
* <samp>acceleration {{t|x}} {{t|y}}</samp>: '''[TODO: document what this does]'''
 +
* <samp>acceleration_change {{t|x}} {{t|y}}</samp>: '''[TODO: document what this does]'''
 +
|}
 
|-
 
|-
| <samp>MapSourceRect</samp>
+
| <samp>translateName {{t|actor}} {{t|translation key}}</samp>
| ''(Optional)'' The tile area within the <samp>MapAsset</samp> containing the spouse's patio area. This must be a 4x4 tile area. Specified as a model with <samp>X</samp>, <samp>Y</samp>, <samp>Width</samp>, and <samp>Height</samp> fields. Defaults to <samp>(0, 0, 4, 4)</samp>.
+
| Set the display name for an NPC in the event to match the given translation key.
 
|-
 
|-
| <samp>SpriteAnimationFrames</samp>
+
| <samp>warpFarmers [{{t|x}} {{t|y}} {{t|direction}}]+ {{t|default offset}} {{t|default x}} {{t|default}} {{t|direction}}</samp>
| ''(Optional)'' The spouse's animation frames when they're in the patio. Each frame is an array containing [0] the sprite index in their spritesheet, and [1] the optional duration in milliseconds (default 100). If omitted or empty, the NPC won't be animated.
+
| Warps connected players to the given [[Modding:Modder Guide/Game Fundamentals#Tiles|tile coordinates]] and [[Modding:Event data#Directions|numeric directions]]. The {{t|x}} {{t|y}} {{t|direction}} triplet is repeated for each connected player (e.g. the first triplet is for the main player, second triplet is for the first farmhand, etc). The triplets are followed by an offset direction (one of <samp>up</samp>, <samp>down</samp>, <samp>left</samp>, or <samp>right</samp>), and a final triplet which defines the default values used by any other player.
 
  −
For example, here is Abigail playing the flute:
  −
<syntaxhighlight lang="js">
  −
"SpriteAnimationFrames": [
  −
    [16, 500], // show index 16 for 500ms
  −
    [17, 500],
  −
    [18, 500],
  −
    [19]      // if duration is omitted, defaults to 100ms
  −
]
  −
</syntaxhighlight>
  −
|-
  −
| <samp>SpriteAnimationPixelOffset</samp>
  −
| ''(Optional)'' The pixel offset to apply to the NPC's sprite when they're animated in the patio, specified as a model with <samp>X</samp> and <samp>Y</samp> fields. This is ignored if the NPC isn't animated via <samp>SpriteAnimationFrames</samp>. Default none.
   
|}
 
|}
 +
</li>
 +
<li>Fixed some commands assuming a boolean argument is true if present, regardless of its value. This affects the <samp>changeToTemporaryMap</samp>, <samp>emote</samp>, <samp>extendSourceRect</samp>, <samp>faceDirection</samp>, <samp>globalFade</samp>, <samp>globalFadeToClear</samp>, <samp>positionOffset</samp>, and <samp>warp</samp> commands.</li>
 +
<li>Fixed some commands assuming any value except the exact case-sensitive string <samp>true</samp> is false. This affects the <samp>animate</samp>, <samp>glow</samp>, <samp>hideShadow</samp>, <samp>ignoreMovementAnimation</samp>, <samp>temporaryAnimatedSprite</samp>, <samp>temporarySprite</samp>, and <samp>viewport</samp> commands.</li>
 +
<li>Fixed some commands silently ignoring values they can't parse as the expected type. This affects the <samp>addItem</samp>, <samp>makeInvisible</samp>, and <samp>removeItem</samp> commands.</li>
 +
<li>Fixed crash when some commands are passed <samp>farmer[number]</samp> for a player who's not available, or <samp>farmer[number]</samp> when they expect <samp>farmer</samp>.</li>
 +
<li>Fixed some commands not taking into account custom farmer actors when checking <samp>farmer*</samp> actor IDs.</li>
 +
<li>Fixed warp-out event commands able to use NPC-only or gendered warps. They now use a valid warp for the player if possible.</li>
 +
<li>Changed specific commands:
 +
{| class="wikitable"
 
|-
 
|-
| <samp>SpouseFloors</samp><br /><samp>SpouseWallpapers</samp>
+
! command
| ''(Optional)'' The floors and wallpapers which the NPC may randomly apply to the farmhouse when married to the player. If omitted or empty, the NPC will randomly choose a base floor (0–39) or wallpaper (0–111).
+
! changes
 
|-
 
|-
| <samp>IntroductionsQuest</samp>
+
| <samp>addCookingRecipe</samp>
| ''(Optional)'' Whether to include this NPC in [[Quests#List of Story Quests|the ''introductions'' quest]]. If <samp>null</samp> (or omitted), this will default to true if the <samp>HomeRegion</samp> field is set to <samp>Town</samp>.
+
| Fixed error if player already knows the recipe.
 
|-
 
|-
| <samp>ItemDeliveryQuests</samp>
+
| <samp>addMailReceived</samp>
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether this NPC can give item delivery quests. If <samp>null</samp> (or omitted), this will default to true if the <samp>HomeRegion</samp> field is set to <samp>Town</samp>.
+
| &#32;
 
+
* Renamed to <samp>mailReceived</samp>. (The old name is now an alias, so it'll still work.)
The NPC must also be social per <samp>CanSocialize</samp> to allow it, regardless of this value.
+
* You can now remove a mail received by setting the optional third argument to false, like <samp>mailReceived {{t|id}} false</samp>.
 
|-
 
|-
| <samp>PerfectionScore</samp>
+
| <samp>addTemporaryActor</samp>
| ''(Optional)'' Whether to include this NPC when checking whether the player has max friendships with every NPC for the perfection score. Default true.
+
| &#32;
 
+
* Underscores in the asset name are now only replaced with spaces if an exact match wasn't found. You should quote arguments containing spaces instead, like <code>addTemporaryActor "White Chicken" …</code>.
The NPC must also be social per <samp>CanSocialize</samp> to be counted, regardless of this value.
+
* Underscores in the display name are no longer replaced with spaces. You should quote arguments containing spaces instead.
 +
* Argument 9 ({{o|animal name}}) is now {{o|override name}}, and can be used to set the name for non-animals too.
 
|-
 
|-
| <samp>EndSlideShow</samp>
+
| <samp>animate</samp>
| ''(Optional)'' How the NPC appears in the end-game perfection slide show. Possible values:
+
| Underscores in the NPC name are now only replaced with spaces if an exact match wasn't found. You should quote arguments containing spaces instead, like <code>animate "Mr Qi" …</code>.
{| class="wikitable"
   
|-
 
|-
! value
+
| <samp>ambientLight</samp>
! effect
+
| Removed four-argument form (which was unused and had confusing behavior). The other versions of <samp>ambientLight</samp> still work like before.
 
|-
 
|-
| <samp>Hidden</samp>
+
| <samp>awardFestivalPrize</samp>
| The NPC doesn't appear in the slide show.
+
| Added support for arbitrary item IDs, like <code>awardFestivalPrize (O)128</code> for a pufferfish.
 
|-
 
|-
| <samp>MainGroup</samp>
+
| <samp>changeLocation</samp>
| The NPC is added to the main group of NPCs which walk across the screen.
+
| It now updates the event position offset if needed.
 
|-
 
|-
| <samp>TrailingGroup</samp>
+
| <samp>changeName</samp>
| The NPC is added to the trailing group of NPCs which follow the main group.
+
| Underscores in the NPC name are no longer replaced with spaces. You should quote arguments containing spaces instead, like <code>changeName Leo "Neo Leo"</code>.
|}
  −
 
  −
Defaults to <samp>MainGroup</samp>.
   
|-
 
|-
| <samp>FriendsAndFamily</samp>
+
| <samp>changePortrait</samp><br /><samp>changeSprite</samp>
| ''(Optional)'' The NPC's closest friends and family, as a dictionary where the key is the other NPC's internal name and the value is an optional tokenizable string for the name to use in dialogue text (like 'mom'). Default none.
+
| You can now omit the suffix argument to reset the NPC back to their normal portrait/sprite.
 
  −
This affects generic dialogue for revealing likes and dislikes to family members, and may affect <samp>inlaw_&lt;NPC&gt;</samp> dialogues. This isn't necessarily comprehensive.
  −
|}
  −
</dd>
  −
 
  −
<dt>Dumpster diving:</dt>
  −
<dd>
  −
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>faceDirection</samp>
! effect
+
| You can now specify the direction in words, like <samp>faceDirection up</samp>
 
|-
 
|-
| <samp>DumpsterDiveEmote</samp>
+
| <samp>ignoreMovementAnimation</samp>
| ''(Optional)'' The emote ID to show above the NPC's head when they see a player rummaging through trash. See [[Modding:event data#Emotes|emote IDs]]. If omitted or <samp>null</samp>, the default depends on the NPC's age: a child will show sad (28), a teen will show a question mark (8), and an adult will show angry (12).
+
| &#32;
 +
* Fixed its ''ignore'' argument being ignored.
 +
* Underscores in the NPC name are now only replaced with spaces if an exact match wasn't found. You should quote arguments containing spaces instead, like <code>ignoreMovementAnimation "Mr Qi" …</code>.
 
|-
 
|-
| <samp>DumpsterDiveFriendshipEffect</samp>
+
| <samp>itemAboveHead</samp>
| ''(Optional)'' The friendship point change if this NPC sees a player rummaging through trash. Default -25.
+
| Added support for arbitrary item IDs, like <code>itemAboveHead (O)128</code> for a pufferfish.
|}</dd>
  −
 
  −
<dt>Festivals:</dt>
  −
<dd>
  −
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>makeInvisible</samp>
! effect
+
| Fixed terrain features not hidden when using the default area size.
 
|-
 
|-
| <samp>FlowerDanceCanDance</samp>
+
| <samp>playSound</samp>
| ''(Optional)'' Whether players can ask the NPC to dance at the Flower Dance festival. The possible values are <samp>true</samp> (can always ask), <samp>false</samp> (can never ask), or <samp>null</samp> (can ask if they're romanceable). Default <samp>null</samp>.
+
| Sounds started via <samp>playSound</samp> now stop automatically when the event ends.
 
  −
If the NPC can dance, you should also add the [[Modding:NPC data#Overworld_sprites|dance sprite frames]] and <samp>FlowerDance_Decline</samp> [[Modding:Dialogue|dialogue text]]. You can optionally set the <samp>FlowerDance_Accept</samp> dialogue too (though NPCs have a default accept dialogue if not).
   
|-
 
|-
| <samp>WinterStarParticipant</samp>
+
| <samp>removeItem</samp>
| ''(Optional)''  A [[Modding:Game state queries|game state query]] which indicates whether this NPC can give and receive gifts at the [[Feast of the Winter Star]]. If <samp>null</samp> (or omitted), this will default to true if the <samp>HomeRegion</samp> field is set to <samp>Town</samp>.
+
| Added argument for an optional count, like <code>removeItem (O)128 10</code> to remove 10 pufferfish.
 
|-
 
|-
| <samp>WinterStarGifts</samp>
+
| <samp>speak</samp>
| At the [[Feast of the Winter Star]], the possible gifts this NPC can give to players. A matching entry is selected at random.
+
| Fixed friendship & socialize quest not updated when calling it with a translation key.
 
+
|}</li>
This consists of a list of models with these fields:
+
<li>Removed some commands:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! field
+
! command
! effect
+
! changes
 
|-
 
|-
| ''common fields''
+
| <samp>addToTable</samp>
| See [[Modding:Item queries#Item spawn fields|item spawn fields]] for the generic item fields.
+
| Removed (it was unused and worked in counterintuitive ways).
 
  −
If set to an [[Modding:Item queries|item query]] which returns multiple items, one of them will be selected at random.
  −
|}
  −
|}
  −
 
  −
<dt>Spawn rules:</dt>
  −
<dd>
  −
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>addTool</samp>
! effect
+
| Removed (it was unused and only supported the [[Return Scepter|return scepter]]). Use <samp>addItem</samp> instead, which supports adding tools.
 
|-
 
|-
| <samp>UnlockConditions</samp>
+
| <samp>grabObject</samp>
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether the NPC should be added to the world, checked when loading a save and when ending each day. This only affects whether the NPC is added when missing; returning false won't remove an NPC that's already been added. Defaults to true.
+
| Removed (it was unused and broken).
 
|-
 
|-
| <samp>SpawnIfMissing</samp>
+
| <samp>showRivalFrame</samp><br /><samp>taxVote</samp>
| ''(Optional)'' Whether to add this NPC to the world if they're missing (if the <samp>UnlockConditions</samp> match and <samp>HomeLocation</samp> is valid). Default true.
+
| Removed (they were part of unimplemented features).
 
|-
 
|-
| <samp>Home</samp>
+
| <samp>weddingSprite</samp>
| ''(Optional)'' The default place where this NPC spawns and returns each day. If there are multiple entries, the first matching one is used.
+
| Removed (it was broken and unused).
 +
|}
 +
</ul>
   −
This consists of a list of models with these fields:  
+
====Festival changes====
 +
* Festivals can now have a custom festival-started notification message by setting the <samp>startedMessage</samp> field in <samp>Data/Festivals/*</samp> to a [[Modding:Tokenizable strings|tokenizable string]].
 +
* Festivals now set the event ID to a value like <samp>festival_fall16</samp>, instead of <samp>-1</samp>.
 +
* All in-festival data fields now support [[Modding:Festival data#Year variants|year variants]].
 +
* Fixed NPCs getting duplicated in festivals if they're added to the <samp>set-up</samp> fields multiple times. Subsequent entries now move them instead.
 +
* Fixed [[Modding:Festival data#Year variants|year variants]] for festival <samp>set-up</samp> field being appended to the main script instead of replacing it.
 +
 
 +
====Send-mail (<samp>x</samp>) precondition deprecated====
 +
Using the <samp>x</samp> event precondition as a way to send mail is now deprecated (but still works). You should use [[#Trigger actions|trigger actions]] instead to perform actions like that.
 +
 
 +
All vanilla events which used it have been replaced by equivalent trigger actions. This event IDs below no longer exist; if you check them (e.g. via <samp>HasSeenEvent</samp>), you'll need to check the new action or the mail flag they set instead.
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! field
+
! old event ID
! effect
+
! new action ID
 +
! mail flag
 
|-
 
|-
| <samp>ID</samp>
+
| <samp>68</samp>
| The [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for this entry within the current list.
+
| <samp>Mail_Mom_5K</samp>
 +
| <samp>mom1</samp>
 
|-
 
|-
| <samp>Location</samp>
+
| <samp>69</samp>
| ''(Optional)'' The internal name for the home location where this NPC spawns and returns each day. Default none.
+
| <samp>Mail_Mom_15K</samp>
 +
| <samp>mom2</samp>
 
|-
 
|-
| <samp>Tile</samp>
+
| <samp>70</samp>
| ''(Optional)'' The tile position within the home location where this NPC spawns and returns each day. Specified as a model with <samp>X</samp> and <samp>Y</samp> fields. Defaults to <samp>(0, 0)</samp>.
+
| <samp>Mail_Mom_32K</samp>
 +
| <samp>mom3</samp>
 
|-
 
|-
| <samp>Direction</samp>
+
| <samp>71</samp>
| ''(Optional)'' The default direction the NPC faces when they start each day. The possible values are <samp>down</samp>, <samp>left</samp>, <samp>right</samp>, and <samp>up</samp>. Defaults to <samp>up</samp>.
+
| <samp>Mail_Mom_120K</samp>
 +
| <samp>mom4</samp>
 
|-
 
|-
| <samp>Condition</samp>
+
| <samp>72</samp>
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether this entry can be selected. Default true.
+
| <samp>Mail_Dad_5K</samp>
|}
+
| <samp>dad1</samp>
|}
  −
</dd>
  −
 
  −
<dt>Appearance & sprite:</dt>
  −
<dd>
  −
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>73</samp>
! effect
+
| <samp>Mail_Dad_15K</samp>
 +
| <samp>dad2</samp>
 
|-
 
|-
| <samp>TextureName</samp>
+
| <samp>74</samp>
| ''(Optional)'' The '''last segment''' of the NPC's portrait and sprite asset names. For example, set to <samp>Abigail</samp> to use <samp>Portraits/Abigail</samp> and <samp>Characters/Abigail</samp> respectively. Defaults to the internal NPC name.
+
| <samp>Mail_Dad_32K</samp>
 +
| <samp>dad3</samp>
 
|-
 
|-
| <samp>Appearance</samp>
+
| <samp>75</samp>
| ''(Optional)'' The portrait/sprite textures to use.
+
| <samp>Mail_Dad_120K</samp>
 
+
| <samp>dad4</samp>
This can list any number of appearance options. They'll be sorted by <samp>Precedence</samp> value (with lower values taking priority), then filtered to those whose fields match. If multiple matching appearances have precedence, one entry is randomly chosen based on their relative weight. This randomization is stable per day, so the NPC always makes the same choice until the next day. If a portrait/sprite can't be loaded (or no appearances match), the NPC will use the default asset based on <samp>TextureName</samp>.
+
|-
 
+
| <samp>76</samp>
The NPC rechecks this field each time they change location.
+
| <samp>Mail_Tribune_UpAndComing</samp>
 
+
| <samp>newsstory</samp>
This consists of a list of models with these fields:
  −
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>706</samp>
! effect
+
| <samp>Mail_Pierre_Fertilizers</samp>
 +
| <samp>fertilizers</samp>
 
|-
 
|-
| <samp>Id</samp>
+
| <samp>707</samp>
| The [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for this entry within the current list.
+
| <samp>Mail_Pierre_FertilizersHighQuality</samp>
 +
| <samp>fertilizers2</samp>
 
|-
 
|-
| <samp>Season</samp>
+
| <samp>909</samp>
| ''(Optional)'' The season in which this appearance should be used (one of <samp>spring</samp>, <samp>summer</samp>, <samp>fall</samp>, or <samp>winter</samp>), or omit for any season. Defaults to any season.
+
| <samp>Mail_Robin_Woodchipper</samp>
 +
| <samp>WoodChipper</samp>
 
|-
 
|-
| <samp>Indoors</samp><br /><samp>Outdoors</samp>
+
| <samp>2111194</samp>
| ''(Optional)'' Whether this appearance should be used when indoors and/or outdoors. Both default to true.
+
| <samp>Mail_Emily_8heart</samp>
 +
| <samp>EmilyClothingTherapy</samp>
 
|-
 
|-
| <samp>Condition</samp>
+
| <samp>2111294</samp>
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether this entry can be selected. Default true.
+
| <samp>Mail_Emily_10heart</samp>
 +
| <samp>EmilyCamping</samp>
 
|-
 
|-
| <samp>Portrait</samp><br /><samp>Sprite</samp>
+
| <samp>2346091</samp>
| ''(Optional)'' The asset name for the portraits and/or sprites texture to load. If omitted or it can't be loaded, it will default to the default asset per the <samp>Texture</samp> field.
+
| <samp>Mail_Alex_10heart</samp>
 +
| <samp>joshMessage</samp>
 
|-
 
|-
| <samp>IsIslandAttire</samp>
+
| <samp>2346092</samp>
| ''(Optional)'' Whether this is island beach attire worn at the resort. Default false.
+
| <samp>Mail_Sam_10heart</samp>
 
+
| <samp>samMessage</samp>
This is mutually exclusive: NPCs will never wear it in other contexts if it's true, and will never wear it as island attire if it's false.
   
|-
 
|-
| <samp>Precedence</samp>
+
| <samp>2346093</samp>
| ''(Optional)'' The order in which this entry should be checked, where lower values are checked first. This can be a negative value. Default 0.
+
| <samp>Mail_Harvey_10heart</samp>
 +
| <samp>harveyBalloon</samp>
 
|-
 
|-
| <samp>Weight</samp>
+
| <samp>2346094</samp>
| ''(Optional)'' If multiple entries with the same <samp>Precedence</samp> match, the relative weight to use when randomly choosing one. Default 1.
+
| <samp>Mail_Elliott_10heart</samp>
 
+
| <samp>elliottBoat</samp>
For example, let's say two appearance entries match: one has a weight of 2, and the other has a weight of 1. Their probability of being chosen is 2/3 and 1/3 respectively.
  −
|}
  −
 
  −
'''Note:''' the default textures based on <samp>TextureName</samp> must still exist, even if you use this field to override them.
   
|-
 
|-
| <samp>Size</samp>
+
| <samp>2346095</samp>
| ''(Optional)'' The pixel size of the individual sprites in their overworld sprite spritesheet. Specified as a model with <samp>X</samp> and <samp>Y</samp> fields. Defaults to <samp>(16, 32)</samp>.
+
| <samp>Mail_Elliott_8heart</samp>
 
+
| <samp>elliottReading</samp>
'''Note:''' sizes bigger than 16×32 will cause issues like broken spawning, pathfinding, misalignment in the [[perfection]] end-game slide show, etc.
   
|-
 
|-
| <samp>Breather</samp>
+
| <samp>2346096</samp>
| ''(Optional)'' Whether the chest on the NPC's overworld sprite puffs in and out as they breathe. Default true</samp>.
+
| <samp>Mail_Penny_10heart</samp>
 +
| <samp>pennySpa</samp>
 
|-
 
|-
| <samp>ShakePortraits</samp>
+
| <samp>2346097</samp>
| ''(Optional)'' The portrait indexes which should shake when displayed. Default none.
+
| <samp>Mail_Abigail_8heart</samp>
 +
| <samp>abbySpiritBoard</samp>
 
|-
 
|-
| <samp>KissSpriteIndex</samp>
+
| <samp>3333094</samp>
| ''(Optional)'' If the NPC can be married, the sprite index within their <samp>Texture</samp> to use when kissing a player. Default 28.
+
| <samp>Mail_Pierre_ExtendedHours</samp>
 +
| <samp>pierreHours</samp>
 
|-
 
|-
| <samp>KissSpriteFacingDirection</samp>
+
| <samp>3872126</samp>
| ''(Optional)'' Whether the character is facing right (true) or left (false) in their <samp>KissSpriteIndex</samp>. The sprite will be flipped as needed to face the player. Default true.
+
| <samp>Mail_Willy_BackRoomUnlocked</samp>
 +
| <samp>willyBackRoomInvitation</samp>
 
|}
 
|}
</dd>
     −
<dt>[[Secrets#Gift Log|Hidden gift log emote]]:</dt>
+
===[[Modding:Mail data|Mail]] changes===
<dd>
+
{{/doc status|[[Modding:Mail data]]|done=false}}
 +
 
 +
<ul>
 +
<li>Mail can now have multiple items attached (using multiple <samp>%item</samp> commands). When the player grabs the top item, the next one will appear in the slot to grab next.</li>
 +
<li>Added mail commands:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! field
+
! command
 
! effect
 
! effect
 
|-
 
|-
| <samp>HiddenProfileEmoteSound</samp>
+
| <samp>%action {{t|action}}%%</samp>
| ''(Optional)'' For the [[Secrets#Gift Log|hidden gift log emote]], the [[#Custom audio|cue ID]] for the sound played when clicking the sprite. Defaults to <samp>drumkit6</samp>.
+
| Run a [[Modding:Trigger actions|trigger action string]], like <samp>%action AddMoney 500%%</samp> to add {{price|500}} to the current player.
 +
|}</li>
 +
<li>Improved mail commands:
 +
{| class="wikitable"
 
|-
 
|-
| <samp>HiddenProfileEmoteDuration</samp>
+
! command
| ''(Optional)'' For the [[Secrets#Gift Log|hidden gift log emote]], how long the animation plays measured in milliseconds. Defaults to 4000 (4 seconds).
+
! changes
 
|-
 
|-
| <samp>HiddenProfileEmoteStartFrame</samp>
+
| <samp>%item</samp>
| ''(Optional)'' For the [[Secrets#Gift Log|hidden gift log emote]], the index within the NPC's overworld sprite spritesheet at which the animation starts. If omitted for a vanilla NPC, the game plays a default animation specific to that NPC; if omitted for a custom NPC, the game just shows them walking while facing down.
+
| &#32;
|-
+
* Added <samp>%item id {{t|item id}} {{o|count}}</samp> form which accepts a [[#Custom items|qualified or unqualified item ID]]. If multiple items are listed (''e.g.,'' <samp>%item id (BC)12 3 (O)34 5 %%</samp>) one set will be picked randomly. This deprecates the <samp>bigobject</samp>, <samp>furniture</samp>, <samp>object</samp>, and <samp>tools</samp> options.
| <samp>HiddenProfileEmoteFrameCount</samp>
+
* Added <samp>%item specialOrder {{t|order id}} {{o|immediately}}</samp> form to attach a special order to the letter.
| ''(Optional)'' For the [[Secrets#Gift Log|hidden gift log emote]], the number of frames in the animation. The first frame corresponds to <samp>HiddenProfileEmoteStartFrame</samp>, and each subsequent frame will use the next sprite in the spritesheet. Default 1.
+
* Added optional {{t|key}} argument to <samp>%item cookingRecipe {{t|key}}</samp>, to learn a specific [[Modding:Recipe data|cooking recipe]]. The previous <samp>%item cookingRecipe</samp> form (without a key) works the same way as before.
 +
* The type argument is now case-insensitive.
 +
* Fixed <samp>%item craftingRecipe</samp> not supporting recipe IDs containing underscores. It now checks for an exact match first, then tries replacing underscores with spaces like before, then logs a warning if neither was found instead of adding an invalid recipe.
 +
|}</li>
 +
<li>All wallet items are now tracked via mail flags. That adds these mail flags: <samp>HasClubCard</samp>, <samp>HasDarkTalisman</samp>, <samp>HasDwarvishTranslationGuide</samp>, <samp>HasMagicInk</samp>, <samp>HasMagnifyingGlass</samp>, <samp>HasRustyKey</samp>, <samp>HasSkullKey</samp>, <samp>HasSpecialCharm</samp>, <samp>HasTownKey</samp>, and <samp>HasUnlockedSkullDoor</samp>.</li>
 +
<li>Fixed letter viewer error when opening an invalid letter.</li>
 +
</ul>
   −
This has no effect if <samp>HiddenProfileEmoteStartFrame</samp> isn't set.
+
===Stat changes for C# mods===
|-
+
The tracked stats API (e.g. <code>Game1.stats</code> and <code>Game1.player.stats</code>) has been overhauled.
| <samp>HiddenProfileEmoteFrameDuration</samp>
  −
| ''(Optional)'' For the [[Secrets#Gift Log|hidden gift log emote]], how long each animation frame is shown on-screen before switching to the next one, measured in milliseconds. Default 200.
     −
This has no effect if <samp>HiddenProfileEmoteStartFrame</samp> isn't set.
+
In particular, all stats are now in the underlying stat dictionary. If you use a stat field directly (like <code>stats.dirtHoed</code>), you'll need to use the property (like <code>stats.DirtHoed</code>) or method (like <code>stats.Get(StatsKey.DirtHoed)</code>). This lets the game or mods access all stats in a standard way without reflection. 1.6 also adds <samp>StatsKey</samp> constants for all stats tracked by the game.
|}
  −
</dd>
     −
<dt>Advanced:</dt>
+
The <samp>stats</samp> API has also been redesigned:
<dd>
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! field
+
! member
! effect
+
! comments
 
|-
 
|-
| <samp>CustomFields</samp>
+
| <samp>Values</samp>
| The [[#Custom data fields|custom fields]] for this entry.
+
| The numeric metrics tracked by the game. This replaces <samp>stats_dictionary</samp>.
 
|-
 
|-
| <samp>FormerCharacterNames</samp>
+
| <samp>Get(key)</samp>
| ''(Optional)'' The former NPC names which may appear in save data. If matched, the game will rename the NPC and update related data (e.g. friendship).
+
| Get the value of a tracked stat. This replaces <samp>getStat</samp>.
   −
A former name is only applied if:
+
For example:
# it doesn't match a current ID in <samp>Data/Characters</samp>;
+
<syntaxhighlight lang="c#">
# the save has an NPC with the former name;
+
uint daysPlayed = Game1.stats.Get(StatKeys.DaysPlayed);
# the save doesn't already have an NPC with the new name.
+
</syntaxhighlight>
 +
|-
 +
| <samp>Set(key, value)</samp>
 +
| Set the new value of a tracked stat. This method is new.
    
For example:
 
For example:
<syntaxhighlight lang="js">
+
<syntaxhighlight lang="c#">
"FormerCharacterNames": [ "SomeOldName" ]
+
Game1.stats.Set(StatKeys.ChildrenTurnedToDoves, 5);
 
</syntaxhighlight>
 
</syntaxhighlight>
  −
Former names can have any format, but they must be '''globally''' unique. They can't match the ID or <samp>FormerCharacterNames</samp> of any other NPC in <samp>Data/Characters</samp> (whether vanilla or custom).
   
|-
 
|-
| <samp>FestivalVanillaActorIndex</samp>
+
| <samp>Increment(key)</samp><br /><samp>Increment(key, amount)</samp>
| ''(Optional, Specialized)'' The NPC's index in the <samp>Maps/characterSheet</samp> tilesheet, if applicable. This is used for placing vanilla NPCs in festivals from the map; custom NPCs should use the <samp>&lt;layer&gt;_additionalCharacters</samp> field in the festival data instead.
+
| Add the given amount to the stat (default 1), and return the new stat value. This improves on the original <samp>incrementStat</samp>.
|}
+
 
</dd>
+
For example:
</dl>
+
<syntaxhighlight lang="c#">
 +
uint stepsTaken = Game1.stats.Increment(StatKeys.StepsTaken);
 +
</syntaxhighlight>
 +
|}
   −
====Examples====
+
This can also be used to track custom mod stats, they doesn't need to be stats normally tracked by the game. Custom stats should be prefixed with your mod's unique ID to avoid conflicts:
For example, this content pack adds a new ''Amabel'' NPC with full social features:
+
<syntaxhighlight lang="c#">
 +
Game1.stats.Set("Your.ModId_CustomStat", 5);
 +
</syntaxhighlight>
   −
{{#tag:syntaxhighlight|<nowiki>
+
And finally, setting a stat to 0 now removes it from the stats dictionary (since that's the default for missing stats).
{
  −
    "Format": "</nowiki>{{Content Patcher version}}<nowiki>",
  −
    "Changes": [
  −
        {
  −
            "Action": "EditData",
  −
            "Target": "Data/Characters",
  −
            "Entries": {
  −
                "Example.ModId_Amabel": {
  −
                    "DisplayName": "Amabel", // this would normally use {{i18n:}} to support translations
  −
                    "BirthSeason": "Fall",
  −
                    "BirthDay": 14,
  −
                    "HomeRegion": "Town",
  −
                    "Gender": "Female",
  −
                    "Age": "Teen",
  −
                    "Manner": "Rude",
  −
                    "SocialAnxiety": "Outgoing",
  −
                    "Optimism": "Neutral",
     −
                    "CanBeRomanced": true,
+
===New C# utility methods===
                    "LoveInterest": "Abigail",
+
Stardew Valley 1.6 adds several new methods to simplify common logic.
   −
                    "Home": [
+
====Argument handling====
                        {
+
The new <samp>ArgUtility</samp> class handles splitting, reading, and validating <samp>string[]</samp> argument lists. The main methods are:
                            "Id": "Default",
  −
                            "Location": "SeedShop",
  −
                            "Tile": { "X": 1, "Y": 9 },
  −
                            "Direction": "Left"
  −
                        }
  −
                    ]
  −
                }
  −
            }
  −
        }
  −
    ]
  −
}</nowiki>|lang=javascript}}
     −
You can also add non-social NPCs which don't have birthdays or friendship points, accept gifts, give quests, etc:
+
; Splitting arrays&#58;
{{#tag:syntaxhighlight|<nowiki>
+
: {| class="wikitable"
{
+
|-
    "Format": "</nowiki>{{Content Patcher version}}<nowiki>",
+
! <samp>ArgUtility</samp> method
    "Changes": [
+
! effect
        {
+
|-
            "Action": "EditData",
+
| <samp>SplitBySpace</samp>
            "Target": "Data/Characters",
+
| Split space-separated arguments in a string. This automatically ignores extra spaces, so <samp>" x &nbsp;y "</samp> and <samp>"x y"</samp> are equivalent. For example:
            "Entries": {
+
<syntaxhighlight lang="c#">
                "Example.ModId_Belwick": {
+
string[] fields = ArgUtility.SplitBySpace("a b c");
                    "DisplayName": "Belwick", // this would normally use {{i18n:}} to support translations
+
string secondField = fields[1]; // "b"
 +
</syntaxhighlight>
 +
|-
 +
| <samp>SplitBySpaceAndGet</samp>
 +
| Get the value at an index in a space-delimited string (if found), else return the default value. For example:
 +
 
 +
<syntaxhighlight lang="c#">
 +
string thirdField = ArgUtility.SplitBySpaceAndGet("a b c", 2); // "c"
 +
string invalidFieldA = ArgUtility.SplitBySpaceAndGet("a b c", 5); // null
 +
string invalidFieldB = ArgUtility.SplitBySpaceAndGet("a b c", 5, defaultValue: "boop"); // "boop"
 +
</syntaxhighlight>
   −
                    "SocialTab": "HiddenAlways",
+
This is more efficient than <samp>SplitBySpace</samp> when you only need a single value, but it's slower if you need multiple values.
                    "CanSocialize": "FALSE",
+
|-
                    "IntroductionsQuest": false,
+
| <samp>SplitBySpaceQuoteAware</samp>
                    "PerfectionScore": false,
+
| Split space-separated arguments in a string, with support for using quotes to protect spaces within an argument. See <samp>SplitQuoteAware</samp> below for info on quote handling.
                    "EndSlideShow": true
  −
                }
  −
            }
  −
        }
  −
    ]
  −
}</nowiki>|lang=javascript}}
     −
===Custom NPC appearance===
+
For example:
Each NPC can now have any number of custom portraits/sprites in <samp>Data/Characters</samp> with arbitrary conditions. This lets mods add features like indoor/outdoor outfits without the performance impact of reloading textures. If multiple outfits apply, the game will choose between them with a day-stable randomization.
+
<syntaxhighlight lang="c#">
 +
string buildingName = ArgUtility.SplitBySpaceQuoteAware("BUILDINGS_CONSTRUCTED Here \"Junimo Hut\"")[1]; // Junimo Hut
 +
</syntaxhighlight>
 +
|-
 +
| <samp>SplitQuoteAware</samp>
 +
| Split delimited arguments in a string, with support for using quotes to protect delimiters within an argument.
   −
For example, you can load indoor/outdoor outfits for a custom NPC to swap between automatically:
+
A quote in the text causes any delimiter to be ignored until the next quote, unless it's escaped like <code>\"</code>. Unescaped quotes are removed from the string. (Remember that backslashes need to be escaped in C# or JSON strings, like <code>"\\"</code> for a single backslash.)
<syntaxhighlight lang="js">
  −
// add base indoor/outdoor sprites
  −
{
  −
    "Action": "Load",
  −
    "Target": "Characters/Johnny_Indoor, Characters/Johnny_Outdoor, Portraits/Johnny_Indoor, Portraits/Johnny_Outdoor",
  −
    "FromFile": "assets/{{Target}}.png"
  −
},
     −
// apply any overlays needed
+
For example:
{
+
<syntaxhighlight lang="c#">
    "Action": "EditImage",
+
ArgUtility.SplitQuoteAware("A,B,C", ',');        // [ "A", "B", "C" ]
    "Target": "Characters/Johnny_Indoor, Portraits/Johnny_Indoor",
+
ArgUtility.SplitQuoteAware("A,\"B,C\",D", ','); // [ "A", "B,C", "D" ]
    "FromFile": "assets/overlays/{{Target}}_married.png",
+
ArgUtility.SplitQuoteAware("A,\\\"B,C", ',');    // [ "A", "\"B", "C" ]
    "When": {
+
</syntaxhighlight>
        "Spouse": "Johnny"
+
 
    }
+
You can also set the optional arguments for more advanced cases. For example, [[Modding:Game state queries|game state queries]] use this to split twice:
},
+
<syntaxhighlight lang="c#">
 +
string gameStateQuery = "BUILDINGS_CONSTRUCTED Here \"Junimo Hut\", SEASON Spring";
   −
// add NPC
+
string[] queries = ArgUtility.SplitQuoteAware(gameStateQuery, ',', StringSplitOptions.RemoveEmptyEntries, keepQuotesAndEscapes: true); // [ "BUILDINGS_CONSTRUCTED Here \"Junimo Hut\"", "SEASON Spring" ]
{
+
string buildingName = ArgUtility.SplitBySpaceQuoteAware(queries[0]); // Junimo Hut
    "Action": "EditData",
  −
    "Target": "Data/Characters",
  −
    "Entries": {
  −
        "SomeMod.Id_Johnny": {
  −
            ...,
  −
            "Appearance": [
  −
                {
  −
                    "Id": "Outdoors",
  −
                    "Indoors": false,
  −
                    "Portrait": "Portraits/Johnny_Outdoor",
  −
                    "Sprite": "Characters/Johnny_Outdoor"
  −
                },
  −
                {
  −
                    "Id": "Default",
  −
                    "Portrait": "Portraits/Johnny_Indoor",
  −
                    "Sprite": "Characters/Johnny_Indoor"
  −
                }
  −
            ]
  −
        }
  −
    }
  −
}
   
</syntaxhighlight>
 
</syntaxhighlight>
 +
|-
 +
| <samp>EscapeQuotes</samp>
 +
| Escape quotes in a string so they're ignored by methods like <samp>SplitQuoteAware</samp>.
   −
See the <samp>Appearance</samp> field in [[#Custom NPCs|custom NPC data]] for more info.
+
This isn't idempotent (e.g. calling it twice will result in double-escaped quotes).
 +
|-
 +
| <samp>UnsplitQuoteAware</samp>
 +
| Combine an array of arguments into a single string with a custom delimiter, using quotes where needed to escape delimiters within an argument. Calling <samp>SplitQuoteAware</samp> on the resulting string with the same delimiter will produce the original values.
   −
===Custom farm animals===
+
For example:
You can now create and customize [[Animals|farm animals]] by editing the revamped <samp>Data/FarmAnimals</samp> asset.
+
<syntaxhighlight lang="c#">
 +
string args = ArgUtility.UnsplitQuoteAware(new[] { "A", "B C", "D" }, ' '); // A "B C" D
 +
</syntaxhighlight>
   −
This consists of a string → model lookup, where...
+
This isn't idempotent (e.g. calling it twice will result in double-escaped quotes).
* The key is a [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for the farm animal type.
+
|}
* The value is a model with the fields listed below.
     −
====Main info====
+
; Reading arrays&#58;
{| class="wikitable"
+
: {| class="wikitable"
 
|-
 
|-
! field
+
! <samp>ArgUtility</samp> method
 
! effect
 
! effect
 
|-
 
|-
| <samp>DisplayName</samp>
+
| <samp>HasIndex</samp>
| A [[Modding:Tokenizable strings|tokenizable string]] for the animal type's display name.
+
| Get whether an index is within the bounds of the array. For example:
 +
<syntaxhighlight lang="c#">
 +
string[] fields = ArgUtility.SplitByString("10 5");
 +
bool inRange = ArgUtility.HasIndex(fields, 1); // true (index 1 has the value '5')
 +
</syntaxhighlight>
 
|-
 
|-
| <samp>House</samp>
+
| <samp>Get</samp><br /><samp>GetBool</samp><br /><samp>GetDirection</samp><br /><samp>GetEnum</samp><br /><samp>GetFloat</samp><br /><samp>GetInt</samp>
| The [[#Custom buildings|building ID]] for the main building type that houses this animal. The animal will also be placeable in buildings whose <samp>ValidOccupantTypes</samp> field contains this value.
+
| Get the value at a position in an array, parsed as the relevant type (e.g. a string, boolean, [[Modding:Event data#Directions|direction]], enum, etc). If the index isn't in the array or the value can't be parsed as the expected type, returns a default value.
|-
+
 
| <samp>Gender</samp>
+
For example, code like this:
| ''(Optional)'' The possible genders for the animal type. Currently this only affects the text shown after purchasing the animal, like "''Great! I'll send little &lt;name&gt; to [his/her] new home right away''". Default <samp>Female</samp>.
+
<syntaxhighlight lang="c#">
 +
int value = fields.Length > 4 && int.TryParse(fields[4], out int parsed)
 +
    ? parsed
 +
    : -1;
 +
</syntaxhighlight>
   −
The possible values are:
+
Can now be rewritten like this:
{| class="wikitable"
+
<syntaxhighlight lang="c#">
 +
int value = ArgUtility.GetInt(fields, 4, -1);
 +
</syntaxhighlight>
 
|-
 
|-
! value
+
| <samp>TryGet</samp><br /><samp>TryGetBool</samp><br /><samp>TryGetDirection</samp><br /><samp>TryGetEnum</samp><br /><samp>TryGetFloat</samp><br /><samp>TryGetInt</samp><br /><samp>TryGetPoint</samp><br /><samp>TryGetRectangle</samp><br /><samp>TryGetVector2</samp>
! effect
+
| Try to get a parsed value from an array by its index. If it's not found or can't be converted to the expected value, it sets the <samp>out string error</samp> argument so you can log an error if needed.
|-
  −
| <samp>Male</samp><br /><samp>Female</samp>
  −
| Farm animals of this type are always male or always female.
  −
|-
  −
| <samp>MaleOrFemale</samp>
  −
| The gender of each animal is randomized based on its internal unique ID.
  −
|}
  −
|}
     −
====Animal shop====
+
For example, this parses a numeric value from a space-delimited string:
These fields affect how this farm animal type is shown in [[Marnie's Ranch|Marnie's animal shop]]. Animals are automatically listed if they have a valid <samp>PurchasePrice</samp> value.
+
<syntaxhighlight lang="c#">
 
+
string[] fields = ArgUtility.SplitByString("10 35");
{| class="wikitable"
+
if (ArgUtility.TryGetInt(fields, 1, out int value, out string error))
 +
    this.Helper.Monitor.Log($"Parsed value: {value}"); // "Parsed value: 35"
 +
else
 +
    this.Helper.Monitor.Log($"Failed parsing value: {error}", LogLevel.Warn);
 +
</syntaxhighlight>
 
|-
 
|-
! field
+
| <samp>TryGetOptional</samp><br /><samp>TryGetOptionalBool</samp><br /><samp>TryGetOptionalDirection</samp><br /><samp>TryGetOptionalEnum</samp><br /><samp>TryGetOptionalFloat</samp><br /><samp>TryGetOptionalInt</samp><br /><samp>TryGetOptionalRemainder</samp>
! effect
+
| Equivalent to <samp>TryGet*</samp>, except that it'll return a default value if the argument is missing. For example:
 +
<syntaxhighlight lang="c#">
 +
string[] fields = ArgUtility.SplitByString("10");
 +
if (ArgUtility.TryGetOptionalInt(fields, 1, out int value, out error, defaultValue: 99))
 +
    this.Helper.Monitor.Log($"Parsed value: {value}"); // "Parsed value: 99"
 +
else
 +
    this.Helper.Monitor.Log($"Failed parsing value: {error}", LogLevel.Warn);
 +
</syntaxhighlight>
 
|-
 
|-
| <samp>PurchasePrice</samp>
+
| <samp>GetRemainder</samp><br /><samp>TryGetRemainder</samp><br /><samp>TryGetOptionalRemainder</samp>
| ''(Optional if not purchaseable)'' Half the cost to purchase the animal (the actual price is double this value), or a negative value to disable purchasing this animal type. Default -1.
+
| Similar to the previous methods, but gets arguments starting from an index as a concatenated string. For example:
 +
<syntaxhighlight lang="c#">
 +
string[] fields = ArgUtility.SplitByString("A B C D E F");
 +
if (ArgUtility.TryGetRemainder(fields, 2, out string remainder, out string error))
 +
    this.Helper.Monitor.Log($"Remainder: {remainder}"); // "Remainder: C D E F"
 +
else
 +
    this.Helper.Monitor.Log($"Failed getting remainder: {error}", LogLevel.Warn);
 +
</syntaxhighlight>
 
|-
 
|-
| <samp>ShopTexture</samp>
+
| <samp>GetSubsetOf</samp>
| ''(Optional if not purchaseable)'' The asset name for the icon texture to show in shops. Defaults to <samp>LooseSprites/Cursors</samp> or <samp>LooseSprites/Cursors2</samp> based on the animal's position within the loaded data (but using the default isn't recommended if it's purchaseable).
+
| Get a slice of the input array. For example:
|-
+
<syntaxhighlight lang="c#">
| <samp>ShopSourceRect</samp>
+
string[] subset1 = ArgUtility.GetSubsetOf(new[] { "A", "B", "C", "D" }, startAt: 1); // B, C, D
| ''(Optional if not purchaseable)'' The pixel area within the <samp>ShopTexture</samp> to draw, specified as an object with <samp>X</samp>, <samp>Y</samp>, <samp>Width</samp>, and <samp>Height</samp> fields. This should be 32 pixels wide and 16 high. Ignored if <samp>ShopTexture</samp> isn't set.
+
string[] subset2 = ArgUtility.GetSubsetOf(new[] { "A", "B", "C", "D" }, startAt: 1, length: 2); // B, C
|-
+
</syntaxhighlight>
| <samp>RequiredBuilding</samp>
+
 
| ''(Optional)'' The building that needs to be built on the farm for this animal to be available to purchase. Buildings that are upgraded from this building are valid too. Default none.
+
This is fault-tolerant as long as <samp>startAt</samp> isn't negative. For example:
|-
+
<syntaxhighlight lang="c#">
| <samp>UnlockCondition</samp>
+
string[] subset2 = ArgUtility.GetSubsetOf(new[] { "A", "B", "C", "D" }, startAt: 100); // <empty array>
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether the farm animal is available in the shop menu. Default always unlocked.
+
string[] subset1 = ArgUtility.GetSubsetOf(new[] { "A", "B", "C", "D" }, startAt: 1, length: 100); // B, C, D
|-
+
</syntaxhighlight>
| <samp>ShopDisplayName</samp>
+
|}
| ''(Optional)'' A [[Modding:Tokenizable strings|tokenizable string]] for the display name shown in the shop menu. Defaults to the <samp>DisplayName</samp> field.
+
 
|-
+
====Content assets====
| <samp>ShopDescription</samp>
  −
| ''(Optional)'' A [[Modding:Tokenizable strings|tokenizable string]] for the tooltip description shown in the shop menu. Defaults to none.
  −
|-
  −
| <samp>ShopMissingBuildingDescription</samp>
  −
| ''(Optional)'' A [[Modding:Tokenizable strings|tokenizable string]] which overrides <samp>ShopDescription</samp> if the <samp>RequiredBuilding</samp> isn't built. Defaults to none.
  −
|-
  −
| <samp>AlternatePurchaseTypes</samp>
  −
| ''(Optional)'' The possible variants for this farm animal (e.g. chickens can be Brown Chicken, Blue Chicken, or White Chicken). This consists of a list of models with these fields:
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! field
+
! method
 
! effect
 
! effect
 
|-
 
|-
| <samp>AnimalIDs</samp>
+
| <samp>LocalizedContentManager.DoesAssetExist</samp>
| A list of animal IDs to spawn instead of the main <samp>ID</samp> field. If multiple are listed, one is chosen at random on purchase.
+
| Get whether an asset exists in the game's <samp>Content</samp> folder or is provided through [[Modding:Modder Guide/APIs/Content|SMAPI's content API]]. For example:
 +
<syntaxhighlight lang="c#">
 +
bool exists = Game1.content.DoesAssetExist<Map>("Maps/Town");
 +
</syntaxhighlight>
 
|-
 
|-
| <samp>Condition</samp>
+
| <samp>LocalizedContentManager.IsValidTranslationKey</samp>
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether this variant entry is available. Default always enabled.
+
| Get whether a string is a translation key in the form <samp>{{t|asset name}}:{{t|key}}</samp>, and the asset and key both exist. For example:
 +
<syntaxhighlight lang="c#">
 +
bool exists = Game1.content.IsValidTranslationKey("Strings\\NPCNames:Abigail");
 +
</syntaxhighlight>
 
|}
 
|}
   −
If multiple are listed, the first available variant is returned. Default none.
+
====Filtering====
|}
+
The game now has an optimized <samp>RemoveWhere</samp> method for O(n) filtering on <samp>NetCollection</samp>, <samp>NetDictionary</samp>, <samp>NetList</samp>, and (via extension) <samp>IDictionary</samp>. This also deprecates <samp>Filter</samp> methods where they existed.
 +
 
 +
For example:
 +
<syntaxhighlight lang="c#">
 +
int dirtTilesRemoved = Game1.currentLocation.terrainFeatures.RemoveWhere(pair => pair.Value is HoeDirt);
 +
</syntaxhighlight>
 +
 
 +
====Game paths====
 +
The game folder paths were previously hardcoded throughout the code. These are now centralized with a few methods:
   −
====Hatching====
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! field
+
! method
 
! effect
 
! effect
 
|-
 
|-
| <samp>EggItemIds</samp>
+
| <samp>Program.GetLocalAppDataFolder</samp><br /><samp>Program.GetAppDataFolder</samp>
| ''(Optional)'' A list of the [[#Custom items|object IDs]] that can be placed in the [[incubator]] or [[Ostrich Incubator|ostrich incubator]] to hatch this animal. If the animal's <samp>House</samp> field doesn't match the current building, the entry will be ignored. Default none.
+
| Get the absolute path to the game's app data folder (which contains the [[saves|<Samp>Saves</samp> folder]]) or local app data folder (which contains <samp>ErrorLogs</samp> and <samp>Screenshots</samp>). These methods are equivalent on Windows, but different on Linux/macOS.
 
|-
 
|-
| <samp>IncubationTime</samp>
+
| <samp>Program.GetSavesFolder</samp>
| ''(Optional)'' How long eggs incubate before they hatch. Default 9000 minutes.
+
| Get the absolute path to the game's [[saves|<samp>Saves</samp> folder]].
 
|-
 
|-
| <samp>IncubatorParentSheetOffset</samp>
+
| <samp>Game1.GetScreenshotFolder</samp>
| ''(Optional)'' An offset applied to the incubator's sprite index when it's holding an egg. Default 1.
+
| Get the absolute path to the game's <samp>Screenshots</samp> folder.
 
  −
The vanilla values are:
  −
{| class="wikitable"
   
|-
 
|-
! offset
+
| <samp>options.GetFilePathForDefaultOptions</samp>
! [[incubator]]
+
| Get the absolute path to the game's <samp>default_options</samp> file.
! [[Ostrich Incubator|ostrich incubator]]
  −
|-
  −
| 0
  −
| empty incubator
  −
| empty incubator
  −
|-
  −
| 1
  −
| small white egg
  −
| large brown egg
  −
|-
  −
| 2
  −
| small brown egg
  −
| ''invalid'' (will show [[Junimo Chest|Junimo chest]] sprite)
  −
|}
  −
|-
  −
| <samp>BirthText</samp>
  −
| ''(Optional)'' A [[Modding:Tokenizable strings|tokenizable string]] for the message shown when entering the building after the egg hatched. Defaults to the text "<samp>???</samp>".
   
|}
 
|}
   −
====Growth====
+
====Hash sets====
 +
Since the [[#Hash set fields|game now uses hash sets]], it has a few extensions for working with them:
 +
 
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! field
+
! method
 
! effect
 
! effect
 
|-
 
|-
| <samp>DaysToMature</samp>
+
| <samp>AddRange</samp>
| ''(Optional)'' The number of days until a freshly purchased/born animal becomes an adult and begins producing items. Default 1.
+
| Add all the values from a list or enumerable to the set.
 
|-
 
|-
| <samp>CanGetPregnant</samp>
+
| <samp>RemoveWhere</samp>
| ''(Optional)'' Whether an animal can [[Animals#Animal Births|produce a child]] (regardless of gender). Default false.
+
| Remove all values matching a condition.
 +
|-
 +
| <samp>Toggle</samp>
 +
| Add or remove a value in the set based on a boolean. For example:
 +
<syntaxhighlight lang="c#">
 +
public bool hasClubCard
 +
{
 +
    get { return mailReceived.Contains("HasClubCard"); }
 +
    set { mailReceived.Toggle("HasClubCard", value); }
 +
}
 +
</syntaxhighlight>
 
|}
 
|}
   −
====Produce====
+
====Iteration====
{| class="wikitable"
+
The new <samp>Utility.ForEach*</samp> methods let you check every thing of a type in the game world quickly and efficiently (with minimal allocations, boxing, etc). These are significantly faster than equivalent code using LINQ or <samp>yield</samp> methods.
|-
  −
! field
  −
! effect
  −
|-
  −
| <samp>ProduceItemIds</samp><br /><samp>DeluxeProduceItemIds</samp>
  −
| ''(Optional)'' The items produced by the animal when it's an adult. The <samp>DeluxeProduceItemIds</samp> field only applies if the <samp>Deluxe*</samp> fields match. Both default to none.
     −
This consists of a list of models with these fields:
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! field
+
! method
 
! effect
 
! effect
 
|-
 
|-
| <samp>ItemId</samp>
+
| <samp>Utility.ForEachBuilding</samp>
| The [[#Custom items|''unqualified'' object ID]] of the item to produce.
+
| Perform an action for each building in the game world.
 
|-
 
|-
| <samp>Condition</samp>
+
| <samp>Utility.ForEachCharacter</samp><br /><samp>Utility.ForEachVillager</samp>
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether this item can be produced now. Defaults to always true.
+
| Perform an action for each NPC in the game world. <samp>ForEachCharacter</samp> matches all NPC types (villagers, horses, pets, monsters, player children, etc), while <samp>ForEachVillager</samp> only matches villager NPCs like [[Abigail]].
 
|-
 
|-
| <samp>MinimumFriendship</samp>
+
| <samp>Utility.ForEachCrop</samp>
| ''(Optional)'' The minimum friendship points with the animal needed to produce this item. Default 0.
+
| Perform an action for each crop in the game world planted in the ground or in a [[Garden Pot|garden pot]].
|}
  −
 
  −
If multiple items can be produced, one is chosen at random (with deluxe items taking priority if applicable).
   
|-
 
|-
| <samp>DaysToProduce</samp>
+
| <samp>Utility.ForEachItem</samp>
| ''(Optional)'' The number of days between item productions. For example, setting <samp>1</samp> will produce an item every other day. Default 1.
+
| Perform an action for each item in the game world, including items within items (e.g. in a chest or on a table), hats placed on children, items in player inventories, etc.
 
|-
 
|-
| <samp>ProduceOnMature</samp>
+
| <samp>Utility.ForEachItemIn</samp>
| ''(Optional)'' Whether an item is produced on the day the animal becomes an adult. Default false.
+
| Perform an action for each item within a given location, including items within items (e.g. in a chest or on a table).
 
|-
 
|-
| <samp>FriendshipForFasterProduce</samp>
+
| <samp>Utility.ForEachLocation</samp>
| ''(Optional)'' The minimum friendship points needed to reduce the <samp>DaysToProduce</samp> by one. Defaults to no reduction based on friendship.
+
| Perform an action for each location in the game world, optionally including building interiors and generated [[The Mines|mine]] or [[Volcano Dungeon|volcano]] levels.
|-
+
|}
| <samp>DeluxeProduceMinimumFriendship</samp>
  −
| ''(Optional)'' The minimum friendship points needed to produce the <samp>DeluxeProduceItemId</samp>. Default 200.
  −
|-
  −
| <samp>DeluxeProduceCareDivisor</samp><br /><samp>DeluxeProduceLuckMultiplier</samp>
  −
| ''(Optional)'' [[#Quantity modifiers|Quantity modifiers]] which change the probability of producing the <samp>DeluxeProduceItemId</samp>, based on this formula:
  −
<pre>
  −
if happiness > 200:
  −
  happiness_modifier = happiness * 1.5
  −
else if happiness > 100:
  −
  happiness_modifier = 0
  −
else
  −
  happiness_modifier = happiness - 100
     −
((friendship + happiness_modifier) / DeluxeProduceCareDivisor) + (daily_luck * DeluxeProduceLuckMultiplier)
+
For example, this code counts how many parsnips are planted everywhere in the world:
</pre>
+
<syntaxhighlight lang="c#">
 +
int parsnips = 0;
 +
Utility.ForEachCrop(crop =>
 +
{
 +
    if (crop.IndexOfHarvest == "24")
 +
        parsnips++;
 +
    return true; // whether to keep iterating after this crop
 +
});
 +
</syntaxhighlight>
   −
Specifically:
+
Or you could replace all instances of an obsolete item with a new one:
* <samp>DeluxeProduceCareDivisor</samp> reduces the bonus from friendship and happiness, so a lower value ''increases'' the probability of producing the deluxe item. Default 1200.
+
<syntaxhighlight lang="c#">
* <samp>DeluxeProduceLuckMultiplier</samp> increases the effect of [[Luck|daily luck]]. Default 0.
+
Utility.ForEachItem((item, remove, replaceWith) =>
 +
{
 +
    if (item.QualifiedItemId == "(O)OldId")
 +
    {
 +
        Item newItem = ItemRegistry.Create("(O)NewId", item.Stack, item.Quality);
 +
        replaceWith(newItem);
 +
    }
   −
For example, given a friendship of 102 and happiness of 150, the probability with the default field values will be <code>((102 + 0) / 1200) + (daily_luck * 0) = (102 / 1200) = 0.085</code> or 8.5%.
+
    return true;
 +
});
 +
</syntaxhighlight>
 +
C# mods which add custom item types can override <samp>Item.ForEachItem</samp> to add support for nested items.
   −
See [[Animals#Produce]] for more info on the calculation.
+
====Randomization====
|-
  −
| <samp>HarvestType</samp>
  −
| ''(Optional)'' How produced items are collected from the animal. The valid values are:
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! value
+
! method
 
! effect
 
! effect
 
|-
 
|-
| <samp>DropOvernight</samp>
+
| <samp>Utility.CreateDaySaveRandom</samp>
| The item is placed on the ground in the animal's home building overnight.
+
| Creates a <samp>Random</samp> instance using the most common seed (based on the save ID and total days played).
 
|-
 
|-
| <samp>HarvestWithTool</samp>
+
| <samp>Utility.CreateRandom</samp><br /><samp>Utility.CreateRandomSeed</samp>
| The item is collected from the animal directly based on the <samp>HarvestTool</samp> field.
+
| Creates a <samp>Random</samp> (or seed for a <samp>Random</samp>) by combining the given seed values, which can be any numeric type.
|}
  −
 
  −
Default <samp>DropOvernight</samp>.
   
|-
 
|-
| <samp>HarvestTool</samp>
+
| <samp>Utility.TryCreateIntervalRandom</samp>
| ''(Optional)'' The [[#Custom items|tool ID]] with which produced items can be collected from the animal, if the <samp>HarvestType</samp> is set to <samp>HarvestWithTool</samp>. The values recognized by the vanilla tools are <samp>MilkPail</samp> and <samp>Shears</samp>. Default none.
+
| Get an RNG which produces identical results for all RNGs created with the same sync key during the given interval (one of <samp>tick</samp>, <samp>day</samp>, <samp>season</samp>, or <samp>year</samp>), including between players in multiplayer mode.
   −
|}
+
For example, this will return the same number each time it's called until the in-game day changes:
 
+
<syntaxhighlight lang="c#">
====Audio & sprite====
+
public int GetDailyRandomNumber()
{| class="wikitable"
+
{
 +
    Utility.TryCreateIntervalRandom("day", "example sync key", out Random random, out _);
 +
    return random.Next();
 +
}
 +
</syntaxhighlight>
 
|-
 
|-
! field
+
| <samp>Utility.TryGetRandom</samp>
! effect
+
| Get a random entry from a dictionary.
 
|-
 
|-
| <samp>Sound</samp>
+
| <samp>random.Choose</samp>
| ''(Optional)'' The [[#Custom audio|audio cue ID]] for the sound produced by the animal (e.g. when pet). Default none.
+
| Choose a random option from the values provided:
 +
<syntaxhighlight lang="c#">
 +
string npcName = Game1.random.Choose("Abigail", "Penny", "Sam");
 +
</syntaxhighlight>
 
|-
 
|-
| <samp>BabySound</samp>
+
| <samp>random.ChooseFrom</samp>
| ''(Optional)'' Overrides <samp>Sound</samp> field when the animal is a baby. Has no effect if <samp>Sound</samp> isn't specified. Default none.
+
| Choose a random option from a list or array:
|-
+
<syntaxhighlight lang="c#">
| <samp>Texture</samp>
+
string[] names = new[] { "Abigail", "Penny", "Sam" };
| ''(Optional)'' The asset name for the animal's spritesheet. Defaults to <samp>Animals/{{t|ID}}</samp> (like <samp>Animals/Goat</samp> for a [[goat]]).
+
string npcName = Game1.random.ChooseFrom(names);
 +
</syntaxhighlight>
 
|-
 
|-
| <samp>HarvestedTexture</samp>
+
| <samp>random.NextBool</samp>
| ''(Optional)'' Overrides <samp>Texture</samp> if the animal doesn't currently have an item ready to collect (like the [[sheep]]'s sheared sprite). Default none.
+
| Randomly choose <samp>true</samp> or <samp>false</samp>. For example:
|-
+
<syntaxhighlight lang="c#">
| <samp>BabyTexture</samp>
+
bool flipSprite = Game1.random.NextBool();
| ''(Optional)'' Overrides <samp>Texture</samp> and <samp>HarvestedTexture</samp> when the animal is a baby. Default none.
+
</syntaxhighlight>
|-
+
 
| <samp>UseFlippedRightForLeft</samp>
+
You can optionally set the probability of <samp>true</samp>:
| ''(Optional)'' When the animal is facing left, whether to use a flipped version of their right-facing sprite. Default false.
+
<syntaxhighlight lang="c#">
|-
+
bool flipSprite = Game1.random.NextBool(0.8);
| <samp>SpriteWidth</samp><br /><samp>SpriteHeight</samp>
+
</syntaxhighlight>
| ''(Optional)'' The pixel height & width of the animal's sprite (before the in-game pixel zoom). Both default to 16.
  −
|-
  −
| <samp>EmoteOffset</samp>
  −
| ''(Optional)'' A pixel offset to apply to emotes from the farm animal, specified as an object with <samp>X</samp> and <samp>Y</samp>. Default zero.
  −
|-
  −
| <samp>Skins</samp>
  −
| ''(Optional)'' A list of alternate appearances. If specified, a skin is chosen at random when the animal is purchased or hatched. This consists of a list of models with these fields:
  −
{| class="wikitable"
  −
|-
  −
! field
  −
! effect
  −
|-
  −
| <samp>ID</samp>
  −
| The [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for the skin within the current list.
  −
|-
  −
| <samp>Weight</samp>
  −
| ''(Optional)'' A multiplier for the probability to choose this skin when an animal is purchased. For example, <samp>2.0</samp> will double the chance this skin is selected relative to the other skins. Default <samp>1.0</samp>.
  −
|-
  −
| <samp>Texture</samp><br /><samp>HarvestedTexture</samp><br /><samp>BabyTexture</samp>
  −
| ''(Optional)'' Overrides the equivalent main field when this skin is selected. Defaults to the main field's value.
   
|}
 
|}
|-
  −
| <samp>ShadowWhenBaby</samp><br /><samp>ShadowWhenBabySwims</samp><br /><samp>ShadowWhenAdult</samp><br /><samp>ShadowWhenAdultSwims</samp>
  −
| ''(Optional)'' The shadow to draw under the farm animal. The <samp>Baby</samp> fields only apply when the farm animal is a baby, and <samp>Adult</samp> fields only applies when it's an adult (e.g. a baby animal won't default to the adult fields). When the farm animal swims, it'll use the <samp>Swims</samp> variant if it's set, else default to the non-swim variant.
     −
These consist of a model with these fields:
+
====Other====
 +
Here are some of the other new methods:
    
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! field
+
! method
 
! effect
 
! effect
 
|-
 
|-
| <samp>Visible</samp>
+
| <samp>Game1.getOfflineFarmhands()</samp>
| ''(Optional)'' Whether the shadow should be drawn. Default true.
+
| Get all farmhands who aren't connected to the game.
 
|-
 
|-
| <samp>Offset</samp>
+
| <samp>Game1.PerformActionWhenPlayerFree</samp>
| ''(Optional)'' A pixel offset applied to the shadow position, specified as an object with <samp>X</samp> and <samp>Y</samp> fields. Default zero.
+
| Calls the provided callback next time the player is free (e.g. no menu or event is up, not using a tool, etc). If the player is already free, it's run immediately.
|-
  −
| <samp>Scale</samp>
  −
| ''(Optional)'' The scale at which to draw the shadow. Default 2.5 (swimming baby), 3 (baby), 3.5 (swimming adult), or 4 (adult).
  −
|}
  −
|}
     −
====Player profession effects====
+
For example, if you receive your first geode from a fishing chest, this is used to show the geode-received animation & animation when it closes.
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>Game1.createRadialDebris_MoreNatural</samp>
! effect
+
| Scatter item debris around a position with a more randomized distribution than <samp>createRadialDebris</samp>.
 
|-
 
|-
| <samp>ProfessionForFasterProduce</samp>
+
| <samp>Object.GetCategoryColor</samp><br /><samp>Object.GetCategoryDisplayName</samp>
| ''(Optional)'' The internal ID of a [[Skills|profession]] which reduces the <samp>DaysToProduce</samp> by one. Default none.
+
| Get the color and display name for the given category number when it's shown in a tooltip.
 
|-
 
|-
| <samp>ProfessionForHappinessBoost</samp>
+
| <samp>Utility.distanceFromScreen</samp>
| ''(Optional)'' The internal ID of a [[Skills|profession]] which makes it easier to befriend this animal. Default none.
+
| Get the pixel distance between a position in the world and the player's screen viewport, where 0 is within the viewport.
 
|-
 
|-
| <samp>ProfessionForQualityBoost</samp>
+
| <samp>Utility.DrawErrorTexture</samp>
| ''(Optional)'' The internal ID of a [[Skills|profession]] which increases the chance of higher-quality produce. Default none.
+
| Draw the game's missing-texture image (🚫) to the screen, stretched to fit a given pixel area.
|}
  −
 
  −
====Behavior====
  −
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>Utility.DrawSquare</samp>
! effect
+
| Draw a square to the screen with a background color and/or borders.
 
|-
 
|-
| <samp>CanSwim</samp>
+
| <samp>Utility.GetEnumOrDefault</samp>
| ''(Optional)'' Whether animals on the farm can swim in water once they've been pet. Default false.
+
| Get an enum value if it's valid, else get a default value. This is mainly used to validate input from data files.
 +
 
 +
For example:
 +
<syntaxhighlight lang="c#">
 +
NpcGender gender = (NPCGender)999999;
 +
gender = Utility.GetEnumOrDefault(gender, Gender.Male); // returns Gender.Male since there's no enum constant with value 999999
 +
</syntaxhighlight>
 
|-
 
|-
| <samp>BabiesFollowAdults</samp>
+
| <samp>Utility.getRandomNpcFromHomeRegion</samp>
| ''(Optional)'' Whether baby animals can follow nearby adults. Default false.
+
| Get a random social NPC based on their <samp>HomeRegion</samp> value in [[#Custom NPCs|<samp>Data/Characters</samp>]]. For example, this gets a random NPC for the <samp>Town</samp> home region:
 +
<syntaxhighlight lang="c#">
 +
NPC npc = Utility.getRandomNpcFromHomeRegion(NPC.region_town);
 +
</syntaxhighlight>
 
|-
 
|-
| <samp>GrassEatAmount</samp>
+
| <samp>Utility.isFestivalDay</samp>
| ''(Optional)'' The amount of grass eaten by this animal each day. Setting it to <samp>0</samp> will disable the farm animal's hunger. Default 2.
+
| This method existed before 1.6, but you can now omit arguments to check today instead of a specific date:
|-
+
<syntaxhighlight lang="c#">
| <samp>HappinessDrain</samp>
+
bool festivalToday = Utility.isFestivalToday();
| ''(Optional)'' An amount which affects the daily reduction in happiness if the animal wasn't pet, or didn't have a heater in winter. Default none.
+
</syntaxhighlight>
|-
  −
| <samp>SellPrice</samp>
  −
| ''(Optional)'' The price when [[Animals#Selling Animals|the player sells the animal]], before it's adjusted for the animal's friendship towards the player. Default 0.
     −
The actual sell price will be this value multiplied by a number between 0.3 (zero friendship) and 1.3 (max friendship).
+
Or check for a festival in specific location context:
 +
<syntaxhighlight lang="c#">
 +
bool desertFestivalToday = Utility.isFestivalToday(LocationContexts.DesertId);
 +
</syntaxhighlight>
 
|-
 
|-
| <samp>CustomFields</samp>
+
| <samp>Utility.IsPassiveFestivalDay</samp>
| The [[#Custom data fields|custom fields]] for this entry.
+
| This method existed before 1.6, but now can now omit arguments to check today instead of a specific date:
|}
+
<syntaxhighlight lang="c#">
 +
bool passiveFestivalToday = Utility.IsPassiveFestivalDay();
 +
</syntaxhighlight>
   −
====Other====
+
Or check for a specific passive festival:
{| class="wikitable"
+
<syntaxhighlight lang="c#">
 +
bool nightMarketToday = Utility.IsPassiveFestivalDay("NightMarket");
 +
</syntaxhighlight>
 
|-
 
|-
! field
+
| <samp>Utility.TryGetPassiveFestivalData</samp><br /><samp>Utility.TryGetPassiveFestivalDataForDay</samp>
! effect
+
| Get the [[#Custom passive festivals|passive festival data]] for the given ID or date.
 
|-
 
|-
| <samp>ShowInSummitCredits</samp>
+
| <samp>Utility.TryParseDirection</samp>
| ''(Optional)'' Whether to show the farm animal in the credit scene on [[The Summit|the summit]] after the player achieves [[perfection]]. Default false.
+
| Parse a string into a direction value (like <samp>Game1.down</samp>), if it's valid. This supports case-insensitive direction names (one of <samp>down</samp>, <samp>left</samp>, <samp>right</samp>, or <samp>up</samp>) or [[Modding:Event data#Directions|numeric values]].
 
|-
 
|-
| <samp>StatToIncrementOnProduce</samp>
+
| <samp>Utility.TryParseEnum</samp>
| ''(Optional)'' The game stat counters to increment when the animal produces an item. Default none. This consists of a list of models with these fields:
+
| Parse a string into an enum value if possible, case-insensitively. Unlike [https://learn.microsoft.com/en-us/dotnet/api/system.enum.tryparse <samp>Enum.TryParse</samp>], an invalid numeric value won't be cast:
{| class="wikitable"
+
<syntaxhighlight lang="c#">
 +
Enum.TryParse("999999", out DayOfWeek day);        // true, even though there's no matching DayOfWeek value
 +
Utility.TryParseEnum("999999", out DayOfWeek day); // false
 +
</syntaxhighlight>
 
|-
 
|-
! field
+
| <samp>Utility.fuzzyCompare</samp>
! effect
+
| Get whether a term is a fuzzy match for a search query. Returns the numeric match priority (where lower values are a better match), or null if the term doesn't match the query.
 
|-
 
|-
| <samp>StatName</samp>
+
| <samp>rectangle.GetPoints</samp><br /><samp>rectangle.GetVectors</samp>
| The name of the stat counter field on <samp>Game1.stats</samp>.
+
| Get all the integer coordinates within a given <samp>Rectangle</samp>. For example:
 +
<syntaxhighlight lang="c#">
 +
var tileArea = new Rectangle(0, 0, 2, 2);
 +
Point[] tiles = tileArea.GetPoints(); // (0, 0), (1, 0), (0, 1), (1, 1)
 +
</syntaxhighlight>
 
|-
 
|-
| <samp>RequiredTags</samp>
+
| <samp>Utility.GetDeterministicHashCode</samp>
| ''(Optional)'' A comma-delimited list of [[Modding:Items#Context tags|context tags]] required on the main input item. The stat is only incremented if the item has ''all'' of these. You can negate a tag with <samp>!</samp> (like <code>bone_item,!fossil_item</code> for bone items that aren't fossils). Defaults to always enabled.
+
| ''(Specialized)'' Get a [https://en.wikipedia.org/wiki/Hash_function hash code] for a string key or numeric values. Unlike [https://learn.microsoft.com/en-us/dotnet/api/system.object.gethashcode <samp>string.GetHashCode</samp>] or [https://learn.microsoft.com/en-us/dotnet/api/system.hashcode.combine <samp>HashCode.Combine</samp>], this produces a consistent hash for the same inputs between sessions and connected players.
|}
   
|-
 
|-
| <samp>UpDownPetHitboxTileSize</samp><br /><samp>LeftRightPetHitboxTileSize</samp>
+
| <samp>Utility.WrapIndex</samp>
| ''(Optional)'' The animal sprite's [[Modding:Modder Guide/Game Fundamentals#Tiles|tile]] size in the world when the player is clicking to pet them, specified in the form <samp>{{t|width}}, {{t|height}}</samp>. The <samp>UpDownPetHitboxTileSize</samp> applies when the animal is facing up or down, and <samp>LeftRightPetHitboxTileSize</samp> applies when facing left or right. The values can be fractional (''e.g.'' cows have a width of 1.75). Both default to a 1×1 tile.
+
| Constrain an index to a range by wrapping out-of-bounds values to the other side (e.g. last index + 1 is the first index, and first index - 1 is the last one).
|-
+
 
| <samp>BabyUpDownPetHitboxTileSize</samp><br /><samp>BabyLeftRightPetHitboxTileSize</samp>
+
For example:
| ''(Optional)'' Overrides <samp>UpDownPetHitboxTileSize</samp> and <samp>LeftRightPetHitboxTileSize</samp> respectively before the animal is an adult. Both default to 1×1 tile.
+
<syntaxhighlight lang="c#">
 +
string[] values = new[] { "0", "1", "2" };
 +
int index = Utility.WrapIndex(-1, values.Length); // 2
 +
</syntaxhighlight>
 
|}
 
|}
   −
===Custom pets===
+
===Static delegate builder===
====Format====
+
For C# mods, <samp>StaticDelegateBuilder</samp> is a specialized class which converts a method name into an optimized delegate which can be called by code. This is used by vanilla code to optimize methods referenced in assets like [[#Custom machines|<samp>Data/Machines</samp>]].
You can now create and customize [[Animals#Cat or Dog|pet]]s & pet breeds by editing the new <samp>Data/Pets</samp> asset.
     −
This consists of a string → model lookup, where...
+
For example, given a static method like this:
* The key is a [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for the pet (not the pet breed). The vanilla IDs are <samp>Cat</samp> and <samp>Dog</samp>.
+
<syntaxhighlight lang="c#">
* The value is a model with the fields listed below.
+
public static bool OutputDeconstructor(Object machine, Item inputItem, bool probe, MachineItemOutput outputData, out int? overrideMinutesUntilReady) { ... }
 +
</syntaxhighlight>
   −
=====Basic info=====
+
And a delegate which matches it:
{| class="wikitable"
+
<syntaxhighlight lang="c#">
|-
+
public delegate bool MachineOutputDelegate(Object machine, Item inputItem, bool probe, MachineItemOutput outputData, out int? overrideMinutesUntilReady);
! field
+
</syntaxhighlight>
! effect
  −
|-
  −
| <samp>DisplayName</samp>
  −
| A [[Modding:Tokenizable strings|tokenizable string]] for the pet type's display name (e.g. "cat" or "dog"). For example, the vanilla adoption events show this when Marnie asks if you want to adopt the cat/dog.
  −
|}
     −
=====Audio & sprites=====
+
You can create an optimized delegate and call it like this:
{| class="wikitable"
+
<syntaxhighlight lang="c#">
|-
+
if (StaticDelegateBuilder.TryCreateDelegate("StardewValley.Object.OutputDeconstructor", out MachineOutputDelegate method, out string error))
! field
+
    return method(this, inputItem, probe, outputData, out minutesUntilMorning);
! effect
+
else
|-
+
    Game1.log.Warn($"Machine {ItemId} has invalid output method: {error}");
| <samp>BarkSound</samp>
+
</syntaxhighlight>
| The [[#Custom audio|cue ID]] for the pet's occasional 'bark' sound.
+
 
|-
+
The <samp>TryCreateDelegate</samp> method will cache created delegates, so calling it again will just return the same delegate instance.
| <samp>ContentSound</samp>
+
 
| The [[#Custom audio|cue ID]] for the sound which the pet makes when you pet it.
+
===Game logging changes===
|-
+
The game now writes debug output through an internal <samp>Game1.log</samp> wrapper, instead of using <samp>Console.WriteLine</samp> directly. For example:
| <samp>RepeatContentSoundAfter</samp>
+
<syntaxhighlight lang="c#">
| ''(Optional)'' The number of milliseconds until the <samp>ContentSound</samp> is repeated once. This is used by the dog, who pants twice when pet. Defaults to -1 (disabled).
+
// old code
|-
+
Console.WriteLine("Error playing sound: " + ex);
| <samp>EmoteOffset</samp>
  −
| ''(Optional)'' A pixel offset for the emote drawn above the pet sprite, specified as an object with <samp>X</samp> and <samp>Y</samp> fields. For example, this affects the heart emote shown after petting it. Default none.
  −
|}
     −
=====Events=====
+
// new code
{| class="wikitable"
+
Game1.log.Error("Error playing sound.", ex);
|-
+
</syntaxhighlight>
! field
  −
! effect
  −
|-
  −
| <samp>EventOffset</samp>
  −
| ''(Optional)'' The pixel offset for the pet when shown in events like Marnie's adoption event, specified as an object with <samp>X</samp> and <samp>Y</samp> fields. Default none.
  −
|-
  −
| <samp>AdoptionEventLocation</samp><br /><samp>AdoptionEventId</samp>
  −
| ''(Optional)'' If both fields are set, the location and [[Modding:Event data|event ID]] which lets the player adopt this pet. This forces the event to play after 20 days if its preconditions haven't been met yet. Default <samp>Farm</samp> and none respectively.
  −
|-
  −
| <samp>SummitPerfectionEvent</samp>
  −
| ''(Optional)'' How to render the pet during the summit [[perfection]] slideshow. If this isn't set, the pet won't be shown in the slideshow.
     −
This consists of a model with these fields:
+
This has a few benefits:
 +
* For vanilla players, the game no longer uses time & resources writing to a console that's not visible anyway.
 +
* For modded players, SMAPI can now...
 +
** distinguish between the game's debug/warn/error messages (so many warnings/errors that would previously appear as hidden <samp>TRACE</samp> messages will now be shown with the correct level);
 +
** apply its formatting rules to exceptions logged by the game too;
 +
** redirect game output much more efficiently without console interception.
    +
===Other changes===
 +
====Audio====
 +
<ul>
 +
<li>Added <samp>Game1.sounds</samp>, which unifies the high-level sound effect logic (e.g. distance fading and multiplayer sync).</li>
 +
<li>Added <samp>silence</samp> [[Modding:Audio|audio cue]] for music. This is different from <samp>none</samp> in that it suppresses both town music and ambient sounds.</li>
 +
<li>Added <samp>Game1.soundBank.Exists(cueName)</samp> method to check if an audio cue exists.</li>
 +
<li>Added <samp>Game1.playSound</samp> overloads to get the audio cue being played.</li>
 +
<li>Added <samp>character.playNearbySoundAll</samp> and <samp>playNearbySoundAllLocal</samp> methods to play a sound for players near the player/character.</li>
 +
<li>Added position argument to <samp>DelayedAction.playSoundAfterDelay</samp>.</li>
 +
<li>Removed <samp>NetAudioCueManager</samp> and <samp>Game1.locationCues</samp> (unused).</li>
 +
<li>Unified the methods for playing normal/pitched/positional sounds (which also adds support for pitched non-synced & pitched positional sounds):
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! field
+
! old methods
! effect
+
! new method
 
|-
 
|-
| <samp>SourceRect</samp>
+
| <samp>Game1.playSound</samp><br /><samp>Game1.playSoundAt</samp><br /><samp>Game1.playSoundPitched</samp>
| The source rectangle within the pet's texture to draw.
+
| <samp>Game1.playSound</samp>
 
|-
 
|-
| <samp>AnimationLength</samp>
+
| <samp>GameLocation.playSound</samp><br /><samp>GameLocation.playSoundAt</samp><br /><samp>GameLocation.playSoundPitched</samp>
| The number of frames to show starting from the <samp>SourceRect</samp>.
+
| <samp>GameLocation.playSound</samp>
 
|-
 
|-
| <samp>Motion</samp>
+
| <samp>GameLocation.localSound</samp><br /><samp>GameLocation.localSoundAt</samp>
| The motion to apply to the pet sprite.
+
| <samp>GameLocation.localSound</samp>
 
|-
 
|-
| <samp>Flipped</samp>
+
| <samp>NetAudio.Play</samp><br /><samp>NetAudio.PlayAt</samp><br /><samp>NetAudio.PlayPitched</samp>
| ''(Optional)'' Whether to flip the pet sprite left-to-right. Default false.
+
| <samp>NetAudio.Play</samp>
 
|-
 
|-
| <samp>PingPong</samp>
+
| <samp>NetAudio.PlayLocal</samp><br /><samp>NetAudio.PlayLocalAt</samp>
| ''(Optional)'' Whether to apply the 'ping pong' effect to the pet sprite animation. Default false.
+
| <samp>NetAudio.PlayLocal</samp>
|}
+
|}</li>
|}
+
</ul>
   −
=====Behavior=====
+
====Debug commands====
 +
{{/doc status|[[Modding:Console commands]]|done=true}}
 +
 
 +
<ul>
 +
<li>All debug commands are now quote-aware, so you can pass spaces in arguments like <code>debug build "Junimo Hut"</code>.</li>
 +
<li>Added new [[Modding:Console commands|debug commands]]:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! field
+
! command
! effect
+
! description
 
|-
 
|-
| <samp>MoveSpeed</samp>
+
| <samp>action {{t|action}}</samp>
| ''(Optional)'' How quickly the pet can move. Default 2.
+
| Run a [[Modding:Trigger actions|trigger action string]], like <samp>action AddMoney 500</samp> to add {{price|500}} to the current player.
 
|-
 
|-
| <samp>SleepOnBedChance</samp><br /><samp>SleepNearBedChance</samp><br /><samp>SleepOnRugChance</samp>
+
| <samp>artifactSpots</samp>
| ''(Optional)'' The percentage chances for the locations where the pet will sleep each night, as a decimal value between 0 (never) and 1 (always). Each value is checked in the order listed at left until a match is found. If none of them match, the pet will choose a random empty spot in the farmhouse; if none was found, it'll sleep next to its pet bowl outside.
+
| Spawn an [[Artifact Spot|artifact spot]] in each empty tile around the player.
 
|-
 
|-
| <samp>Behaviors</samp>
+
| <samp>endEvent</samp> / <samp>ee</samp>
| The pet's possible actions and behaviors, defined as the states in a state machine. Essentially the pet will be in one state at any given time, which also determines which state they can transition to next. For example, a cat can transition from <samp>Walk</samp> to <samp>BeginSitDown</samp>, but it can't skip instantly from <samp>Walk</samp> to <samp>SitDownLick</samp>.
+
| Immediately end the current event or festival, applying the event's skip logic (if any). The event is marked seen, but you can rewatch it using the <samp>eventById</samp> command if needed.
   −
This consists of a list of models with these fields:
+
This replaces the pre-1.6 commands (<samp>ee</samp>, <samp>endEvent</samp>/<samp>leaveEvent</samp>, and <samp>eventOver</samp>) which worked in different ways and had side-effects like restarting the event or clearing the player's mail.
 
  −
<dl>
  −
<dt>Required fields:</dt>
  −
<dd>
  −
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>exportShops</samp>
! effect
+
| Export a summary of what's in every shop in the game, taking into account their current conditions. This is saved to a file on disk, and the file path shown in the console.
 
|-
 
|-
| <samp>Name</samp>
+
| <samp>filterLoadMenu</samp> / <samp>flm</samp>
| A unique name for the state. This only needs to be unique within the pet type (e.g. <samp>Cat</samp> and <samp>Dog</samp> can have different behaviors with the same name).
+
| ''Syntax: <samp>filterLoadMenu {{t|search text}}''
|}
  −
</dd>
     −
<dt>Direction:</dt>
+
Filter the current list of saves to those whose player name or farm name contains the given text.
<dd>
  −
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>forcebuild</samp>
! effect
+
| Equivalent to <samp>build</samp>, but disables all safety checks so you can build in a location that wouldn't normally allow buildings, build on top of farm animals or placed objects, etc.
 
|-
 
|-
| <samp>Direction</samp>
+
| <samp>gamequery</samp> / <samp>gq</samp>
| ''(Optional)'' The specific direction to face at the start of this state (one of <samp>left</samp>, <samp>right</samp>, <samp>up</samp>, or <samp>down</samp>), unless overridden by <samp>RandomizeDirection</samp>.
+
| ''Syntax:'' <samp>gq {{t|query}}</samp>
 +
 
 +
Check whether the given [[Modding:Game state queries|game state query]] matches in the current context. For example:
 +
<pre>
 +
gq !SEASON Spring, WEATHER Here Sun
 +
> Result: true.
 +
</pre>
 
|-
 
|-
| <samp>RandomizeDirection</samp>
+
| <samp>itemquery</samp> / <samp>iq</samp>
| ''(Optional)'' Whether to point the pet in a random direction at the start of this state (overriding the <samp>Direction</samp> if specified). Default false.
+
| ''Syntax:'' <samp>iq {{t|query}}</samp>
 +
 
 +
Open a shop menu with all the items matching an [[Modding:Item queries|item query]] (all items free). For example:
 +
* <samp>debug iq ALL_ITEMS</samp> shows all items;
 +
* <samp>debug iq ALL_ITEMS (W)</samp> shows all weapons;
 +
* <samp>debug iq (O)128</samp> shows a pufferfish (object 128);
 +
* <samp>debug iq FLAVORED_ITEM Wine (O)128</samp> shows Pufferfish Wine.
 
|-
 
|-
| <samp>IsSideBehavior</samp>
+
| <samp>logFile</samp>
| ''(Optional)'' Whether to constrain the pet's facing direction to left and right while the state is active. Default false.
+
| Begin writing debug messages to a log file at <samp>%appdata%/StardewValley/ErrorLogs/game-latest.txt</samp> to simplify troubleshooting. You can also enter <samp>/logtext</samp> into the in-game chatbox to enable it.
|}
  −
</dd>
     −
<dt>Movement:</dt>
+
This does nothing if SMAPI is installed, since the debug messages are already saved to SMAPI's log.
<dd>
  −
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>logSounds</samp>
! effect
+
| Log info about each sound effect played to the SMAPI console window.
 
|-
 
|-
| <samp>WalkInDirection</samp>
+
| <samp>movieSchedule {{o|year}}</samp>
| ''(Optional)'' Whether to walk in the pet's facing direction. Default false.
+
| Lists the movies that will play in a given {{o|year}} (default this year), with the dates they'll play.
 
|-
 
|-
| <samp>MoveSpeed</samp>
+
| <samp>qualifiedid</samp>
| ''(Optional)'' Overrides the pet's <samp>MoveSpeed</samp> field while this state is active. Default -1 (which uses the pet's <samp>MoveSpeed</samp> value).
+
| Print the held item's display name and [[#Custom items|qualified item ID]].
|}
  −
</dd>
  −
 
  −
<dt>Audio:</dt>
  −
<dd>
  −
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>search</samp>
! effect
+
| ''Syntax:'' <samp>search {{o|term}}</samp>
|-
  −
| <samp>SoundOnStart</samp>
  −
| ''(Optional)'' The [[#Custom audio|audio cue ID]] for the sound to play when the state starts. If set to <samp>BARK</samp>, the pet's <samp>BarkSound</samp> (or breed's <samp>BarkOverride</samp>) field is used. Defaults to none.
  −
|-
  −
| <samp>SoundRange</samp><br /><samp>SoundRangeFromBorder</samp>
  −
| ''(Optional)'' When set, the <samp>SoundOnStart</samp> is only audible if the pet is within this many tiles away from the player (<samp>SoundRange</samp>) or past the border of the screen (<samp>SoundRangeFromBorder</samp>). Default -1 (no distance check).
  −
|-
  −
| <samp>SoundIsVoice</samp>
  −
| ''(Optional)'' Whether to mute the <samp>SoundOnStart</samp> when the 'mute animal sounds' option is set. Default false.
  −
|}
  −
</dd>
     −
<dt>Behavior transitions:</dt>
+
List all debug commands that match the given search term (or all debug commands if the search term is omitted). For example:
<dd>
+
<pre>debug search backpack
{| class="wikitable"
+
> Found 2 debug commands matching search term 'backpack':
 +
    - Backpack
 +
    - FillBackpack (fbp, fill, fillbp)</pre>
 
|-
 
|-
! field
+
| <samp>setFarmEvent</samp> / <samp>sfe</samp>
! effect
+
| ''Syntax:'' <samp>setFarmEvent {{t|event id}}</samp>
|-
  −
| <samp>AnimationEndBehaviorChanges</samp><br /><samp>TimeoutBehaviorChanges</samp><br /><samp>PlayerNearbyBehaviorChanges</samp><br /><samp>RandomBehaviorChanges</samp><br /><samp>JumpLandBehaviorChanges</samp>
  −
| ''(Optional)'' A list of possible behavior transitions to start when the criteria are achieved. If multiple transitions are listed, a random one will be selected. If omitted, it won't affect behavior transitions.
     −
These are triggered when this behavior's animation finishes (<samp>AnimationEndBehaviorChanges</samp>), when the set duration ends (<samp>TimeoutBehaviorChanges</samp>), when the player is within 2 tiles of the pet (<samp>PlayerNearbyBehaviorChanges</samp>), randomly at the start of each frame based on the <samp>RandomBehaviorChangeChance</samp> field (<samp>RandomBehaviorChanges</samp>), and when the pet finishes a jump (<samp>JumpLandBehaviorChanges</samp>).
+
Queue an [[Random Events#Farm events|overnight farm event]] if one doesn't plan naturally instead. The {{t|event id}} can be one of...
 +
* <samp>dogs</samp>;
 +
* [[Random Events#Earthquake|<samp>earthquake</samp>]];
 +
* [[Random Events#The Crop Fairy|<samp>fairy</samp>]];
 +
* [[Random Events#Meteorite|<samp>meteorite</samp>]];
 +
* [[Random Events#Stone Owl|<samp>owl</samp>]];
 +
* [[Random Events#Strange Capsule|<samp>ufo</samp>]];
 +
* [[Random Events#The Witch|<samp>witch</samp>]].
   −
These consist of a list of models with these fields:
+
Note that even if the farm event runs, it may exit without doing anything (e.g. rare events like <samp>ufo</samp> have extra condition checks when the start).
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>shop</samp>
! effect
+
| ''Syntax:'' <samp>shop {{t|shop ID}} {{o|owner name}}</samp>
 +
 
 +
Open a [[#Custom shops|shop defined in <samp>Data/Shops</samp>]], regardless of whether one of the owners is nearby. Specifying {{o|owner name}} will use that NPC, otherwise the command will find the closest valid NPC if possible (else open with no NPC).
 
|-
 
|-
| <samp>Behavior</samp><br /><samp>LeftBehavior</samp><br /><samp>RightBehavior</samp><br /><samp>UpBehavior</samp><br /><samp>DownBehavior</samp>
+
| <samp>skinBuilding</samp> / <samp>bsm</samp>
| The name of the behavior to start. The pet will check for a behavior field matching its current facing direction first, then try the <samp>Behavior</samp>. If none are specified, the current behavior will continue unchanged.
+
| If the player is standing right under a building, open a menu to change the building appearance.
 
|-
 
|-
| <samp>OutsideOnly</samp>
+
| <samp>testwedding</samp>
| ''(Optional)'' Whether the transition can only happen if the pet is outside. Default false.
+
| Immediately play the [[Marriage#The Wedding|wedding]] event. This requires the player to be married first - to test specific NPCs, <samp>debug marry</samp> the NPC followed by this command.
 
|-
 
|-
| <samp>Weight</samp>
+
| <samp>thishouseupgrade</samp> / <samp>thishouse</samp> / <samp>thu</samp>
| ''(Optional)'' The option's weight when randomly choosing a behavior, relative to other behaviors in the list (e.g. <samp>2</samp> is twice as likely as <samp>1</samp>). Default 1.
+
| Equivalent to <samp>houseupgrade</samp>, but can be used to upgrade another player's house by running it from inside or just south of its exterior.
|}
   
|-
 
|-
| <samp>Duration</samp><br /><samp>MinimumDuration</samp><br /><samp>MaximumDuration</samp>
+
| <samp>toggleCheats</samp>
| ''(Optional)'' The millisecond duration until the pet transitions to a behavior in the <samp>TimeoutBehaviorChanges</samp> field, if set. You must specify either a specific duration, or an inclusive minimum-to-maximum range in which the game will choose a random duration. If omitted, the behavior won't have a duration limit.
+
| Enable or disable entering debug commands into the in-game chat (prefixed with <samp>/</samp>).
 
|-
 
|-
| <samp>RandomBehaviorChangeChance</samp>
+
| <samp>tokens</samp>
| ''(Optional)'' The random probability at the start of each frame that the pet will transition to a behavior in the <samp>RandomBehaviorChanges</samp> field, if set. Specified as a value between 0 (never) and 1 (always). Default 0.
+
| ''Syntax:'' <samp>tokens {{t|tokenized string}}</samp>
|}
  −
</dd>
     −
<dt>Animation and per-frame sounds:</dt>
+
Parses a [[Modding:Tokenizable strings|tokenizable string]] and prints its output. For example:
<dd>
+
<pre>
 +
tokens [LocalizedText Strings\StringsFromCSFiles:MapPage.cs.11064 [EscapedText [FarmName]]]
 +
> Result: "Lon Lon Farm"
 +
</pre>
 +
|-
 +
| <samp>worldMapLines</samp>
 +
| Toggles the [[Modding:World map#Debug view|world map's debug view]].
 +
|}</li>
 +
<li>Improved existing debug commands:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! field
+
! command
! effect
+
! changes
 
|-
 
|-
| <samp>Animation</samp>
+
| <samp>build</samp>
| ''(Optional)'' The animation frames to play while this state is active. This consists of a list of models with these fields:
+
| Removed custom space handling; quote arguments with spaces instead of replacing them with 9 (e.g. <code>Junimo9Hut</code> → <code>"Junimo Hut"</code>).
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>clearFurniture</samp>
! effect
+
| Now works outside the farmhouse too.
 
|-
 
|-
| <samp>Frame</samp>
+
| <samp>dialogue</samp>
| The frame index in the animation. This should be an incremental number starting at 0.
+
| Removed custom space handling; quote NPC names containing spaces instead, with all text after the first argument treated as part of the dialogue (e.g. <code>debug dialogue "Some NPC" Some dialogue text$h</code>).
 
|-
 
|-
| <samp>Duration</samp>
+
| <samp>ebi</samp>
| The millisecond duration for which the frame should be kept on-screen before continuing to the next frame.
+
| Fixed event not played correctly if called from the same location as the event.
 
|-
 
|-
| <samp>HitGround</samp>
+
| <samp>fish</samp>
| ''(Optional)'' Whether to play the footstep sound for the tile under the pet when the frame starts. Default false.
+
| Fixed error if you're not holding a fishing rod. It now opens the fishing minigame with no tackle instead.
 
|-
 
|-
| <samp>Jump</samp>
+
| <samp>frameOffset</samp>
| ''(Optional)'' Whether the pet should perform a small hop when the frame starts, including a 'dwop' sound. Default false.
+
| &#32;
 +
* Simplified usage. You can now pass negative offsets directly (like <samp>debug frameOffset -5 -10</samp>) instead of using the <samp>s</samp> number prefix.
 +
* Fixed command only taking the last digit in each number.
 
|-
 
|-
| <samp>Sound</samp>
+
| <samp>getStat</samp><br /><samp>setStat</samp>
| ''(Optional)'' The [[#Custom audio|audio cue ID]] for the sound to play when the animation starts or loops. If set to <samp>BARK</samp>, the pet's <samp>BarkSound</samp> (or breed's <samp>BarkOverride</samp>) field is used. Defaults to none.
+
| Added argument validation.
 
|-
 
|-
| <samp>SoundRange</samp><br /><samp>SoundRangeFromBorder</samp><br /><samp>SoundIsVoice</samp>
+
| <samp>grass</samp>
| See description for the equivalent behavior fields, but applies to the frame's <samp>Sound</samp> field instead.
+
| Now applies to the current location, instead of the farm.
|}
   
|-
 
|-
| <samp>Shake</samp>
+
| <samp>growAnimals</samp><br /><samp>growAnimalsFarm</samp>
| ''(Optional)'' The millisecond duration for which to shake the pet when the state starts. Default 0.
+
| Merged into one <samp>growAnimals</samp> command that supports any location and doesn't reset the age of animals which are already adults.
 
|-
 
|-
| <samp>LoopMode</samp>
+
| <samp>growCrops</samp>
| ''(Optional)'' What to do when the last animation frame is reached while the behavior is still active. The possible values are <samp>Hold</samp> (keep the last frame visible until the animation ends), <samp>Loop</samp> (restart from the first frame), or <samp>None</samp> (equivalent to <samp>Loop</samp>). Default <samp>None</samp>.
+
| Fixed error growing mixed seeds or giant crops.
 
|-
 
|-
| <samp>AnimationMinimumLoops</samp><br /><samp>AnimationMaximumLoops</samp>
+
| <samp>itemNamed</samp>
| ''(Optional)'' The minimum and maximum number of times to play the animation. Both must be specified to have any effect. The game will choose an inclusive random value between them. Both default to -1 (don't repeat animation).
+
| Removed custom space handling; quote arguments with spaces instead of removing them (e.g. <code>EelRoe</code> → <code>"Eel Roe"</code>).
|}
+
|-
</dd>
+
| <samp>junimoGoodbye</samp><br /><samp><samp>junimoStar</samp>
</dl>
+
| Added validation to check that you're inside the community center.
|}
+
|-
 
+
| <samp>killAll</samp><br /><samp>killAllHorses</samp><br /><samp>killNpc</samp>
=====Breeds=====
+
| These now remove matching NPCs inside constructed buildings too.
{| class="wikitable"
+
|-
 +
| <samp>killMonsterStat</samp>
 +
| Removed custom space handling; quote arguments with spaces instead of replacing them with 0 (e.g. <code>Dust0Spirit</code> → <code>"Dust Spirit"</code>).
 
|-
 
|-
! field
+
| <samp>mailForTomorrow</samp>
! effect
+
| Fixed zeros in the mail ID getting replaced with underscores.
 
|-
 
|-
| <samp>Breeds</samp>
+
| <samp>monster</samp>
| The cosmetic breeds which can be selected in the character customization menu when creating a save. This consists of a list of models with these fields:
+
| Added validation for the monster name.
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>moveBuilding</samp>
! effect
+
| Now applies to the current location, instead of the farm.
 
|-
 
|-
| <samp>ID</samp>
+
| <samp>movie</samp>
| The unique ID for the breed within the pet type.
+
| Rewritten; it's now simpler, applies the normal game logic, defaults to today's movie, and avoids depending on NPC indexes in <samp>Data/NPCDispositions</samp> since those can change with custom NPCs.
 +
 
 +
New usage:
 +
: ''<samp>debug movie {{o|movie ID}} {{o|invite NPC name}}''
 +
: ''<samp>debug movie current {{o|invite NPC name}}''
 +
 
 +
The movie ID defaults to today's movie, and the NPC name can be omitted to watch the movie without an invitee. Specifying <samp>current</samp> as the movie uses the default value.
 
|-
 
|-
| <samp>Texture</samp>
+
| <samp>panMode</samp>
| The asset name for the breed spritesheet for the pet's in-game sprite. This should be 128 pixels wide, and 256 (cat) or 288 (dog) pixels high.
+
| The command no longer overrides debug command handling while it's active. Instead you can now turn it back off by running <samp>debug panMode</samp> again, clear with <samp>debug panMode clear</samp>, or set a time with <samp>debug panMode {time}</samp>.
 
|-
 
|-
| <samp>IconTexture</samp>
+
| <samp>paintBuilding</samp>
| The asset name for the breed icon texture, shown on the character customization screen and in-game menu. This should be a 16x16 pixel icon.
+
| &#32;
 +
* Now applies to the current location, instead of the farm.
 +
* Added validation for the target building.
 
|-
 
|-
| <samp>IconSourceRect</samp>
+
| <samp>playSound</samp>
| The icon's pixel area within the <samp>IconTexture</samp>, specified as an object with <samp>X</samp>, <samp>Y</samp>, <samp>Width</samp>, and <samp>Height</samp> fields.
+
| Added an optional pitch argument, like <samp>debug playSound barrelBreak 1200</samp>. The pitch is a value from 1 (low pitch) to 2400 (high pitch) inclusively.
 
|-
 
|-
| <samp>BarkOverride</samp>
+
| <samp>question</samp>
| ''(Optional)'' Override the pet's <samp>BarkSound</samp> field for this breed, if set.
+
| You can now forget a selected answer (instead of adding it) by setting the second argument to false, like <samp>question {{t|id}} false</samp>.
 
|-
 
|-
| <samp>VoicePitch</samp>
+
| <samp>runTestEvent</samp>
| ''(Optional)'' The [[wikipedia:Pitch (music)|pitch]] applied to the pet's bark sound, measured as a decimal value relative to 1. Defaults to 1.
+
| Fixed support for Unix line endings.
|}
  −
|}
  −
 
  −
=====Advanced=====
  −
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>seenEvent</samp>
! effect
+
| You can now forget an event (instead of adding it) by setting the second argument to false, like <samp>seenEvent {{t|id}} false</samp>.
 
|-
 
|-
| <samp>CustomFields</samp>
+
| <samp>seenMail</samp>
| The [[#Custom data fields|custom fields]] for this entry.
+
| You can now remove a mail received (instead of adding it) by setting the second argument to false, like <samp>seenMail {{t|id}} false</samp>.
|}
+
|-
 
+
| <samp>skinBuilding</samp>
====Other changes====
+
| &#32;
* The pet bowl is now a building which can be constructed or moved. Each pet is assigned to an available pet bowl. For C# mods, each pet now has a <samp>guid</samp> field populated with a unique ID, and each pet bowl has a <samp>petGuid</samp> field which tracks its owner (see the <samp>PetBowl::HasPet()</samp> and <samp>PetBowl::FindPet()</samp> methods).
+
* Now applies to the current location, instead of the farm.
* In the [[Modding:Event data#Basic format|event character setup]], you can now use <samp>pet</samp> to add a pet of the player's selected type. Its actor name will be <samp>PetActor</samp> in other event commands. This supersedes <samp>cat</samp> (with name <samp>Cat</samp>) and <samp>dog</samp> (with name <samp>Dog</samp>), though those still work too.
+
* Added validation for the target building.
* For C# mods:
  −
** All pets now use a generic <samp>Pet</samp> class, instead of <samp>Cat</samp> or <samp>Dog</samp>. The pet type is tracked by the pet's <samp>petType</samp> field.
  −
** The player's preferred pet type is tracked by <samp>Game1.player.whichPetType</samp>. The former <samp>catPerson</samp> field is now readonly and checks that field.
  −
** Added <samp>Pet.type_cat</samp> and <samp>Pet.type_dog</samp> constants for the default pet types.
  −
 
  −
===Custom monster eradication goals===
  −
: ''See also: [[#Monster eradication goal flag changes|Monster eradication goal flag changes]].''
  −
 
  −
You can now add/edit [[Adventurer's Guild]] monster eradication goals by editing the new <samp>Data/MonsterSlayerQuests</samp> data asset.
  −
 
  −
This consists of a string → model lookup, where...
  −
* The key is a [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for the monster eradication goal.
  −
* The value is a model with the fields listed below.
  −
 
  −
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>skullGear</samp>
! effect
+
| &#32;
 +
* Fixed command setting 32 slots instead of 36.
 +
* Fixed command not adding empty inventory slots as expected by some game code.
 
|-
 
|-
| <samp>DisplayName</samp>
+
| <Samp>setupFishPondFarm</samp>
| A [[Modding:Tokenizable strings|tokenizable string]] for the goal's display name, shown on the board in the Adventurer's Guild.
+
| Fixed error if the farm already has non-fish-pond buildings constructed.
 
|-
 
|-
| <samp>Targets</samp>
+
| <samp>speech</samp>
| A list of [[Modding:Monster data#Monster IDs|monster IDs]] that are counted towards the <samp>Count</samp>.
+
| Removed custom space handling; quote NPC names containing spaces instead, with all text after the first argument treated as part of the dialogue (e.g. <code>debug speech "Some NPC" Some dialogue text$h</code>).
 
|-
 
|-
| <samp>Count</samp>
+
| <samp>spreadDirt</samp>
| The total number of monsters (matching the <samp>Targets</samp>) which must be defeated to complete this goal.
+
| Now applies to the current location, instead of the farm.
 
|-
 
|-
| <samp>RewardItemId</samp>
+
| <samp>spreadSeeds</samp>
| ''(Optional)'' The [[#Custom items|qualified ID]] for the item that can be collected from [[Gil]] when this goal is completed. Default none.
+
| Now applies to the current location, instead of the farm.
 
|-
 
|-
| <samp>RewardItemPrice</samp>
+
| <samp>thisHouseUpgrade</samp>
| ''(Optional)'' The price of the <samp>RewardItemId</samp> in [[Marlon]]'s shop after the goal is completed, or -1 to disable buying it from Marlon. Default -1.
+
| Now applies to the current location, instead of the farm.
 
|-
 
|-
| <samp>RewardDialogue</samp><br /><samp>RewardDialogueFlag</samp>
+
| <samp>warpToPlayer</samp>
| ''(Optional)'' A [[Modding:Tokenizable strings|tokenizable string]] for custom [[Gil]] dialogue shown when talking to him after completing the goal, and an optional [[Modding:Mail data|mail flag]] to set when the player has seen the dialogue. Both default to none.
+
| Removed custom space handling; quote arguments with spaces instead of removing them (e.g. <code>JohnSmith</code> <code>"John Smith"</code>).
 
  −
If there are reward items, they're shown after this dialogue.
  −
 
  −
If <samp>RewardDialogue</samp> is used without <samp>RewardDialogueFlag</samp>, then this dialogue will be shown each time the reward menu is opened after completing the goal, until the player collects the reward items. If the <samp>RewardItems</samp> isn't set, this can safely be omitted since the goal will be marked collected immediately.
  −
 
  −
This doesn't send a letter; see <samp>RewardMail</samp> or <samp>RewardMailAll</samp> for that.
   
|-
 
|-
| <samp>RewardFlag</samp><br /><samp>RewardFlagAll</samp>
+
| <samp>whereIs</samp>
| ''(Optional)'' The [[Modding:Mail data|mail flag ID]] to set for the current player (<samp>RewardFlag</samp>) or all players (<samp>RewardFlagAll</samp>) when talking to [[Gil]] after completing the goal. Default none.
+
| &#32;
 +
* Now lists all matching NPCs instead of the first one.
 +
* Now searches the current event or festival, if any.
 +
|}</li>
   −
Note that <samp>RewardFlag</samp> is usually not needed, since the game will also set a <samp>Gil_{{t|goal ID}}</samp> flag regardless.
+
<li>Removed some debug commands:
 
+
{| class="wikitable"
This doesn't send a letter; see <samp>RewardMail</samp> or <samp>RewardMailAll</samp> for that.
   
|-
 
|-
| <samp>RewardMail</samp><br /><samp>RewardMailAll</samp>
+
! command
| ''(Optional)'' The mail letter ID to add to the mailbox tomorrow for the current player (<samp>RewardMail</samp>) or all players (<samp>RewardMailAll</samp>). Default none.
+
! notes
 
|-
 
|-
| <samp>CustomFields</samp>
+
| <samp>ax</samp><br /><samp>bigItem</samp>/<samp>b</samp>/<samp>bi</samp>/<samp>big</samp><br /><samp>boots</samp><br /><samp>clothes</samp><br /><samp>hoe</samp><br /><samp>milkPail</samp>/<samp>mp</samp><br /><samp>pan</samp><br /><samp>pickaxe</samp>/<samp>pick</samp>/<samp>pickax</samp><br /><samp>ring</samp>/<samp>addRing</samp><br /><samp>shears</samp>/<samp>scissors</samp><br /><samp>slingshot</samp><br /><samp>tool</samp><br /><samp>wateringCan</samp>/<samp>can</samp><br /><samp>wand</samp><br /><samp>weapon</samp>
| The [[#Custom data fields|custom fields]] for this entry.
+
| These are replaced by more general commands like <code>item (O)128</code> (spawn item by ID), <code>fuzzyItemNamed pufferfish</code> (spawn by item name), or <code>itemQuery FLAVORED_ITEM Wine (O)128</code> (spawn by [[Modding:Item queries|item query]]).
|}
  −
 
  −
===Custom phone calls===
  −
Mods can now extend the [[telephone]] with custom calls (both incoming calls, and phone numbers which the player can call).
  −
 
  −
====Incoming calls====
  −
You can add or customize incoming calls by editing the <samp>Data/IncomingPhoneCalls</samp> asset.
  −
 
  −
This consists of a string → model lookup, where...
  −
* The key is a [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for the incoming call data.
  −
* The value is a model with the fields listed below.
  −
 
  −
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>addQuartz</samp><br /><samp>blueBook</samp><br /><samp>blueprint</samp><br /><samp>end</samp>
! effect
+
| These were part of unused features removed in 1.6.
 
|-
 
|-
| <samp>Dialogue</samp>
+
| <samp>changeStat</samp>
| The dialogue text to show when the player answers the phone. This can use the full [[Modding:Dialogue|dialogue format]] (including questions and different dialogue based on the selected answer).
+
| Removed; use <samp>setStat</samp> instead.
 
|-
 
|-
| <samp>FromNpc</samp>
+
| <samp>ee</samp><br /><samp>endEvent</samp>/<samp>leaveEvent</samp><br /><samp>eventOver</samp>
| ''(Optional)'' The internal name of the NPC making the call. If specified, that NPC's name and portrait will be shown.
+
| Replaced by the new <samp>endEvent</samp> command.
 
|-
 
|-
| <samp>FromPortrait</samp>
+
| <samp>everythingshop</samp>
| ''(Optional)'' The asset name for the portrait spritesheet to display (like <samp>Portraits/Abigail</samp>). If <samp>FromNpc</samp> is specified too, this overrides the portrait from that NPC. If both <samp>FromNpc</samp> and <samp>FromDisplayName</samp> are null, this portrait will be shown with the display name "???".
+
| Removed. You can get all items like <code>debug iq ALL_ITEMS</code>, or all items of a given type like <code>debug iq ALL_ITEMS (O)</code>.
 
|-
 
|-
| <samp>FromDisplayName</samp>
+
| <samp>oldMineGame</samp>
| ''(Optional)'' A [[Modding:Tokenizable strings|tokenizable string]] for the calling NPC's display name. If <samp>FromNpc</samp> is specified too, this overrides the display name from that NPC.
+
| Removed along with the pre-1.4 [[Junimo Kart]] code.
 
|-
 
|-
| <samp>MaxCalls</samp>
+
| <samp>pathSpouseToMe</samp>/<samp>pstm</samp>
| ''(Optional)'' The maximum number of times a player can receive this phone call, or <c>-1</samp> for no limit. Default 1.
+
| Removed along with the unimplemented farm activities code.
|-
+
|}</li>
| <samp>TriggerCondition</samp><br /><samp>RingCondition</samp>
  −
| ''(Optional)'' If set, a game state query which indicates whether to trigger this phone call (<samp>TriggerCondition</samp>) or whether the phone rings when this call is received (<samp>RingCondition</samp>).
     −
Whether a player receives this call depends on both fields: <samp>TriggerCondition</samp> is checked on the main player before sending the call to all players, then <samp>RingCondition</samp> is checked on each player to determine whether the phone rings for them.
+
<li>Added alternative names for some debug commands (new names in parentheses): <samp>bpm</samp> + <samp>bsm</samp> (<samp>paintBuilding</samp> + <samp>skinBuilding</samp>), <samp>craftingRecipe</samp> (</samp>addCraftingRecipe</samp>), <samp>db</samp> (</samp>speakTo</samp>), <samp>dialogue</samp> (</samp>addDialogue</samp>), <samp>pdb</samp> (</samp>printGemBirds</samp>), <samp>r</samp> (</samp>resetForPlayerEntry</samp>), <samp>removeLargeTf</samp> (</samp>removeLargeTerrainFeature</samp>), <samp>sb</samp> (</samp>showTextAboveHead</samp>), <samp>sl</samp> + <samp>sr</samp> (<samp>shiftToolbarLeft</samp> + </samp>shiftToolbarRight</samp>), <samp>sn</samp> (</samp>secretNote</samp>), and <samp>tls</samp> (</samp>toggleLightingScale</samp>).</li>
|-
+
<li>Reworked how debug commands log output. This fixes an issue where they don't always log to the right place (e.g. a command run through the chatbox might log to the console or vice-versa), and lets mods pass a custom logger to capture or redirect output.</li>
| <samp>IgnoreBaseChance</samp>
+
</ul>
| ''(Optional)'' Whether to ignore the 1% base chance when checking whether to trigger an incoming call. If true, the game will check if this call can be received regardless of the base chance. Default false.
  −
|-
  −
| <samp>SimpleDialogueSplitBy</samp>
  −
| ''(Optional, specialized)'' If set, marks the call as having a simple dialogue string without an NPC name and portrait, with lines split into multiple boxes by this substring. For example, <code>"SimpleDialogueSplitBy": "#"</code> will split <code>Box A#Box B#Box C</code> into three consecutive dialogue boxes.
     −
You should omit this in most cases, and use the regular dialogue format in <samp>Dialogue</samp> to split lines if needed. This is mainly intended to support some older vanilla phone calls.
+
====Location logic====
|-
+
* The [[desert]] no longer assumes the player arrived by bus unless their previous location was the [[Bus Stop|bus stop]].
| <samp>CustomFields</samp>
+
* The ticket price for the bus and Willy's boat can now be edited by C# mods via <samp>BusStop.TicketPrice</samp> and <samp>BoatTunnel.TicketPrice</samp> respectively.
| The [[#Custom data fields|custom fields]] for this entry.
  −
|}
     −
====Custom handlers in C#====
+
====Menus & UI====
C# mods can implement <samp>StardewValley.PhoneCalls.IPhoneHandler</samp> and add it to <samp>Phone.PhoneHandlers</samp> for full control over both incoming and outgoing calls:
+
* Rewrote calendar menu (<samp>Billboard</samp>) to simplify custom events & event types. C# mods can now edit <samp>billboard.calendarDayData</samp> or patch <samp>billboard.GetEventsForDay</samp> to add new events.
 +
* Added <samp>Game1.textShadowDarkerColor</samp> field for the colors previously hardcoded in <samp>Utility.drawTextWithShadow</samp>.
 +
* Added <samp>MoneyDial.ShouldShakeMainMoneyBox</samp> field to simplify custom dials.
 +
* Partly de-hardcoded <samp>ShopMenu</samp> filter tabs. You can now change filter tabs by setting the <samp>shopMenu.tabButtons</samp> field with arbitrary <samp>Func&lt;ISalable, bool&gt; Filter</samp> values, or by using a predefined set of tabs like <samp>shopMenu.UseDresserTabs()</samp>.
 +
* The <samp>SpriteText</samp> methods now accept arbitrary <samp>Color</samp> tints instead of a few predefined color IDs.
 +
* The <samp>DiscreteColorPicker.getColorFromSelection</samp> methods are now static for reuse.
 +
* Fixed <samp>DiscreteColorPicker</samp> constructor ignoring the initial color argument, and added a constructor which takes a <samp>Color</samp> value.
 +
* Fixed an edge case where a custom language's fonts wouldn't be loaded when switching language.
   −
<syntaxhighlight lang="c#">
+
====[[Modding:Modder Guide/Game Fundamentals#Net fields|Net fields]]====
/// <summary>The mod entry point.</summary>
+
* Removed implicit conversion operators for most types due to their sometimes counter-intuitive behavior. The only ones left are <samp>NetBool</samp>, <samp>NetInt</samp>, and <samp>NetString</samp>; those are now marked obsolete and will raise build warnings on use.
internal sealed class ModEntry : Mod
+
* <samp>NetLocationRef</samp> now has a public <samp>LocationName</samp> and <samp>IsStructure</samp>, and its <samp>Update</samp> method allows forcing an update.
{
  −
    /// <inheritdoc />
  −
    public override void Entry(IModHelper helper)
  −
    {
  −
        Phone.PhoneHandlers.Add(new CustomPhoneHandler());
  −
    }
  −
}
     −
/// <summary>A custom phone handler.</summary>
+
====Quests====
internal sealed class CustomPhoneHandler : IPhoneHandler
+
{{/doc status|[[Modding:Quest data]]|done=false}}
{
  −
    ...
  −
}
  −
</syntaxhighlight>
     −
See <samp>StardewValley.PhoneCalls.DefaultPhoneHandler</samp> in the [[Modding:Modder Guide/Get Started#decompile|decompiled game code]] for an example implementation.
+
* Quests now have string IDs, to simplify custom quest frameworks.
 +
* Added validation for quest data parsing.
 +
* In [[Modding:Special orders|<samp>Data/SpecialOrders</samp>]], the <samp>Duration</samp> and <samp>Repeatable</samp> fields are now strongly-typed and case-insensitive.
 +
* For C# mods, fixed <samp>DescriptionElement</samp> not allowing more than four translation token substitutions.
   −
===Custom shops===
+
====Dates & seasons====
You can now create and edit shops via the new <samp>Data/Shops</samp> asset. See [[Modding:Shops]] for documentation and examples.
+
* Added a <samp>Season</samp> enum for strongly-typed, case-insensitive season checks (like <code>Game1.season == Season.Spring</code> instead of <code>Game1.currentSeason == "spring"</code>).
 
+
* Added <samp>Game1.season</samp>, <samp>Game1.GetSeasonForLocation</samp>, <samp>Game1.WorldDate.Season</samp>, and <samp>location.GetSeason()</samp> to get the season enum.
===Dialogue changes===
+
* Added <samp>Utility.getSeasonKey</samp> to get the key form from a season enum.
<ul>
+
* Improved <samp>WorldDate</samp>:
<li>Added new [[Modding:Dialogue|dialogue]] keys:
+
** added <samp>Now()</samp> to get a new instance matching the current date;
{| class="wikitable"
+
** added <samp>WorldDate.Equals</samp> and <samp>GetHashCode</samp> implementations;
|-
+
** added code docs;
! asset
+
** <samp>TotalDays</samp> is no longer written to the save file.
! key format
+
* Renamed some members for clarity (<samp>Game1.GetSeasonForLocation</samp> <samp>GetSeasonKeyForLocation</samp>, <samp>location.GetSeasonForLocation</samp> <samp>GetSeasonKey</samp>, <samp>WorldDate.Season</samp> <samp>SeasonKey</samp>).
! description
+
* Fixed <samp>location.GetSeasonKey()</samp> not applying the greenhouse logic.
|-
  −
|rowspan="22"| <samp>Characters/Dialogue/&lt;name&gt;</samp>
  −
|-
  −
| <samp>AcceptBirthdayGift_{{t|id}}</samp><br /><samp>AcceptBirthdayGift_{{t|tag}}</samp><br /><samp>AcceptBirthdayGift_{{t|taste}}</samp><br /><samp>AcceptBirthdayGift_Negative</samp><br /><samp>AcceptBirthdayGift_Positive</samp><br /><samp>AcceptBirthdayGift</samp>
  −
| Shown when receiving a birthday gift from the player. If omitted, defaults to the generic translations for all NPCs.
     −
The first matching dialogue is used in this order:
+
====Time====
# by item ID (like <samp>AcceptBirthdayGift_(O)128</samp>);
+
* For C# mods, the <samp>Game1.realMilliSecondsPerGame</samp> and <samp>Game1.realMilliSecondsPerGameTenMinutes</samp> fields are no longer marked <samp>const</samp>, and the <samp>GameLocation.getExtraMillisecondsPerInGameMinuteForThisLocation()</samp> method has been replaced with a settable <samp>ExtraMillisecondsPerInGameMinute</samp> property. That lets you change the time rate used by the vanilla game code, but you should be careful doing this since it may cause unintended effects.
# by context tag (like <samp>AcceptBirthdayGift_category_fish</samp>);
  −
# by gift taste (one of <samp>AcceptBirthdayGift_Loved</samp>, <samp>AcceptBirthdayGift_Liked</samp>, <samp>AcceptBirthdayGift_Neutral</samp>, <samp>AcceptBirthdayGift_Disliked</samp>, or <samp>AcceptBirthdayGift_Hated</samp>);
  −
# <samp>AcceptBirthdayGift_Negative</samp> (hated or disliked gift) or <samp>AcceptBirthdayGift_Positive</samp> (neutral, liked, or loved gift);
  −
# for all items (via <samp>AcceptBirthdayGift</samp>).
     −
|-
+
====Other====
| <samp>AcceptBouquet</samp>
+
* Error stack traces on Linux/macOS now have line numbers.
| Shown when the NPC accepts a [[bouquet]] from the player. Defaults to a generic dialogue.
+
* All space-delimited fields now ignore extra spaces instead of crashing. This affects map/tile properties, data assets, event commands, game state queries, etc.
|-
+
* All players and NPCs now have <samp>Tile</samp> & <samp>TilePoint</samp> properties (their cached tile position) and a <samp>StandingPixel</samp> property (the cached pixel coordinate at the center of their bounding box). These [[#Other breaking API changes|replace various deleted methods]].
| <samp>AcceptGift_{{t|id}}</samp><br /><samp>AcceptGift_{{t|tag}}</samp>
+
* All terrain features now have <samp>Tile</samp> and <samp>Location</samp> properties, and their methods no longer have location/tile parameters in most cases.
| Shown when receiving a non-birthday gift from the player. This can be by item ID (like <samp>AcceptGift_(O)128</samp>) or context tag (like <samp>AcceptGift_category_fish</samp>). If omitted, defaults to the dialogue in <samp>Data/NPCGiftTastes</samp>.
+
* All [[Modding:Modder Guide/Game Fundamentals#Net fields|net fields]] now have <samp>Name</samp> and <samp>Owner</samp> fields, which are used to show informative error messages when there's a sync issue and validate common mistakes (e.g. a net field not added to the <samp>NetFields</samp> collection).
|-
+
* The game now tracks the locations a player has visited. Mods can check the list in C# (via <samp>Game1.player.locationsVisited</samp>) or [[Modding:Game state queries|game state queries]] (via <samp>PLAYER_VISITED_LOCATION</samp>). For pre-existing saves, the list is retroactively populated based on accessible locations, events seen, mail flags set, etc.
| <samp>DumpsterDiveComment</samp>
+
* Added menu queuing (via <samp>Game1.nextClickableMenu</samp> in C#). For example, this applies if you try to take an item from a mail letter when your inventory is full.
| Shown when the NPC catches the player digging through a trash can. Defaults to a generic dialogue based on the NPC's age.
+
* Added C# code docs in many places.
|-
+
* Added <samp>Id</samp> fields to simplify content pack edits in fish pond, movie concession, random bundle, and tailoring recipe data.
| <samp>HitBySlingshot</samp>
+
* Added <samp>Game1.Multiplayer</samp> to get the game's low-level handler. (Most code should still use [[Modding:Modder Guide/APIs/Multiplayer|SMAPI's multiplayer API]] though.)
| Shown when the player shoots them with a [[slingshot]]. Defaults to a generic dialogue.
+
* Added <samp>Game1.versionBuildNumber</samp> with the build number (like <samp>26039</samp>).
|-
+
* Added field-changed events to <samp>NetPosition</samp>.
| <samp>RejectBouquet_Divorced</samp><br /><samp>RejectBouquet_NotDatable</samp><br /><samp>RejectBouquet_NpcAlreadyMarried</samp><br /><samp>RejectBouquet_VeryLowHearts</samp><br /><samp>RejectBouquet_LowHearts</samp><br /><samp>RejectBouquet</samp>
+
* Added <samp>LocalizedContentManager.CurrentLanguageString</samp>, which caches the language code like <samp>pt-BR</samp>).
| Shown when the NPC rejects a [[bouquet]].
+
* The game now uses <samp>[XmlInclude]</samp> on its types more consistently. That means the default save serializer can handle more types (e.g. all monsters), and it's easier to create custom serializers.
 +
* Refactored many parts of the code to make it more moddable for C# mods. This includes marking all classes public, changing <samp>private</samp> members to <samp>protected</samp> or <samp>public</samp>, marking members <samp>virtual</samp>, rewriting or splitting code so it's easier to extend, etc.
 +
* The <samp>startup_preferences</samp> file is now formatted to simplify troubleshooting.
 +
* Fixed many cases where the game used <samp>Game1.player</samp> instead of the provided player.
   −
A specific dialogue is shown if possible:
+
==Breaking changes for C# mods==
* <samp>RejectBouquet_Divorced</samp>: the NPC won't accept this bouquet because you divorced them.
+
'''This section only describes how this update may break existing mods. See the ''what's new'' sections above for more info, including new functionality mods can use.'''
* <samp>RejectBouquet_NotDatable</samp>: the NPC isn't romanceable.
  −
* <samp>RejectBouquet_NpcAlreadyMarried</samp>: the NPC is already married to another player. You can use <samp>{0}</samp> in the dialogue for the other player's name.
  −
* <samp>RejectBouquet_VeryLowHearts</samp>: you have less than 4 hearts with the NPC.
  −
* <samp>RejectBouquet_LowHearts</samp>: you have less than 8 hearts with the NPC.
     −
If the specific dialogue isn't set, the game will use the <samp>RejectBouquet</samp> dialogue (if set), else it'll default to generic dialogue for each case.
+
See also [[#Breaking changes for content packs|''Breaking changes for content packs'']], which affect C# mods too.
|-
  −
| <samp>RejectGift_Divorced</samp>
  −
| Shown when the NPC rejects a gift because you divorced them.
  −
|-
  −
| <samp>RejectItem_{{t|id}}</samp><br /><samp>RejectItem_{{t|tag}}</samp>
  −
| If set, the NPC will refuse to accept any matching item and show this dialogue instead. This can be by item ID (like <samp>RejectItem_(O)128</samp>) or context tag (like <samp>RejectItem_category_fish</samp>). This can prevent gifting, movie tickets, bouquets, mermaid pendants, etc. However it won't prevent accepting an item for an active quest or special order.
  −
|-
  −
| <samp>RejectMermaidPendant_Divorced</samp><br /><samp>RejectMermaidPendant_NeedHouseUpgrade</samp><br /><samp>RejectMermaidPendant_NotDatable</samp><br /><samp>RejectMermaidPendant_NpcWithSomeoneElse</samp><br /><samp>RejectMermaidPendant_PlayerWithSomeoneElse</samp><br /><samp>RejectMermaidPendant_Under8Hearts</samp><br /><samp>RejectMermaidPendant_Under10Hearts</samp><br /><samp>RejectMermaidPendant_Under10Hearts_AskedAgain</samp><br /><samp>RejectMermaidPendant</samp>
  −
| Shown when the NPC rejects a [[Mermaid's Pendant|mermaid's pendant]].
     −
A specific dialogue is shown if possible. The cases are checked in this order:
+
===.NET 6===
# <samp>RejectMermaidPendant_PlayerWithSomeoneElse</samp>: the player is already engaged or married to someone else. You can use <samp>{0}</samp> in the dialogue for the player's spouse name.
+
: ''See also: [[#.NET 6|.NET 6]] under what's new.''
# <samp>RejectMermaidPendant_NotDatable</samp>: the NPC isn't romanceable.
  −
# <samp>RejectMermaidPendant_Divorced</samp>: you divorced them, so they won't accept gifts or proposals from you.
  −
# <samp>RejectMermaidPendant_NpcWithSomeoneElse</samp>: the NPC is already engaged or married to someone else. You can use <samp>{0}</samp> in the dialogue for the other player's name.
  −
# <samp>RejectMermaidPendant_Under8Hearts</samp>: you have under 8 hearts with the NPC.
  −
# <samp>RejectMermaidPendant_Under10Hearts</samp>: you have under 10 hearts with the NPC.
  −
# <samp>RejectMermaidPendant_Under10Hearts_AskedAgain</samp>: you have under 10 hearts with the NPC, and asked again after they already said no. (Defaults to the previous dialogue if not set.)
  −
# <samp>RejectMermaidPendant_NeedHouseUpgrade</samp>: you need to upgrade your house before they can accept.
     −
If the specific dialogue isn't set, the game will use the <samp>RejectMermaidPendant</samp> dialogue (if set), else it'll default to generic dialogue for each case.
+
Stardew Valley 1.6 updates from .NET 5 to .NET 6. SMAPI can still load .NET 5 mods fine, but you'll get a build error when compiling them. To update a C# mod:
|-
+
<ol>
| <samp>RejectMovieTicket_AlreadyInvitedBySomeoneElse</samp><br /><samp>RejectMovieTicket_AlreadyWatchedThisWeek</samp><br /><samp>RejectMovieTicket_Divorced</samp><br /><samp>RejectMovieTicket_DontWantToSeeThatMovie</samp><br /><samp>RejectMovieTicket</samp>
+
<li>Make sure you have [https://visualstudio.microsoft.com/vs Visual Studio Community 2022] or later. (Compiling .NET 6 with earlier versions of Visual Studio isn't officially supported.)</li>
| Show when the NPC rejects a [[Movie Ticket|movie ticket]].
+
<li>In Visual Studio, click ''Help > Check For Updates'' and install the latest version.</li>
 +
<li>Fully exit Visual Studio.</li>
 +
<li>Open each mod's <samp>.csproj</samp> file in a text editor, then find this line:
 +
<syntaxhighlight lang="xml">
 +
<TargetFramework>net5.0</TargetFramework>
 +
</syntaxhighlight>
   −
A specific dialogue is shown if possible:
+
And change it to this:
* <samp>RejectMovieTicket_AlreadyInvitedBySomeoneElse</samp>: someone else already invited the NPC to a movie. You can use <samp>{0}</samp> in the dialogue for the other player's name.
+
<syntaxhighlight lang="xml">
* <samp>RejectMovieTicket_AlreadyWatchedThisWeek</samp>: the NPC already watched a movie this week.
+
<TargetFramework>net6.0</TargetFramework>
* <samp>RejectMovieTicket_Divorced</samp>: you divorced the NPC, so they won't accept gifts from you.
+
</syntaxhighlight>
* <samp>RejectMovieTicket_DontWantToSeeThatMovie</samp>: the movie data marks that NPC as unwilling to watch it (e.g. kids for horror movies).
+
</li>
 +
<li>Delete your solution's hidden <samp>.vs</samp> folder, and every project's <samp>bin</samp> and <samp>obj</samp> folders.</li>
 +
<li>Reopen the solution in Visual Studio, click ''Build > Rebuild Solution'', and make sure it still loads into the game fine.</li>
 +
</ol>
   −
If the specific dialogue isn't set, the game will use the <samp>RejectMovieTicket</samp> dialogue (if set), else it'll default to generic dialogue for each case.
+
===Item ID changes===
 +
: ''See also: [[#Custom items|custom items in what's new]].''
 +
 
 +
The [[#Custom items|main <samp>Item</samp> properties have changed]]. To migrate existing code:
 +
<ul>
 +
<li>Don't use <samp>ParentSheetIndex</samp> to compare items. For example, <samp>item.ParentSheetIndex == 0</samp> will match both [[weeds]] and any custom item whose sprite is the first one in its custom spritesheet. You should compare items using [[#Custom items|their new <samp>ItemId</samp> and <samp>QualifiedItemId</samp> properties]] instead. For example, here's how to migrate various common forms:
 +
 
 +
{| class="wikitable"
 +
|-
 +
! old code
 +
! new code
 
|-
 
|-
| <samp>SpouseFarmhouseClutter</samp>
  −
| Shown by an NPC spouse when they couldn't pathfind to their kitchen standing spot in the farmhouse.
   
|-
 
|-
| <samp>SpouseGiftJealous</samp>
+
| <samp>item.ParentSheetIndex == 848</samp>
| Shown by an NPC spouse when you gave a gift to another eligible NPC of the same gender as your spouse (unless it's their birthday). You can use <samp>{0}</samp> in the dialogue for the other NPC's name, and <samp>{1}</samp> for the gifted item name.
+
| <samp>item.QualifiedItemId == "(O)848"</samp>
 
|-
 
|-
| <samp>Spouse_MonstersInHouse</samp>
+
| <samp>IsNormalObjectAtParentSheetIndex(item, 74)</samp>
| Shown by an NPC spouse when they're in the farmhouse and there's a monster close to them.
+
| <samp>item.QualifiedItemId == "(O)74"</samp>
 
|-
 
|-
| <samp>SpouseStardrop</samp>
+
| <samp>!item.bigCraftable && item.ParentSheetIndex == 128</samp>
| Shown when receiving the [[stardrop]] from your spouse.
+
| <samp>item.QualifiedItemId == "(O)128"</samp>
 
|-
 
|-
| <samp>Fair_Judging</samp>
+
| <samp>item is Boots && item.ParentSheetIndex == 505</samp>
| Shown at the [[Stardew Valley Fair]] while Lewis is judging the grange displays. If omitted, the NPC will keep their normal festival dialogue.
+
| <samp>item.QualifiedItemId == "(B)505"</samp>
 +
|}</li>
 +
<li>Don't assume item sprites are in the vanilla spritesheets. For example, instead of rendering <samp>Game1.objectSpriteSheet</samp> for an object, call <code>ItemRegistry.GetMetadata(item.QualifiedItemId).GetTexture()</code> to get its texture.</li>
 +
<li>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>. This is the same value for vanilla items. For example:
   −
If this is set without <samp>Fair_Judged*</samp>, the NPC will keep this dialogue after judging is done.
+
<syntaxhighlight lang="c#">
 +
new Object("634", 1);                      // vanilla item
 +
new Object("Example.ModId_Watermelon", 1); // custom item
 +
</syntaxhighlight>
   −
''This replaces the previously hardcoded translations in <samp>Strings/StringsFromCSFiles</samp>: <samp>Event.cs.1602</samp> (Marnie), <samp>Event.cs.1604</samp> (Pierre), and <samp>Event.cs.1606</samp> (Willy).''
+
You can also use the new <samp>ItemRegistry</samp> API to construct items from their <samp>QualifiedItemId</samp>:
|-
  −
| <samp>Fair_Judged_PlayerLost_PurpleShorts</samp><br /><samp>Fair_Judged_PlayerLost_Skipped</samp><br /><samp>Fair_Judged_PlayerLost</samp><br /><samp>Fair_Judged_PlayerWon</samp><br /><samp>Fair_Judged</samp>
  −
| Shown at the [[Stardew Valley Fair]] after Lewis finishes judging the grange displays.
     −
The first matching dialogue is used in this order:
+
<syntaxhighlight lang="c#">
# <samp>Fair_Judged_PlayerLost_PurpleShorts</samp>: the player put the [[Secrets#Lucky Purple Shorts|lucky purple shorts]] in their display (which is an automatic loss).  Defaults to <samp>Fair_Judged_PlayerLost</samp> if omitted.
+
Item item = ItemRegistry.Create("(B)505"); // Rubber Boots
# <samp>Fair_Judged_PlayerLost_Skipped</samp>: the player didn't put anything in their display. Defaults to <samp>Fair_Judged_PlayerLost</samp> if omitted.
+
</syntaxhighlight></li>
# <samp>Fair_Judged_PlayerLost</samp> or <samp>Fair_Judged_PlayerWon</samp>: the player didn't/did win first place. Defaults to <samp>Fair_Judged</samp> if omitted.
+
</ul>
# <samp>Fair_Judged</samp>: shown if a more specific dialogue didn't match. If omitted, the NPC will keep their current dialogue.
     −
''These replace the previously hardcoded translations in <samp>Strings/StringsFromCSFiles</samp>: <samp>Event.cs.1591</samp> (Pierre when he won), <samp>Event.cs.1593</samp> (Pierre when the player won), <samp>Event.cs.1595</samp> (Marnie), <samp>Event.cs.1597</samp> (Willy), and <samp>Event.cs.1600</samp> (Marnie for the purple shorts).''
+
===Other ID changes===
|-
+
Many other things in the game now have unique string IDs too (including [[#Buff overhaul|buffs]], [[#String event IDs|events]], and fruit trees). To migrate existing code:
| <samp>FlowerDance_Accept_Roommate</samp><br /><samp>FlowerDance_Accept_Spouse</samp><br /><samp>FlowerDance_Accept</samp>
  −
| Shown at the [[Flower Dance]] when the NPC agrees to dance. The game will prefer the <samp>_Roommate</samp> (if roommates) or <samp>_Spouse</samp> (if married) variant if applicable, else it'll check for the normal key. If omitted, defaults to a generic accept dialogue.
     −
''This replaces the previously hardcoded translations in <samp>Strings/StringsFromCSFiles</samp> (<samp>Event.cs.1613</samp>, <samp>Event.cs.1615</samp>, <samp>Event.cs.1617</samp>, <samp>Event.cs.1619</samp>, <samp>Event.cs.1621</samp>, <samp>Event.cs.1623</samp>, <samp>Event.cs.1625</samp>, <samp>Event.cs.1627</samp>, <samp>Event.cs.1629</samp>, and <samp>Event.cs.1631</samp>).''
+
* When referencing numeric IDs, you usually just need to convert them into a string (like <code>Game1.player.hasBuff("1590166")</code> or <code>Game1.player.eventsSeen.Contains("1590166")</code>).
 +
* When creating buffs, see [[#Buff overhaul|buff overhaul]] for how to create buffs now.
 +
* For pre-existing content pack data, see migration steps in the ''[[#Unique string IDs|unique string IDs]]'' section.
 +
 
 +
===Building and animal changes===
 +
: ''See also: [[#Build anywhere|build anywhere in what's new]].''
 +
 
 +
* Since all locations now allow buildings and animals, mod code which handles <samp>BuildableGameLocation</samp> and <samp>IAnimalLocation</samp> won't detect all buildable locations. You can replace them with <samp>location.IsBuildableLocation()</samp> (or just access <samp>location.buildings</samp> directly) and <samp>location.animals.Any()</samp> instead. Mods should no longer have any reference at all to <samp>BuildableGameLocation</samp> and <samp>IAnimalLocation</samp>.
 +
* Since buildings can be built anywhere, you can no longer assume a building is on the farm. You can check the new <samp>building.buildingLocation</samp> field instead.
 +
* You should review direct references to the farm (like <code>Game1.getFarm()</code> or <code>Game1.getLocationFromName("Farm")</code>) to see if it needs to be rewritten to allow other locations.
 +
* <code>Utility.numSilos()</code> should no longer be used to calculate available hay, since it doesn't account for custom buildings with hay storage. Use <code>Game1.getFarm().GetHayCapacity()</code> instead.
 +
* The <samp>Cat</samp> and <samp>Dog</samp> classes are now unused; all pets are now <samp>Pet</samp> directly.
 +
 
 +
===Player changes===
 +
: ''See also: [[#Buff overhaul|buff overhaul in what's new]].''
 +
 
 +
<ul>
 +
<li>Several <samp>Game1.player</samp> / <samp>Farmer</samp> fields changed as part of the [[#Buff overhaul|buff overhaul]]:
 +
{| class="wikitable"
 
|-
 
|-
| <samp>FlowerDance_Decline</samp>
+
! old field
| Shown at the [[Flower Dance]] when the NPC declines to dance. This replaces the former <samp>danceRejection</samp> key (which still works as a fallback).
+
! how to migrate
 +
|-
 +
| <samp>appliedBuffs</samp><br /><samp>appliedSpecialBuffs</samp>
 +
| Use <code>Game1.player.hasBuff(id)</code> instead.
 
|-
 
|-
| <samp>WinterStar_GiveGift_Before_Roommate</samp><br /><samp>WinterStar_GiveGift_Before_Spouse</samp><br /><samp>WinterStar_GiveGift_Before</samp><br /><samp>WinterStar_GiveGift_After_Roommate</samp><br /><samp>WinterStar_GiveGift_After_Spouse</samp><br /><samp>WinterStar_GiveGift_After</samp>
+
| <samp>attack</samp><br /><samp>immunity</samp>
| Shown at the [[Feast of the Winter Star]] when the NPC gives the player their gift (before and after the player opens it). The game will prefer the <samp>_Roommate</samp> (if roommates) or <samp>_Spouse</samp> (if married) variant if applicable, else it'll check for the normal key. If omitted, the before/after dialogues each separately default to a generic translation for all NPCs.
+
| Use <samp>Attack</samp> and <samp>Immunity</samp> instead.
 
|-
 
|-
| <samp>WinterStar_ReceiveGift_{{t|id}}</samp><br /><samp>WinterStar_ReceiveGift_{{t|tag}}</samp><br /><samp>WinterStar_ReceiveGift</samp>
+
| <samp>addedCombatLevel</samp><br /><samp>addedFarmingLevel</samp><br /><samp>addedFishingLevel</samp><br /><samp>addedForagingLevel</samp><br /><samp>addedLuckLevel</samp><br /><samp>addedMiningLevel</samp><br /><samp>attackIncreaseModifier</samp><br /><samp>critChanceModifier</samp><br /><samp>critPowerModifier</samp><br /><samp>knockbackModifier</samp><br /><samp>weaponPrecisionModifier</samp><br /><samp>weaponSpeedModifier</samp>
| Shown at the [[Feast of the Winter Star]] when receiving their gift from the player. This can be by item ID (like <samp>WinterStar_ReceiveGift_(O)128</samp>), context tag (like <samp>WinterStar_ReceiveGift_category_fish</samp>), or for any item (like <samp>WinterStar_ReceiveGift</samp>). If omitted, defaults to the generic translation for all NPCs.
+
| Use equivalent properties under <samp>Game1.player.buffs</samp> instead (e.g. <samp>Game1.player.buffs.CombatLevel</code>).
 
|-
 
|-
| <samp>WipedMemory</samp>
+
| <samp>resilience</samp>
| Shown the first time you talk to the NPC after erasing their memory using the [[Dark Shrine of Memory]].
+
| Use <samp>buffs.Defense</samp> instead.
|}
  −
</li>
  −
<li>Added new [[Modding:Dialogue|dialogue]] commands:
  −
{| class="wikitable"
   
|-
 
|-
! command
+
| <samp>addedSpeed</samp><br /><samp>CombatLevel</samp><br /><samp>CraftingTime</samp><br /><samp>FarmingLevel</samp><br /><samp>FishingLevel</samp><br /><samp>ForagingLevel</samp><br /><samp>LuckLevel</samp><br /><samp>MagneticRadius</samp><br /><samp>MaxStamina</samp><br /><samp>MiningLevel</samp><br /><samp>Stamina</samp>
! description
+
| These are now readonly and can't be set directly. You can change them by [[#Buff overhaul|adding a buff]] (which can be invisible), equipment bonus, etc instead.
|- id="gender-switch"
+
|}</li>
| <samp>${male^female}$</samp><br /><samp>${male^female^non-binary}$</samp>
+
<li>Buffs are now recalculated automatically, and you can reset a buff by just reapplying it. See [[#Buff overhaul|buff overhaul]] for more info.</li>
| Change text depending on the player's gender. This largely supersedes the <samp>^</samp> dialogue token (which still works), and is supported in many more places than that token. This is applied before most other commands or parsing, so it can safely be used in cases where <samp>^</samp> might have a different meaning (e.g. mail text). For example: <code>Ahoy there ${lad^lass}$!</code> or <code>Ahoy there ${lad^lass^matey}$!</code>.
+
<li>Buff logic has been centralized into <samp>Game1.player.buffs</samp>. This replaces a number of former fields/methods like <samp>Game1.buffsDisplay</samp>.</li>
 +
</ul>
   −
You can optionally use <samp>¦</samp> instead of <samp>^</samp>, in which case any <samp>^</samp> characters are left as-is.
+
===Collision changes===
 +
The game's tile collision logic has been overhauled and merged into a simpler set of methods on <samp>GameLocation</samp> instances:
   −
Note that the non-binary value is only used if a mod overrides the player's gender, since the in-game UI only allows male or female.
+
{| class="wikitable"
 
|-
 
|-
| <samp>$action {{t|action}}</samp>
+
! method
| Run a [[Modding:Trigger actions|trigger action string]], like <samp>$action AddMoney 500</samp> to add {{price|500}} to the current player.
+
! effect
 
|-
 
|-
| <samp>$query {{t|query}}#{{t|if true}}&#124;{{t|if false}}</samp>
+
| <samp>CanSpawnCharacterHere</samp>
| Show different dialogue text depending on the [[Modding:Game state queries|game state query]] in {{t|query}}. For example:
+
| Get whether NPCs can be placed on the given tile (e.g. it's within the map bounds and tile is walkable), there's no placed object there, and the <samp>NoFurniture</samp> [[Modding:Maps|tile property]] isn't set.
<syntaxhighlight lang="js">
+
|-
"Mon": "$query !PLAYER_VISITED_LOCATION Current Mine#Did you know there's an old abandoned mine up in the mountain? Apparently it's crawling with monsters!|I heard you went into the old mines up in the mountain!#Did you find anything tasty?$h"
+
| <samp>CanItemBePlacedHere</samp>
</syntaxhighlight>
+
| Get whether items can be placed on the given tile in non-floating form (e.g. it's within the map bounds and not blocked by a non-walkable item), and the <samp>NoFurniture</samp> [[Modding:Maps|tile property]] isn't set.
 +
|-
 +
| <samp>isBuildable</samp>
 +
| Get whether buildings can be placed on the given tile.
 +
|-
 +
| <samp>IsTilePassable</samp>
 +
| Get whether the tile can be walked on (ignoring collisions with in-game objects, NPCs, etc).
 +
|-
 +
| <samp>IsTileOccupiedBy</samp>
 +
| Get whether the tile contains a player, object, NPC/monster/pet/etc, terrain feature, building, etc. You can choose which entities to check, and which ones to ignore if they don't block movement.
 
|-
 
|-
| <samp>$t {{t|topic ID}} {{o|day length}}</samp>
+
| <samp>IsTileBlockedBy</samp>
| Add a [[Modding:Dialogue#Conversation topics|conversation topic]] for the next {{o|day length}} days (default 4 days).
+
| Equivalent to calling both <samp>IsTilePassable</samp> and <samp>IsTileOccupiedBy</samp>.
 
|-
 
|-
| <samp>$v {{t|event id}} {{o|check preconditions}} {{o|skip if seen}}</samp>
+
| <samp>IsLocationSpecificOccupantOnTile</samp><br /><samp>IsLocationSpecificPlacementRestriction</samp>
| Immediately start an [[Modding:Event data|event]] and end the current dialogue, subject to the conditions:
+
| Generally shouldn't be used directly. Checks for location-specific collisions (e.g. ladders in [[The Mines|the mines]] or parrot platforms on [[Ginger Island]]).
* {{o|check preconditions}}: whether to ignore the command if the [[Modding:Event data#Event preconditions|event's preconditions]] don't match (one of <samp>true</samp> or <samp>false</samp>). Default true.
+
|}
* {{o|skip if seen}}: whether to ignore the command if the player has already seen the given event. Default true.
     −
If the event is skipped, the dialogue continues to the next line instead.
+
===Other breaking API changes===
 +
''(This section is meant as a quick reference if you have build errors; there's no need to read through it otherwise.)''
   −
For example, <code>$v 60367 false false</code> will replay the bus arrival event from the start of the game.
+
====Removed unused code====
|}
+
1.6 removes a lot of unused code. That includes these classes:
</li>
  −
<li>Improved dialogue commands:
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! command
+
! namespace
! changes
+
! class name
 +
|-
 +
| <samp>StardewValley</samp>
 +
| &#32;
 +
* <samp>BuildingUpgrade</samp>
 +
* <samp>DisposableList</samp>
 +
* <samp>FurniturePlacer</samp>
 +
* <samp>ListPool</samp>
 +
* <samp>OneTimeRandom</samp>
 
|-
 
|-
| <samp>$p</samp>
+
| <samp>StardewValley.Characters</samp>
| You can now check multiple answer IDs. For example, this will show the first dialogue if the player chose dialogue answer 17, 18, or 19:
+
| &#32;
<pre>$p 17|18|19#I guess you think nothing would happen, right?$u|Maybe a wicked ghost would appear!</pre>
+
* <samp>BotchedNetBool</samp>
|}</li>
+
* <samp>BotchedNetField</samp>
<li>[[Modding:Dialogue#Response IDs|Dialogue response IDs]] are now [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string IDs]].</li>
+
* <samp>BotchedNetInt</samp>
<li>[[Secrets#Item Spawn Cheat|Item spawn codes]] now use string item IDs. That means you can spawn any item using its [[#Custom items|qualified item ID]] (like <code>[(F)1664]</code> for a [[Mystic Rug]]), but can no longer prepend zeros (e.g. <code>[128]</code> is a pufferfish but <code>[0128]</code> is an error item).</li>
+
* <samp>BotchedNetLong</samp>
<li>For C# mods, <samp>Dialogue</samp> now tracks the translation key used to build it (when applicable). For example, you can detect when the player is rejected at the [[Flower Dance]] (derived from {{github|spacechase0/StardewValleyMods|Three-Heart Dance Partner}}):
+
|-
<syntaxhighlight lang="c#">
+
| <samp>StardewValley.Menus</samp>
private void OnMenuChanged(object sender, MenuChangedEventArgs e)
+
| &#32;
{
+
* <samp>FarmInfoPage</samp>
    bool isDanceRejection =
+
* <samp>MiniatureTerrainFeature</samp><!-- not a typo, it really was in StardewValley.Menus -->
        Game1.currentLocation?.currentEvent?.FestivalName == "Flower Dance"
+
|-
        && e.NewMenu is DialogueBox dialogueBox
+
| <samp>StardewValley.Monsters</samp>
        && dialogueBox.characterDialogue is {} dialogue
+
| &#32;
        && dialogue.TranslationKey == $"Characters\\Dialogue\\{dialogue.speaker?.Name}:danceRejection";
+
* <samp>LavaCrab</samp>
}
+
|-
</syntaxhighlight>
+
| <samp>StardewValley.Objects</samp>
 +
| &#32;
 +
* <samp>ObjectFactory</samp> (replaced by [[#Custom items|<samp>ItemRegistry</samp>]])
 +
|-
 +
| <samp>StardewValley.TerrainFeatures</samp>
 +
| &#32;
 +
* <samp>Quartz</samp>
 +
|-
 +
| <samp>StardewValley.Tools</samp>
 +
| &#32;
 +
* <samp>Blueprints</samp>
 +
* <samp>ToolFactory</samp> (replaced by [[#Custom items|<samp>ItemRegistry</samp>]])
 +
|}
   −
For C# mods that create <samp>Dialogue</samp> instances directly, there's a few ways to do it now:
+
And these class members:
<syntaxhighlight lang="c#">
+
{| class="wikitable"
// from a translation key
+
|-
var dialogue = new Dialogue(npc, "Strings\\StringsFromCSFiles:Utility.cs.5360");
+
! type
 
+
! members
// from custom text (with or without a translation key)
+
|-
var dialogue = new Dialogue(npc, null, "Some arbitrary text to show as-is");
+
| <samp>Axe</samp>
 
+
| &#32;
// from a translation with tokens
+
* <samp>StumpStrength</samp>
var dialogue = Dialogue.FromTranslation(npc, "Data\\ExtraDialogue:PurchasedItem_2_QualityLow_Willy", whatToCallPlayer, particle, i.DisplayName);
+
|-
</syntaxhighlight>
+
| <samp>Bush</samp>
 
+
| &#32;
You can also easily add fallback logic using <samp>Dialogue.TryGetDialogue</samp> or <samp>npc.TryGetDialogue</samp>. For example:
+
* <samp>alpha</samp>
<syntaxhighlight lang="c#">
+
* <samp>lastPlayerToHit</samp>
Dialogue dialogue =
  −
    npc.TryGetDialogue($"rejection_{itemId}_{locationName}_{x}_{y}")
  −
    ?? npc.TryGetDialogue($"rejection_{itemId}_{locationName}")
  −
    ?? npc.TryGetDialogue($"rejection_{itemId}")
  −
    ?? new Dialogue(npc, "Strings\\StringsFromCSFiles:NPC.cs.3971");
  −
</syntaxhighlight>
  −
</li>
  −
<li>For C# mods, added a <samp>dialogue.sideEffects</samp> field to run code when the dialogue is displayed.</li>
  −
<li>The 'reveal taste' dialogue command now uses the format <samp>%revealtaste:{{t|npc name}}:{{t|item ID}}</samp> to support item IDs. (The previous <samp>%revealtaste{{t|npc name}}{{t|item index}}</samp> format still works to support old content packs, but the item index can only be a number.)</li>
  −
<li>NPCs no longer override the portrait for a gift taste dialogue that uses a portrait command explicitly.</li>
  −
<li>Fixed unknown [[Modding:Dialogue|dialogue]] commands starting with <samp>$</samp> being parsed as a portrait number when not numeric.</li>
  −
<li>Fixed NPCs only using a <code>{day name}{hearts}_{year}</code> dialogue if they also have a <code>{day name}{hearts}</code> one.</li>
  −
<li>Fixed NPCs only using the <code>MovieInvitation</code> dialogue key in English.</li>
  −
</ul>
  −
 
  −
===Schedule changes===
  −
<ul>
  −
<li>Schedule keys are now case-insensitive.</li>
  −
<li>Added a new <samp>{{t|day of week}}_{{t|min hearts}}</samp> schedule key.</li>
  −
<li>Added an <samp>NPC.ScheduleKey</samp> field which always matches their loaded schedule.</li>
  −
<li>Schedule commands now trim surrounding whitespace, so they can be multilined for readability. For example:
  −
<syntaxhighlight lang="js">"Wed": "
  −
    1000 ArchaeologyHouse 11 9 0/
  −
    1800 Town 47 87 0/
  −
    2200 SeedShop 1 9 3 abigail_sleep
  −
"</syntaxHighlight></li>
  −
<li>Removed an unintended schedule fallback to a <samp>{season}_spring_{hearts}</samp> key. It'll skip to the <samp>spring</samp> default instead.</li>
  −
<li>Schedules are now fault-tolerant:
  −
* Fixed crash if a selected schedule can't be parsed. The NPC now logs an error and continues with the next fallback instead.
  −
* Fixed crash if certain hardcoded schedules aren't present (like Penny's <samp>marriageJob</samp> or Pam's <samp>bus</samp>).
  −
* Fixed error if a schedule command is empty.</li>
  −
<li>For C# mods, removed the <samp>dayOfMonth</samp> parameter in <samp>NPC.getSchedule()</samp>. This was misleading since it used <samp>Game1.dayOfMonth</samp> in all but one line regardless.</li>
  −
</ul>
  −
 
  −
===Other NPC changes===
  −
<ul>
  −
<li>Added <samp>Game1.characterData</samp> and <samp>Game1.farmAnimalData</samp> to read NPC/animal info without constantly reloading the <samp>Data/Characters</samp> or <samp>Data/FarmAnimals</samp> asset.</li>
  −
<li>All translated NPC names are now in <samp>Strings/NPCNames</samp>.
  −
<li>Added new fields & methods for C# mods:
  −
 
  −
{| class="wikitable"
   
|-
 
|-
! type
+
| <samp>Chest</samp>
! field/method
+
| &#32;
! effect
+
* <samp>chestType</samp>
 +
* <samp>coins</samp>
 +
|-
 +
| <samp>CosmeticPlant</samp>
 +
| &#32;
 +
* <samp>scale</samp>
 
|-
 
|-
|rowspan="2"| <samp>AdventureGuild</samp>
+
| <samp>CraftingRecipe</samp>
| <samp>IsComplete(data)</samp>
+
| &#32;
| Get whether an [[Adventurer's Guild]] monster eradication goal has been completed, regardless of whether the player collected its rewards yet.
+
* <samp>itemType</samp>
 
|-
 
|-
| <samp>HasCollectedReward(player, id)</samp>
+
| <samp>Critter</samp>
| Get whether a given player has completed an [[Adventurer's Guild]] monster eradication goal and collected its rewards. For example:
+
| &#32;
<syntaxhighlight lang="c#">
+
* <samp>InitShared()</samp>
bool isPhoneUnlocked = AdventureGuild.HasCollectedReward(Game1.player, "Gil_FlameSpirits");
  −
</syntaxhighlight>
   
|-
 
|-
| <samp>AnimalHouse</samp>
+
| <samp>Crop</samp>
| <samp>adoptAnimal</samp>
+
| &#32;
| Add an animal to this location and set the location as the animal's home.
+
* <samp>daysOfUnclutteredGrowth</samp>
 
|-
 
|-
| <samp>AnimatedSprite</samp>
+
| <samp>Dialogue</samp>
| <samp>Owner</samp>
+
| &#32;
| The NPC which owns the sprite.
+
* <samp>dialogueToBeKilled</samp>
 
|-
 
|-
| <samp>Character</samp>
+
| <samp>Farm</samp>
| <samp>GetGender</samp>
+
| &#32;
| Get the character's gender as one of the numeric constants (<samp>NPC.female</samp>, <samp>NPC.male</samp>, or <samp>NPC.undefined</samp>). This returns the specific gender for players, villager NPCs, and children; other NPCs (like monsters) return <samp>NPC.undefined</samp>.
+
* <samp>GetSpouseOutdoorAreaSpritesheetIndex()</samp>
 
|-
 
|-
|rowspan="7"| <samp>FarmAnimal</samp>
+
| <samp>FarmAnimal</samp>
| <samp>isAdult</samp>
+
| &#32;
| Get whether the farm animal is fully grown (opposite of <samp>isBaby()</samp>).
+
* <samp>homeLocation</samp>
 
|-
 
|-
| <samp>CanGetProduceWithTool</samp>
+
| <samp>Farmer</samp>
| Get whether the farm animal's produce can be collected with a given tool (e.g. milk pail for a cow).
+
| &#32;
 +
* <samp>barnUpgradeLevel</samp> and <samp>BarnUpgradeLevel</samp>
 +
* <samp>blueprints</samp>
 +
* <samp>coalPieces</samp> and <samp>CoalPieces</samp>
 +
* <samp>coopUpgradeLevel</samp> and <samp>CoopUpgradeLevel</samp>
 +
* <samp>copperPieces</samp> and <samp>CopperPieces</samp>
 +
* <samp>eyeColor</samp>
 +
* <samp>feed</samp> and <samp>Feed</samp>
 +
* <samp>furnitureOwned</samp>
 +
* <samp>goldPieces</samp> and <samp>GoldPieces</samp>
 +
* <samp>hasBusTicket</samp>
 +
* <samp>hasGreenhouse</samp>
 +
* <samp>iridiumPieces</samp> and <samp>IridiumPieces</samp>
 +
* <samp>ironPieces</samp> and <samp>IronPieces</samp>
 +
* <samp>newSkillPointsToSpend</samp>
 +
* <samp>overallsColor</samp>
 +
* <samp>ownsFurniture</samp>
 +
* <samp>quartzPieces</samp> and <samp>QuartzPieces</samp>
 +
* <samp>shirtColor</samp>
 +
* <samp>skinColor</samp>
 +
* <samp>stonePieces</samp> and <samp>StonePieces</samp>
 +
* <samp>theaterBuildDate</samp>
 +
* <samp>woodPieces</samp> and <samp>WoodPieces</samp>
 
|-
 
|-
| <samp>CanLiveIn</samp>
+
| <samp>Game1</samp>
| Get whether the animal can be added to a building.
+
| &#32;
 +
* <samp>boardingBus</samp>
 +
* <samp>chanceToRainTomorrow</samp>
 +
* <samp>checkForNewLevelPerks</samp>
 +
* <samp>cloud</samp>
 +
* <samp>coopDwellerBorn<samp>
 +
* <samp>cropsOfTheWeek</samp>
 +
* <samp>currentBarnTexture</samp>
 +
* <samp>currentBillboard</samp>
 +
* <samp>currentCoopTexture</samp>
 +
* <samp>currentFloor</samp>
 +
* <samp>currentHouseTexture</samp>
 +
* <samp>currentWallpaper</samp>
 +
* <samp>dealerCalicoJackTotal</samp>
 +
* <samp>FarmerFloor</samp>
 +
* <samp>farmerWallpaper</samp>
 +
* <samp>fertilizer</samp>
 +
* <samp>floorPrice</samp>
 +
* <samp>greenhouseTexture</samp>
 +
* <samp>inMine<samp>
 +
* <samp>jukeboxPlaying</samp>
 +
* <samp>keyHelpString</samp>
 +
* <samp>listeningForKeyControlDefinitions<samp>
 +
* <samp>littleEffect</samp>
 +
* <samp>logoScreenTexture</samp>
 +
* <samp>mailboxTexture</samp>
 +
* <samp>menuChoice</samp>
 +
* <samp>menuUp<samp>
 +
* <samp>nameSelectUp<samp>
 +
* <samp>nameSelectType</samp>
 +
* <samp>numberOfSelectedItems</samp>
 +
* <samp>particleRaining<samp>
 +
* <samp>pickingTool</samp>
 +
* <samp>pickToolDelay</samp>
 +
* <samp>pickToolInterval</samp>
 +
* <samp>priceOfSelectedItem</samp>
 +
* <samp>progressBar</samp>
 +
* <samp>removeSquareDebrisFromTile(…)</samp>
 +
* <samp>selectedItemsType</samp>
 +
* <samp>shiny</samp>
 +
* <samp>shippingTax</samp>
 +
* <samp>showKeyHelp<samp>
 +
* <samp>slotResult</samp>
 +
* <samp>startedJukeboxMusic</samp>
 +
* <samp>tinyFontBorder</samp>
 +
* <samp>toolHeld</samp>
 +
* <samp>toolIconBox</samp>
 +
* <samp>tvStation</samp>
 +
* <samp>tvStationTexture</samp>
 +
* <samp>wallpaperPrice</samp>
 
|-
 
|-
| <samp>GetDisplayName</samp><br /><samp>GetShopDescription</samp>
+
| <samp>GameLocation</samp>
| Get the translated display name or shop description for this animal.
+
| &#32;
 +
* <samp>boardBus(…)</samp>
 +
* <samp>checkForMapChanges()</samp>
 +
* <samp>getWallDecorItem(…)</samp>
 +
* <samp>removeBatch(…)</samp>
 +
* <samp>removeDirt(…)</samp>
 +
* <samp>removeStumpOrBoulder(…)</samp>
 +
* <samp>tryToBuyNewBackpack()</samp>
 
|-
 
|-
| <samp>GetHarvestType</samp>
+
| <samp>GiantCrop</samp>
| Get whether the animal's produce is dropped or collected with a tool.
+
| &#32;
 +
* <samp>forSale</samp>
 
|-
 
|-
| <samp>growFully</samp>
+
| <samp>IClickableMenu</samp>
| Instantly age the animal to adulthood if it's still a baby.
+
| &#32;
 +
* <samp>currentRegion</samp>
 
|-
 
|-
| <samp>ReloadTextureIfNeeded</samp>
+
| <samp>MeleeWeapon</samp>
| Update the animal sprite based on the current state + data.
+
| &#32;
|-
+
* <samp>attackSwordCooldownTime</samp>
| rowspan="2"| <samp>Farmer</samp>
+
* <samp>doStabbingSwordFunction()</samp>
| <samp>GetDisplayPants</samp><br /><samp>GetDisplayShirt</samp>
  −
| Get the texture and sprite index to draw for the player's pants or shirt. This accounts for override clothing, worn clothing, and the default clothing drawn when the farmer isn't wearing anything.
  −
 
  −
For example:
  −
<syntaxhighlight lang="c#">
  −
Game1.player.GetDisplayShirt(out Texture2D texture, out int spriteIndex);
  −
</syntaxhighlight>
  −
|-
  −
| <samp>CanDyePants</samp><br /><samp>CanDyeShirt</samp>
  −
| Get whether the currently equipped pants or shirt can be [[Dyeing|dyed]].
   
|-
 
|-
 
| <samp>Monster</samp>
 
| <samp>Monster</samp>
| <samp>GetDisplayName(name)</samp>
+
| &#32;
| Get the translated display name for a monster type.
+
* <samp>doHorizontalMovement()</samp>
 +
* <samp>durationOfRandomMovements</samp>
 +
* <samp>coinsToDrop</samp>
 
|-
 
|-
|rowspan="4"| <samp>NPC</samp>
+
| <samp>NPC</samp>
| <samp>CanReceiveGifts</samp>
+
| &#32;
| Get whether this NPC can receive gifts from the player (regardless of whether they've already received one today).
+
* <samp>idForClones</samp>
 
|-
 
|-
| <samp>GetData</samp><br /><samp>NPC.TryGetData</samp>
+
| <samp>Object</samp>
| Get the underlying data from <samp>Data/Characters</samp> for this NPC, if any.
+
| &#32;
 +
* <samp>attachToSprinklerAttachment(…)</samp>
 +
* <samp>canBePlacedInWater()</samp>
 +
* <samp>consumeRecipe(…)</samp>
 +
* <samp>copperBar</samp>
 +
* <samp>goldBar</samp>
 +
* <samp>iridiumBar</samp>
 +
* <samp>ironBar</samp>
 +
* <samp>isHoeDirt</samp> and <samp>IsHoeDirt</samp>
 
|-
 
|-
| <samp>NPC.GetDisplayName(name)</samp>
+
| <samp>PathFindController</samp>
| Get the translated display name in the current language for an NPC by their internal name.
+
| &#32;
 +
* <samp>CheckClearance()</samp>
 +
* <samp>limit</samp>
 +
|-
 +
| <samp>SaveGame</samp>
 +
| &#32;
 +
* <samp>cropsOfTheWeek</samp>
 +
* <samp>currentFloor</samp>
 +
* <samp>currentWallpaper</samp>
 +
* <samp>FarmerFloor</samp>
 +
* <samp>farmerWallpaper</samp>
 +
* <samp>shippingTax</samp>
 
|-
 
|-
| <samp>hasDarkSkin</samp>
+
| <samp>Spiker</samp>
| Whether this character has dark skin for the purposes of child genetics.
+
| &#32;
 +
* <samp>GetSpawnPosition</samp>
 
|-
 
|-
| <samp>Pet</samp>
+
| <samp>Stats</samp>
| <samp>GetPetData</samp><br /><samp>TryGetData</samp>
+
| &#32;
| Get the underlying data from <samp>Data/Pets</samp> for this pet, if any.
+
* <samp>barsSmelted</samp> and <samp>BarsSmelted</samp>
 +
* <samp>coalFound</samp> and <samp>CoalFound</samp>
 +
* <samp>coinsFound</samp> and <samp>coinsFound</samp>
 +
* <samp>starLevelCropsShipped</samp> and <samp>starLevelCropsShipped</samp>
 
|-
 
|-
| <samp>ShopMenu</samp>
+
| <samp>Tool</samp>
| <samp>ShopId</samp>
+
| &#32;
| A key which identifies the current shop. This may be the unique shop ID in <samp>Data/Shops</samp> for a standard shop, <samp>Dresser</samp> or <samp>FishTank</samp> for furniture, etc. This is guaranteed to be set to a relevant shop ID.
+
* <samp>batteredSwordSpriteIndex</samp>
 
+
* <samp>copperColor</samp>
This replaces the former <samp>shopContext</samp> field, and will usually have the same value in cases where that was set to a unique shop ID.
+
* <samp>GetSecondaryEnchantmentCount()</samp>
 +
* <samp>goldColor</samp>
 +
* <samp>iridiumColor</samp>
 +
* <samp>nonUpgradeable</samp>
 +
* <samp>parsnipSpriteIndex</samp>
 +
* <samp>Stackable</samp>
 +
* <samp>startOfNegativeWeaponIndex</samp>
 +
* <samp>steelColor</samp>
 
|-
 
|-
 
| <samp>Utility</samp>
 
| <samp>Utility</samp>
| <samp>getAllVillagers</samp>
+
| &#32;
| Get all villager NPCs (excluding horses, pets, monsters, player children, etc). This works just like <samp>getAllCharacters</samp> with an added filter.
+
* <samp>buyFloor()</samp>
 +
* <samp>buyWallpaper()</samp>
 +
* <samp>cropsOfTheWeek()</samp>
 +
* <samp>facePlayerEndBehavior(…)</samp>
 +
* <samp>getRandomSlotCharacter()</samp>
 +
* <samp>plantCrops(…)</samp>
 +
* <samp>showLanternBar()</samp>
 
|}
 
|}
</li>
+
 
<li>NPCs now update on save loaded when their home data changes.</li>
+
====Renamed classes====
<li><samp>NPC.reloadSprite()</samp> now has an argument to only reload the appearance, without changing other data.</li>
+
These classes were renamed in 1.6:
<li><samp>Utility.getAllCharacters()</samp> now returns a plain <samp>List&lt;NPC&gt;</samp> value instead of a custom <samp>DisposableList&lt;NPC&gt;</samp>, so you can use normal LINQ querying on it.</li>
  −
<li><samp>Utility.GetHorseWarpRestrictionsForFarmer(player)</samp> now returns an enum (which is more efficient and easier for mods to patch), and added a new <samp>Utility.GetHorseWarpErrorMessage(restrictions)</samp> method to get the error message to show for it.</li>
  −
<li><samp>Farmer.hasAFriendWithHeartLevel</samp> now has an optional max-hearts argument.</li>
  −
<li>Removed most <samp>FarmAnimal</samp> fields/properties which just mirror the underlying data.</li>
  −
<li>Removed invalid item IDs in <samp>Data/NPCGiftTastes</samp>.</li>
  −
<li>Fixed NPCs sometimes duplicated on save load (particularly if their home location changed).</li>
  −
<li>Fixed child NPCs like [[Jas]] or [[Vincent]] ignoring relative titles like "mom" in <samp>Data/NPCDispositions</samp> (now <samp>Data/Characters</samp>) for reveal-gift-taste dialogues.</li>
  −
<li>Fixed custom NPCs ignoring dialogue when they use a subclass of <samp>NPC</samp>.</li>
  −
<li>Fixed monsters not loading their display name from <samp>Data/Monsters</samp> for English players.</li>
  −
<li>Fixed player children not applying the <samp>IsInvisible</samp> flag.</li>
  −
</ul>
  −
 
  −
==What's new for everything else==
  −
===Buff overhaul===
  −
: ''See also: [[#Custom buffs|custom buffs]].''
  −
 
  −
1.6 rewrites buffs to work more consistently and be more extensible:
  −
 
  −
* Buff logic is unified into <samp>Game1.player.buffs</samp>, which is the single source of truth for buff data. This replaces the previous <samp>player.added*</samp> and <samp>player.appliedBuffs</samp> fields, <samp>BuffsDisplay</samp> logic, enchantment stat bonuses, and boots/ring attribute changes on (un)equip.
  −
* This also removes limitations on buff types (e.g. buffs can add weapon bonuses and weapons can add attribute buffs) and buffable equipment (e.g. equipped tools can have buffs too).
  −
* Buff effects are now fully recalculated when they change, to fix a range of longstanding bugs like attribute drift and double-debuffs. Just like before, the buffs are managed locally; only the buff IDs and aggregate attribute effects are synced.
  −
 
  −
'''For C# mods:'''
  −
* Each buff now has a unique string ID. You can apply a new buff with the same ID to replace it (so you no longer need to manually find and remove previous instances of the buff).
  −
* The buff duration can now be set to <samp>Buff.ENDLESS</samp> to remove the duration. It'll last all day until the player sleeps.
  −
* You can add standard buff effects to any equipment by overriding <samp>Item.AddEquipmentEffects</samp>, or add custom behaviour/buffs by overriding <samp>Item.onEquip</samp> and <samp>Item.onUnequip</samp>.
  −
* You can add custom food or drink buffs by overriding <samp>Item.GetFoodOrDrinkBuffs()</samp>.
  −
* The <samp>Buff</samp> constructor now supports a custom icon texture, sprite index, display name, description, and millisecond duration to fully support custom buffs.
  −
* You can change how buff attributes are displayed (or add new attributes) by extending the <samp>BuffsDisplay.displayAttributes</samp> list.
  −
 
  −
For example, here's how to add a custom buff which adds +3 speed:
  −
 
  −
<syntaxhighlight lang="c#">
  −
Buff buff = new Buff(
  −
    id: "Example.ModId/ZoomZoom",
  −
    displayName: "Zoom Zoom", // can optionally specify description text too
  −
    iconTexture: this.Helper.ModContent.Load<Texture2D>("assets/zoom.png"),
  −
    iconSheetIndex: 0,
  −
    duration: 30_000, // 30 seconds
  −
    effects: new BuffEffects()
  −
    {
  −
        Speed = { 10 } // shortcut for buff.Speed.Value = 10
  −
    }
  −
);
  −
Game1.player.applyBuff(buff);
  −
</syntaxhighlight>
  −
 
  −
You can also implement your own custom effects in code by checking if the buff is active, like <code>Game1.player.hasBuff("Example.ModId/ZoomZoom")</code>.
  −
 
  −
===Custom audio===
  −
You can now add or edit [[Modding:Audio|music tracks or sound effects]] (called ''cues'') by editing the <samp>Data/AudioChanges</samp> asset. New cues are added to the game's soundbank, so they can be used anywhere normal audio can be used (e.g. the <samp>Music</samp> [[Modding:Maps|map property]]).
  −
 
  −
====Format====
  −
The <samp>Data/AudioChanges</samp> asset consists of a string → model lookup, where the key matches the <samp>ID</samp>, and the value is a model with the fields below.
  −
 
  −
Entries in this asset describe an '''override''' applied to the soundbank. The override is applied permanently for the current game session, even if the asset is edited to remove it. Overriding a cue will reset all values to the ones specified.
  −
 
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! field
+
! old name
! effect
+
! new name
 
|-
 
|-
| <samp>ID</samp>
+
| <samp>Game1.MusicContext</samp>
| The [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for the audio cue, used when playing the sound in-game.
+
| <samp>MusicContext</samp> (in <samp>StardewValley.GameData</samp>)
 
|-
 
|-
| <samp>FilePaths</samp>
+
| <samp>LocationContext</samp>
| A list of absolute file paths (not asset names) from which to load the audio. Each file can be <samp>.ogg</samp> or <samp>.wav</samp>. If you list multiple paths, a random one will be chosen each time it's played.
+
| <samp>LocationContexts</samp>
 
|-
 
|-
| <samp>Category</samp>
+
| <samp>SpecialOrder.QuestStatus</samp>
| The [[Modding:Audio#Category list|audio category]], which determines which volume slider in the game options applies. This should be one of <samp>Default</samp>, <samp>Music</samp>, <samp>Sound</samp>, <samp>Ambient</samp>, or <samp>Footsteps</samp> (see [[Modding:Audio#Category list|a description of each category]]). Defaults to <samp>Default</samp>.
+
| <samp>SpecialOrderStatus</samp> (in <samp>StardewValley.SpecialOrders</samp>)
|-
+
|}
| <samp>StreamedVorbis</samp>
  −
| Whether the audio should be streamed from disk when it's played, instead of being loaded into memory ahead of time. This is only possible for [[wikipedia:Vorbis|Ogg Vorbis]] (<samp>.ogg</samp>) files, which otherwise will be decompressed in-memory on load. Default false.
     −
This is a tradeoff between memory usage and performance, so you should consider which value is best for each audio cue:
+
And these were moved to a different namespace:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! value
+
! type
! effect
+
! old namespace
 +
! new namespace
 +
|-
 +
| <samp>AmethystEnchantment</samp><br /><samp>AquamarineEnchantment</samp><br /><samp>ArchaeologistEnchantment</samp><br /><samp>ArtfulEnchantment</samp><br /><samp>AutoHookEnchantment</samp><br /><samp>AxeEnchantment</samp><br /><samp>BaseEnchantment</samp><br /><samp>BaseWeaponEnchantment</samp><br /><samp>BottomlessEnchantment</samp><br /><samp>BugKillerEnchantment</samp><br /><samp>CrusaderEnchantment</samp><br /><samp>DiamondEnchantment</samp><br /><samp>EfficientToolEnchantment</samp><br /><samp>EmeraldEnchantment</samp><br /><samp>FishingRodEnchantment</samp><br /><samp>GalaxySoulEnchantment</samp><br /><samp>GenerousEnchantment</samp><br /><samp>HaymakerEnchantment</samp><br /><samp>HoeEnchantment</samp><br /><samp>JadeEnchantment</samp><br /><samp>MagicEnchantment</samp><br /><samp>MasterEnchantment</samp><br /><samp>MilkPailEnchantment</samp><br /><samp>PanEnchantment</samp><br /><samp>PickaxeEnchantment</samp><br /><samp>PowerfulEnchantment</samp><br /><samp>PreservingEnchantment</samp><br /><samp>ReachingToolEnchantment</samp><br /><samp>RubyEnchantment</samp><br /><samp>ShavingEnchantment</samp><br /><samp>ShearsEnchantment</samp><br /><samp>SwiftToolEnchantment</samp><br /><samp>TopazEnchantment</samp><br /><samp>VampiricEnchantment</samp><br /><samp>WateringCanEnchantment</samp>
 +
| <samp>StardewValley</samp>
 +
| <samp>StardewValley.Enchantments</samp>
 +
|-
 +
| <samp>Extensions</samp>
 +
| <samp>StardewValley</samp>
 +
| <samp>StardewValley.Extensions</samp>
 
|-
 
|-
| <samp>true</samp>
+
| <samp>ModDataDictionary</samp><br /><samp>ModHooks</samp>
| Reduces memory usage when the audio cue isn't active, but increases performance impact when it's played. Playing the audio multiple times will multiply the memory and performance impact while they're active, since each play will stream a new instance. Recommended for longer audio cues (like music or ambient noise), or cues that are rarely used in a specific scenario (e.g. a sound that only plays once in an event).
+
| <samp>StardewValley</samp>
 +
| <samp>StardewValley.Mods</samp>
 
|-
 
|-
| <samp>false</samp>
+
| <samp>PathFindController</samp><br /><samp>PathNode</samp><br /><samp>PriorityQueue</samp><br /><samp>SchedulePathDescription</samp>
| Increases memory usage (since it's fully loaded into memory), but reduces performance impact when it's played. It can be played any number of times without affecting memory or performance (it'll just play the cached audio). Recommended for sound effects, or short audio cues that are played occasionally.
+
| <samp>StardewValley</samp>
|}
+
| <samp>StardewValley.Pathfinding</samp>
 
|-
 
|-
| <samp>Looped</samp>
+
| <samp>SpecialOrder</samp>
| Whether the audio cue loops continuously until stopped. Default false.
+
| <samp>StardewValley</samp>
 +
| <samp>StardewValley.SpecialOrders</samp>
 
|-
 
|-
| <samp>UseReverb</samp>
+
| <samp>CollectObjective</samp><br /><samp>DeliverObjective</samp><br /><samp>DonateObjective</samp><br /><samp>FishObjective</samp><br /><samp>GiftObjective</samp><br /><samp>JKScoreObjective</samp><br /><samp>OrderObjective</samp><br /><samp>ReachMineFloorObjective</samp><br /><samp>ShipObjective</samp><br /><samp>SlayObjective</samp>
| Whether to apply a [[wikipedia:Reverberation|reverb]] effect to the audio. Default false.
+
| <samp>StardewValley</samp>
 +
| <samp>StardewValley.SpecialOrders.Objectives</samp>
 
|-
 
|-
| <samp>CustomFields</samp>
+
| <samp>FriendshipReward</samp><br /><samp>GemsReward</samp><br /><samp>MailReward</samp><br /><samp>MoneyReward</samp><br /><samp>OrderReward</samp><br /><samp>ResetEventReward</samp>
| The [[#Custom data fields|custom fields]] for this entry.
+
| <samp>StardewValley</samp>
 +
| <samp>StardewValley.SpecialOrders.Rewards</samp>
 
|}
 
|}
   −
====Example====
+
====Other API changes====
This content pack adds a new music cue to the game, and plays it when the player enters the bus stop:
+
These class members changed in 1.6:
   −
{{#tag:syntaxhighlight|<nowiki>
+
{| class="wikitable"
{
+
|-
    "Format": "</nowiki>{{Content Patcher version}}<nowiki>",
+
! type
    "Changes": [
+
! member
        // add music cue
+
! migration
        {
+
|-
            "Action": "EditData",
+
| <samp>BigSlime</samp>
            "Target": "Data/AudioChanges",
+
| <samp>heldObject</samp>
            "Entries": {
+
| Replaced by <samp>heldItem</samp>, which allows non-object items too.
                "Example.ModId_Music": {
+
|-
                    "ID": "Example.ModId_Music",
+
|rowspan="3"| <samp>Bush</samp>
                    "Category": "Music",
+
| <samp>overrideSeason</samp>
                    "FilePaths": [ "{{AbsoluteFilePath: assets/music.ogg}}" ],
+
| Removed; use <code>bush.Location.GetSeason()</code> instead.
                    "StreamedVorbis": true,
  −
                    "Looped": true
  −
                }
  −
            }
  −
        },
  −
 
  −
        // add to bus stop
  −
        {
  −
            "Action": "EditMap",
  −
            "Target": "Maps/BusStop",
  −
            "MapProperties": {
  −
                "Music": "Example.ModId_Music"
  −
            }
  −
        }
  −
    ]
  −
}</nowiki>|lang=javascript}}
  −
 
  −
====Other changes====
  −
* The game no longer crashes when playing audio which doesn't exist. It now logs an error and returns a default quiet click sound instead. (If you use <code>try..catch</code> to check if an audio cue exists, you should check <code>Game1.soundbank.Exists(name)</code> instead.)
  −
 
  −
===Custom buffs===
  −
: ''See also: [[#Buff overhaul|buff overhaul]].''
  −
 
  −
You can now define custom buffs by editing the new <samp>Data/Buffs</samp> asset. You can then use the buff from other places like <samp>Data/Object</samp>'s <samp>Buff</samp> field or the C# <samp>Buff</samp> constructor.
  −
 
  −
This consists of a string → model lookup, where...
  −
* The key is a [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for the buff.
  −
* The value is a model with the fields listed below.
  −
 
  −
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>greenhouseBush</samp>
! purpose
+
| Removed; use <code>bush.IsSheltered()</code> or <code>bush.currentLocation.IsGreenhouse</code> instead.
 
|-
 
|-
| <samp>DisplayName</samp>
+
| <samp>inBloom</samp>
| A [[Modding:Tokenizable strings|tokenizable string]] for the buff name.
+
| Remove the arguments, like <code>bush.inBloom(Game1.currentSeason, Game1.dayOfMonth)</code> → <code>bush.inBloom()</code>.
 
|-
 
|-
| <samp>Description</samp>
+
|rowspan="3"| <samp>Character</samp>
| ''(Optional)'' A [[Modding:Tokenizable strings|tokenizable string]] for the buff name. Default none.
+
| <samp>getStandingX</samp><br /><samp>getStandingY</samp><br /><samp>getStandingXY</samp>
 +
| Removed; use <samp>character.StandingPixel</samp> instead.
 
|-
 
|-
| <samp>IsDebuff</samp>
+
| <samp>getTileLocation</samp><br /><samp>getTileX</samp><br /><samp>getTileY</samp><br />
| ''(Optional)'' >Whether this buff counts as a debuff, so its duration should be halved when wearing a [[Sturdy Ring|sturdy ring]]. Default false.
+
| Removed; use <samp>character.Tile</samp> instead.
 
|-
 
|-
| <samp>GlowColor</samp>
+
| <samp>getTileLocationPoint</samp>
| ''(Optional)'' The glow color to apply to the player. See [[#Color fields|color format]]. Default none.
+
| Removed; use <samp>character.TilePoint</samp> instead.
 
|-
 
|-
| <samp>Duration</samp>
+
| <samp>Chest</samp>
| The duration in milliseconds for which the buff should be active. This can be set to value <samp>-2</samp> for a buff that should last for the rest of the day.
+
| <samp>MoveToSafePosition</samp>
 +
| Replaced by the simpler <samp>TryMoveToSafePosition</samp>
 
|-
 
|-
| <samp>MaxDuration</samp>
+
|rowspan="2"| <samp>Dialogue</samp>
| ''(Optional)'' The maximum buff duration in milliseconds. If specified and larger than <samp>Duration</samp>, a random value between <samp>Duration</samp> and <samp>MaxDuration</samp> will be selected for each buff. Default none.
+
| <samp>dialogues</samp>
 +
| Changed from <code>List&lt;string&gt;</code> to <code>List&lt;DialogueLine&gt;</code>. The <samp>Text</samp> field on each dialogue line is equivalent to the old value.
 
|-
 
|-
| <samp>IconTexture</samp>
+
| <samp>isOnFinalDialogue()</samp>
| The asset name for the texture containing the buff's sprite.
+
| This now indicates whether it's showing the last dialogue ''with message text''; there may still be entries in <samp>dialogues</samp> which apply side-effects without message text.
 
|-
 
|-
| <samp>IconSpriteIndex</samp>
+
|rowspan="3"| <samp>Farmer</samp>
| ''(Optional)'' The sprite index for the buff icon within the <samp>IconTexture</samp>. Default 0.
+
| <samp>changePants(…)</samp>
 +
| Renamed to <samp>changePantsColor(…)</samp> for consistency with <samp>change[Eye&#124;Hair&#124;Shoe]Color</samp>.
 +
|-
 +
| <samp>isMarried()</samp>
 +
| Renamed to <samp>isMarriedOrRoommates()</samp> for clarity.
 +
|-
 +
| <samp>visibleQuestCount</samp>
 +
| Replaced by <samp>hasVisibleQuests</samp>.
 +
|-
 +
| <samp>Flooring</samp>
 +
| <samp>GetFloorPathLookup</samp>
 +
| Use <samp>Game1.floorPathData</samp> instead.
 +
|-
 +
| <samp>Forest</samp>
 +
| <samp>log</samp>
 +
| Moved into <samp>Forest.resourceClumps</samp>.
 +
|-
 +
| <samp>FruitTree</samp>
 +
| <samp>GreenHouseTree</samp>
 +
| Replaced by <samp>IgnoresSeasonsHere()</samp>.
 
|-
 
|-
| <samp>Effects</samp>
+
|rowspan="3"| <samp>Game1</samp>
| ''(Optional)'' The buff attributes to apply. Default none.
+
| <samp>bigCraftableInformation</samp>
 
+
| Overhauled into [[#Custom big craftables|<samp>Game1.bigCraftableData</samp>]].
This consists of a model with any combination of these fields:
  −
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>clothingInformation</samp>
! purpose
+
| Overhauled into [[#Custom shirts|<samp>Game1.shirtData</samp>]] and [[#Custom pants|<samp>Game1.pantsData</samp>]].
 
|-
 
|-
| <samp>FarmingLevel</samp><br /><samp>FishingLevel</samp><br /><samp>ForagingLevel</samp><br /><samp>LuckLevel</samp><br /><samp>MiningLevel</samp>
+
| <samp>objectInformation</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.
+
| Overhauled into [[#Custom objects|<samp>Game1.objectData</samp>]].
 
|-
 
|-
| <samp>Attack</samp><br /><samp>Defense</samp><br /><samp>MagneticRadius</samp><br /><samp>MaxStamina</samp><br /><samp>Speed</samp>
+
|rowspan="3"| <samp>GameLocation</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>getCharacters</samp>
|}
+
| Removed; use the <samp>characters</samp> field instead.
 
|-
 
|-
| <samp>ActionsOnApply</samp>
+
| <samp>GetMapPropertyPosition</samp>
| ''(Optional)'' Run any number of [[Modding:Trigger actions|trigger action strings]] when the buff is applied to the current player. For example, this increments a player stat:
+
| Replaced by <samp>TryGetMapPropertyAs</samp>, which supports multiple data types (not just <samp>Point</samp>).
<syntaxhighlight lang="js">
  −
"ActionsOnApply": [
  −
    "IncrementStat {{ModId}}_NumberEaten 1"
  −
]
  −
</syntaxhighlight>
   
|-
 
|-
| <samp>CustomFields</samp>
+
| <samp>isTileOccupied</samp><br /><samp>isTileOccupiedForPlacement</samp><br /><samp>isTileOccupiedIgnoreFloors</samp><br /><samp>isTileLocationOpenIgnoreFrontLayers</samp><br /><samp>isTileLocationTotallyClearAndPlaceable</samp><br /><samp>isTileLocationTotallyClearAndPlaceableIgnoreFloors</samp>
| ''(Optional)'' The [[#Custom data fields|custom fields]] for this entry.  
+
| Removed. The collision logic has been significantly rewritten and uses a new set of methods (mainly <samp>isTilePassable</samp>, <samp>IsTileOccupiedBy</samp>, and <samp>CanItemBePlacedHere</samp>). Mods should ideally be updated to use the new methods.
|}
     −
===Custom data fields===
+
Here's a drop-in set of extension methods which re-add the older methods. This lets you temporarily fix code until you can update it properly, but depending on these isn't recommended since they won't be maintained in future versions.
Many data assets now have a <samp>CustomFields</samp> field. This is ignored by the game, but lets mods add their own data (e.g. to enable mod framework features).
+
{{collapse|expand for non-recommended code|content=<syntaxhighlight lang="c#">
 
+
public static class GameLocationExtensions
For example, a content pack can [[#Custom crops|add a crop]] with custom fields:
  −
{{#tag:syntaxhighlight|<nowiki>
   
{
 
{
     "Format": "</nowiki>{{Content Patcher version}}<nowiki>",
+
     public static bool isTileOccupiedForPlacement(this GameLocation location, Vector2 tileLocation, Object toPlace = null)
     "Changes": [
+
     {
         {
+
         return location.CanItemBePlacedHere(tileLocation, toPlace != null && toPlace.isPassable());
            "Action": "EditData",
+
    }
            "Target": "Data/Crops",
  −
            "Entries": {
  −
                "Example.Id_CucumberSeeds": {
  −
                    "Seasons": [ "summer" ],
  −
                    "DaysInPhase": [ 1, 2, 2, 2 ],
  −
                    "HarvestItemId": "Example.Id_Cucumber",
  −
                    "Texture": "{{InternalAssetKey: assets/crops.png}}",
  −
                    "SpriteIndex": 0,
     −
                    "CustomFields": {
+
    public static bool isTileOccupied(this GameLocation location, Vector2 tileLocation, string characterToIgnore = "", bool ignoreAllCharacters = false)
                        "Example.FrameworkMod/WetTexture": "{{InternalAssetKey: assets/crops-wet.png}}"
+
    {
                    }
+
        CollisionMask mask = ignoreAllCharacters ? CollisionMask.All & ~CollisionMask.Characters & ~CollisionMask.Farmers : CollisionMask.All;
                }
+
         return location.IsTileOccupiedBy(tileLocation, mask);
            }
+
     }
         }
  −
     ]
  −
}</nowiki>|lang=javascript}}
     −
And then a C# mod could handle the custom field if it's set:
+
     public static bool isTileOccupiedIgnoreFloors(this GameLocation location, Vector2 tileLocation, string characterToIgnore = "")
<syntaxhighlight lang="c#">
  −
if (Game1.currentLocation.IsRainingHere())
  −
{
  −
     CropData data = crop.GetData();
  −
    if (data != null && data.CustomFields.TryGetValue("Example.FrameworkMod/WetTexture", out string textureName))
   
     {
 
     {
         // do magic
+
         return location.IsTileOccupiedBy(tileLocation, CollisionMask.Buildings | CollisionMask.Furniture | CollisionMask.Objects | CollisionMask.Characters | CollisionMask.TerrainFeatures, ignorePassables: CollisionMask.Flooring);
 
     }
 
     }
}
  −
</syntaxhighlight>
     −
See <samp>CustomFields</samp> in the docs for each asset type to see if it's supported. Besides the sections listed on this page, custom fields were also added to <samp>Data/AdditionalFarms</samp>, <samp>Data/AdditionalLanguages</samp>, <samp>Data/FishPondData</samp>, <samp>Data/Movies</samp>, and <samp>Data/SpecialOrders</samp>.
+
    public static bool isTileLocationOpenIgnoreFrontLayers(this GameLocation location, Location tile)
 +
    {
 +
        return location.map.RequireLayer("Buildings").Tiles[tile.X, tile.Y] == null && !location.isWaterTile(tile.X, tile.Y);
 +
    }
   −
===Custom giant crops===
+
    public static bool isTileLocationTotallyClearAndPlaceable(this GameLocation location, int x, int y)
You can now add/edit [[Crops#Giant Crops|giant crops]] by editing the <samp>Data/GiantCrops</samp> data asset.
+
    {
 +
        return location.isTileLocationTotallyClearAndPlaceable(new Vector2(x, y));
 +
    }
   −
This consists of a string → model lookup, where...
+
    public static bool isTileLocationTotallyClearAndPlaceableIgnoreFloors(this GameLocation location, Vector2 v)
* The key is a [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for the giant crop.
+
    {
* The value is a model with the fields listed below.
+
        return location.isTileOnMap(v) && !location.isTileOccupiedIgnoreFloors(v) && location.isTilePassable(new Location((int)v.X, (int)v.Y), Game1.viewport) && location.isTilePlaceable(v);
 +
    }
 +
 
 +
    public static bool isTileLocationTotallyClearAndPlaceable(this GameLocation location, Vector2 v)
 +
    {
 +
        Vector2 pixel = new Vector2((v.X * Game1.tileSize) + Game1.tileSize / 2, (v.Y * Game1.tileSize) + Game1.tileSize / 2);
 +
        foreach (Furniture f in location.furniture)
 +
        {
 +
            if (f.furniture_type != Furniture.rug && !f.isPassable() && f.GetBoundingBox().Contains((int)pixel.X, (int)pixel.Y) && !f.AllowPlacementOnThisTile((int)v.X, (int)v.Y))
 +
                return false;
 +
        }
   −
{| class="wikitable"
+
        return location.isTileOnMap(v) && !location.isTileOccupied(v) && location.isTilePassable(new Location((int)v.X, (int)v.Y), Game1.viewport) && location.isTilePlaceable(v);
 +
    }
 +
}
 +
</syntaxhighlight>
 +
}}
 
|-
 
|-
! field
+
| <samp>GiantCrop</samp>
! effect
+
| <samp>which</samp>
 +
| Replaced by <samp>itemId</samp>.
 
|-
 
|-
| <samp>FromItemId</samp>
+
| <samp>Item</samp>
| The [[#Custom items|item ID]] (qualified or unqualified) for the harvest ID of the regular crop which can turn into this giant crop. For example, <samp>(O)254</samp> is [[melon]].
+
| <samp>SanitizeContextTag</samp>
 
+
| Replaced by <samp>ItemContextTagManager.SanitizeContextTag</samp>.
Any number of giant crops can use the same <samp>FromItemId</samp> value. The first giant crop whose other fields match (if any) will spawn.
   
|-
 
|-
| <samp>HarvestItems</samp>
+
| <samp>LocalizedContentManager</samp>
| The items which can be dropped when you break the giant crop. If multiple items match, they'll all be dropped.
+
| <samp>LanguageCodeString</samp>
 
+
| Now static.
This consists of a list of models with these fields:
  −
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>LocationContextData</samp>
! effect
+
| <samp>Name</samp>
 +
| Removed; use its dictionary key in <samp>Game1.locationContextData</samp> instead.
 
|-
 
|-
| ''common fields''
+
| <samp>NetFields</samp>
| See [[Modding:Item queries#Item spawn fields|item spawn fields]] for the generic item fields supported for harvest items.
+
| <samp>AddFields</samp>
 +
| Removed; use <samp>AddField</samp> instead. For example:
 +
<syntaxhighlight lang="c#">
 +
// old code
 +
NetFields.AddFields(textureName, spriteWidth, spriteHeight);
   −
If set to an [[Modding:Item queries|item query]] which returns multiple items, one of them will be selected at random.
+
// new code
|-
+
NetFields
| <samp>Chance</samp>
+
    .AddField(textureName)
| ''(Optional)'' The probability that this entry is selected, as a value between 0 (never drops) and 1 (always drops). Default 1 (100% chance).
+
    .AddField(spriteWidth)
|-
+
    .AddField(spriteHeight);
| <samp>ForShavingEnchantment</samp>
+
</syntaxhighlight>
| ''(Optional)'' Whether this item is only dropped for [[Enchantments#Tool enchantments|Shaving enchantment]] drops (<samp>true</samp>), only when the giant crop is broken (<samp>false</samp>), or both (<samp>null</samp>). Default both.
+
Note that the second argument (<samp>name</samp>) should usually be omitted, since it'll be auto-populated from the value passed to the first argument.
 +
|-
 +
|rowspan="7"| <samp>NPC</samp>
 +
| <samp>canReceiveThisItemAsGift()</samp>
 +
| Removed. The closest equivalent is <code>item.canBeGivenAsGift()</code>, or you can check if the NPC will accept the player's held object (as a gift or otherwise) using <code>npc.tryReceiveActiveObject(Game1.player, probe: true)</code>.
 +
|-
 +
| <samp>Gender</samp><br /><samp>female</samp><br /><samp>male</samp><br /><samp>undefined</samp>
 +
| The <samp>Gender</samp> field now uses a <samp>Gender</samp> enum instead of numeric constants. For example, <code>npc.Gender == NPC.female</code> becomes <code>npc.Gender == Gender.Female</code> in 1.6.
 +
|-
 +
| <samp>homeRegion</samp>
 +
| Removed; use <samp>npc.GetData()?.HomeRegion</samp> instead. Change <samp>0</samp> to <samp>"Other"</samp> or <samp>NPC.region_other</samp>, <samp>1</samp> to <samp>"Desert"</samp> or <samp>NPC.region_desert</samp>, and <samp>2</samp> to <samp>"Town"</samp> or <samp>NPC.region_town</samp>.
 
|-
 
|-
| <samp>ScaledMinStackWhenShaving</samp><br /><samp>ScaledMaxStackWhenShaving</samp>
+
| <samp>isBirthday</samp>
| ''(Optional)'' If set, the min/max stack size when this item is dropped due to the [[Forge#Enchantments|shaving enchantment]], scaled to the tool's power level.
+
| Remove the arguments, like <code>npc.isBirthday(Game1.currentSeason, Game1.dayOfMonth)</code> <code>npc.isBirthday()</code>.
 
  −
This value is multiplied by the health deducted by the tool hit which triggered the enchantment. For example, an iridium axe which reduced the giant crop's health by 3 points will produce three times this value per hit.
  −
 
  −
If both fields are set, the stack size is randomized between them. If only one is set, it's applied as a limit after the generic fields. If neither is set, the generic <samp>MinStack</samp>/<samp>MaxStack</samp> fields are applied as usual without scaling.
  −
|}
   
|-
 
|-
| <samp>Texture</samp>
+
| <samp>isVillager()</samp>
| The asset name for the texture containing the giant crop's sprite.
+
| Deprecated; use the <samp>character.IsVillager</samp> property instead.
 
|-
 
|-
| <samp>TexturePosition</samp>
+
| <samp>populateRoutesFromLocationToLocationList</samp>
| ''(Optional)'' The top-left pixel position of the sprite within the <samp>Texture</samp>, specified as a model with <samp>X</samp> and <samp>Y</samp> fields. Defaults to (0, 0).
+
| Replaced by <samp>WarpPathfindingCache.PopulateCache</samp>.
 
|-
 
|-
| <samp>TileSize</samp>
+
| <samp>Schedule</samp>
| ''(Optional)'' The area in tiles occupied by the giant crop, specified as a model with <samp>X</samp> and <samp>Y</samp> fields. This affects both its sprite size (which should be 16 pixels per tile) and the grid of crops needed for it to grow. Note that giant crops are drawn with an extra tile's height. Defaults to (3, 3).
+
| No longer assignable, use one of the <samp>TryLoadSchedule</samp> overloads instead.
 
|-
 
|-
| <samp>Health</samp>
+
|rowspan="3"| <samp>Object</samp>
| ''(Optional)'' The health points that must be depleted to break the giant crop. The number of points depleted per [[axe]] chop depends on the axe power level. Default 3.
+
| <samp>GetContextTagList()</samp>
 +
| Replaced by <samp>GetContextTags()</samp>, which returns a hash set instead of a list.
 
|-
 
|-
| <samp>Chance</samp>
+
| <samp>HasBeenPickedUpByPlayer</samp>
| ''(Optional)'' The percentage chance that a given grid of crops will grow into the giant crop each night, as a value between 0 (never) and 1 (always). Default 0.01 (1%).
+
| Removed; use <samp>HasBeenInInventory</samp> instead.
 
  −
Note that the chance is checked for each giant crop that applies. If three giant crops each have a 1% chance of spawning for the same crop, then there's a 3% chance that one of them will spawn.
   
|-
 
|-
| <samp>Condition</samp>
+
| <samp>isPotentialBasicShippedCategory</samp>
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether this giant crop is available to spawn. Defaults to always true.
+
| The second argument should now be an integer (like <samp>-75</samp> or <samp>Object.VegetableCategory</samp>) instead of a string (like <samp>"-75"</samp>).
 
|-
 
|-
| <samp>CustomFields</samp>
+
|rowspan="9"| <samp>Utility</samp>
| The [[#Custom data fields|custom fields]] for this entry.
+
| <samp>doesItemWithThisIndexExistAnywhere</samp>
|}
+
| Replace with <samp>Utility.doesItemExistAnywhere</samp>, which takes a string item ID. For example:
 
+
* <code>Utility.doesItemWithThisIndexExistAnywhere(128)</code> &rarr; <code>Utility.doesItemExistAnywhere("(O)128")</code>;
===Custom movies===
+
* <code>Utility.doesItemWithThisIndexExistAnywhere(128, true)</code> &rarr; <code>Utility.doesItemExistAnywhere("(BC)128")</code>.
: ''See also: [[#Custom movie concessions|custom movie concessions]].''
  −
 
  −
[[Modding:Movie theater data#Movie data|Movie data]] was previously very limited and prone to mod conflicts, since (a) we needed incrementing movie IDs like <samp>spring_movie_3</samp>, (b) we were limited to one movie per season, and (c) all sprites for each movie had to be in the vanilla <samp>LooseSprites/Movies</samp> spritesheet.
  −
 
  −
Stardew Valley 1.6 revamps how movies work to address those limitations.
  −
 
  −
<dl>
  −
<dt>Movie selection</dt>
  −
<dd><p>Movies were previously selected based on a specific ID pattern: <samp>spring_movie_0</samp> would play in spring the year you built the movie theater, <samp>spring_movie_1</samp> would play in spring the next year, etc. That meant it'd take two in-game years to see the first custom movie, and ID conflicts had to be managed manually.</p>
  −
 
  −
In 1.6, we can now have multiple movies per month based on the new fields listed below. If multiple movies can play in the same season, each movie will be shown for an equal block of days within the month (e.g. four movies will each play for seven consecutive days). If there are more movies than days, 28 movies will be chosen at random to play that month.</dd>
  −
 
  −
<dt>New data fields</dd>
  −
<dd>
  −
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>ForAllLocations</samp><br /><samp>iterateAllCrops</samp><br /><samp>iterateAllItems</samp>
! effect
+
| Removed; use the equivalent <samp>Utility.ForEach*</samp> methods instead.
 
|-
 
|-
| <samp>Seasons</samp>
+
| <samp>GetHorseWarpRestrictionsForFarmer</samp>
| ''(Optional)'' The seasons when the movie should play, or omit for any season. For example:
+
| This now returns a flag enum instead of a list of integer values. The equivalent values are 1 → <samp>NoOwnedHorse</samp>, 2 → <samp>Indoors</samp>, 3 → <samp>NoRoom</samp>, and 4 → <samp>InUse</samp>.
<syntaxhighlight lang="js">"Seasons": [ "Spring", "Summer" ]</syntaxhighlight>
  −
|-
  −
| <samp>YearModulus</samp><br /><samp>YearRemainder</samp>
  −
| ''(Optional)'' If set, plays the movie on alternating years based on the formula <samp>theater_age % modulus == remainder</samp>, where <samp>theater_age</samp> is the number of years since the movie theater was built. If omitted, the movie plays in any year.
      
For example:
 
For example:
 +
<syntaxhighlight lang="c#">
 +
// old code
 +
bool inUse = Utility.GetHorseWarpRestrictionsForFarmer(player).Any(p => p == 4);
   −
<syntaxhighlight lang="js">
+
// new code
// play in the first year, and every second year thereafter
+
bool inUse = Utility.GetHorseWarpRestrictionsForFarmer(player).HasFlag(Utility.HorseWarpRestrictions.InUse);
"YearModulus": 2,
  −
"YearRemainder": 0
   
</syntaxhighlight>
 
</syntaxhighlight>
<syntaxhighlight lang="js">
+
 
// play in the second year, and every second year thereafter
+
Or to check if no restrictions apply:
"YearModulus": 2,
+
<syntaxhighlight lang="c#">
"YearRemainder": 1
+
bool canSummon = Utility.GetHorseWarpRestrictionsForFarmer(player) == Utility.HorseWarpRestrictions.None;
 
</syntaxhighlight>
 
</syntaxhighlight>
|-
  −
| <samp>Texture</samp>
  −
| ''(Optional)'' The asset name for the movie poster and screen images, or omit to use <samp>LooseSprites\Movies</samp>.
     −
This must be a spritesheet with one 490×128 pixel row per movie. A 13×19 area in the top-left corner of the row should contain the movie poster. With a 16-pixel offset from the left edge, there should be two rows of five 90×61 pixel movie screen images, with a six-pixel gap between each image. (The movie doesn't need to use all of the image slots.)
+
C# mods can patch <samp>Utility.GetHorseWarpErrorMessage</samp> if they need to add an error message for a custom restriction value.
 
|-
 
|-
| <samp>CranePrizes</samp>
+
| <samp>getRandomTownNPC(…)</samp>
| ''(Optional)'' The items to add to the [[Movie Theater#Crane Game|crane game]] prize pool on days when this movie is playing, if any.
+
| Replaced by either <code>Utility.GetRandomWinterStartParticipant(…)</code> or <code>Utility.getRandomNpcFromHomeRegion(NPC.region_town)</code>.
 
  −
This consists of a list of models with these fields:
  −
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>getTodaysBirthdayNPC</samp>
! effect
+
| Remove the arguments, like <code>Utility.getTodaysBirthdayNPC(Game1.currentSeason, Game1.dayOfMonth)</code> → <code>Utility.getTodaysBirthdayNPC()</code>.
 +
|-
 +
| <samp>getPooledList</samp><br /><samp>returnPooledList</samp>
 +
| The game no longer uses a list pool. In most cases you should use the [[#Iteration|<samp>Utility.ForEach*</samp> methods]] instead, which don't need it.
 +
|-
 +
| <samp>numObelisksOnFarm</samp>
 +
| Renamed to <samp>GetObeliskTypesBuilt</samp>, which searches all locations.
 
|-
 
|-
| ''common fields''
+
| <samp>numSilos</samp>
| See [[Modding:Item queries#Item spawn fields|item spawn fields]] for the generic item fields supported for ammo items.
+
| Removed.
 +
 
 +
If you're using this to calculate hay capacity, it's a bit more complicated in 1.6 since hay storage can be enabled for custom buildings and building construction can be enabled for any location. To get capacity for the current location, use <samp>Game1.currentLocation.GetHayCapacity()</samp> instead. To get total hay capacity in the world, use <samp>Utility.ForEachLocation</samp> to call it on every location.
   −
If set to an [[Modding:Item queries|item query]] which returns multiple items, one of them will be selected at random.
+
If you actually need the number of silos, use <samp>location.getNumberBuildingsConstructed("Silo")</samp> (one location) or <samp>Game1.GetNumberBuildingsConstructed("Silo")</samp> (all locations).
 +
|-
 +
| <samp>removeThisCharacterFromAllLocations</samp>
 +
| Removed; use <samp>Game1.removeCharacterFromItsLocation</samp> instead.
 +
|-
 +
| <samp>ShopMenu</samp>
 +
| <samp>storeContext</samp>
 +
| Replaced by <samp>ShopId</samp>.
 +
|-
 +
|rowspan="3"| <samp>Stats</samp>
 +
| <samp>averageBedtime</samp><br /><samp>beveragesMade</samp><br /><samp>bouldersCracked</samp><br /><samp>caveCarrotsFound</samp><br /><samp>cheeseMade</samp><br /><samp>chickenEggsLayed</samp><br /><samp>copperFound</samp><br /><samp>cowMilkProduced</samp><br /><samp>cropsShipped</samp><br /><samp>daysPlayed</samp><br /><samp>diamondsFound</samp><br /><samp>dirtHoed</samp><br /><samp>duckEggsLayed</samp><br /><samp>fishCaught</samp><br /><samp>geodesCracked</samp><br /><samp>giftsGiven</samp><br /><samp>goatCheeseMade</samp><br /><samp>goatMilkProduced</samp><br /><samp>goldFound</samp><br /><samp>goodFriends</samp><br /><samp>individualMoneyEarned</samp><br /><samp>iridiumFound</samp><br /><samp>ironFound</samp><br /><samp>itemsCooked</samp><br /><samp>itemsCrafted</samp><br /><samp>itemsForaged</samp><br /><samp>itemsShipped</samp><br /><samp>monstersKilled</samp><br /><samp>mysticStonesCrushed</samp><br /><samp>notesFound</samp><br /><samp>otherPreciousGemsFound</samp><br /><samp>piecesOfTrashRecycled</samp><br /><samp>preservesMade</samp><br /><samp>prismaticShardsFound</samp><br /><samp>questsCompleted</samp><br /><samp>rabbitWoolProduced</samp><br /><samp>rocksCrushed</samp><br /><samp>seedsSown</samp><br /><samp>sheepWoolProduced</samp><br /><samp>slimesKilled</samp><br /><samp>stepsTaken</samp><br /><samp>stoneGathered</samp><br /><samp>stumpsChopped</samp><br /><samp>timesFished</samp><br /><samp>timesUnconscious</samp><br /><samp>totalMoneyGifted</samp><br /><samp>trufflesFound</samp><br /><samp>weedsEliminated</samp>
 +
| Removed; use the equivalent property or methods. For example, <code>Game1.stats.daysPlayed</code> can be replaced with <code>Game1.stats.DaysPlayed</code> or methods like <code>Game1.stats.Get(StatKeys.DaysPlayed)</code>. See [[#Stat changes for C# mods|stat changes for C# mods]].
 +
|-
 +
| <samp>getStat(…)</samp><br /><samp>incrementStat(…)</samp>
 +
| Replaced by <samp>Get(…)</samp> and <samp>Increment(…)</samp>. See [[#Stat changes for C# mods|stat changes for C# mods]].
 +
|-
 +
| <samp>stat_dictionary</samp>
 +
| Renamed to <samp>Values</samp>. See [[#Stat changes for C# mods|stat changes for C# mods]].
 
|-
 
|-
| <samp>Rarity</samp>
+
| <samp>Woods</samp>
| ''(Optional)'' The prize pool to add the item to. The possible values are <samp>1</samp> (common), <samp>2</samp> (rare), and <samp>3</samp> (deluxe). Default <samp>1</samp>.
+
| <samp>stumps</samp>
 +
| Moved into <samp>resourceClumps</samp>.
 
|}
 
|}
|-
  −
| <samp>ClearDefaultCranePrizeGroups</samp>
  −
| ''(Optional)'' The prize pools whose default items to discard, so only those specified by <samp>CranePrizes</samp> are available. Default none.
     −
For example:
+
===Check for obsolete code===
<syntaxhighlight lang="js">"ClearDefaultCranePrizeGroups": [ 2, 3 ]</syntaxhighlight>
+
Perform a full rebuild of your mod (in Visual Studio, click ''Build > Rebuild Solution''), then check the Error List pane for any warnings like "'''X' is obsolete''". Anything from the vanilla game code which is marked obsolete won't work anymore and is only kept for save migrations. Usually the warning will include an explanation of what you should use instead.
|}
  −
</dd>
     −
<dt>Other changes</dt>
+
==Breaking changes for content packs==
<dd>
+
'''This section only describes how this update may break existing mods. See the ''what's new'' sections above for more info, including new functionality mods can use.'''
* <samp>Data/Movies</samp>, <samp>Data/Concessions</samp>, and <samp>Data/MoviesReactions</samp> no longer have language variants. Instead translations were moved into <samp>Strings/*</samp> assets, and the data assets use [[Modding:Tokenizable strings|tokenizable strings]] to get text.
  −
* <samp>Data/Movies</samp> is now a list instead of a dictionary. The order determines the order movies are shown within a season. Content packs can edit them the same way as before.
  −
* Added a <samp>debug movieSchedule {{o|year}}</samp> command to help troubleshoot movie selection.
  −
* Added methods for C# mods: <samp>MovieTheater.GetMovieToday()</samp>, <samp>GetUpcomingMovie()</samp>, and <samp>GetUpcomingMovie(afterDate)</samp>.
  −
</dd>
  −
</dl>
     −
For example, this content pack adds a new 'Pufferchick II' movie which plays in winter every third year:
+
===Standardized ID fields===
{{#tag:syntaxhighlight|<nowiki>
+
Stardew Valley 1.6 adds an <samp>Id</samp> field to these assets. For Content Patcher content packs, these replace the previous synthetic ID:
 +
 
 +
{| class="wikitable"
 +
|-
 +
! asset
 +
! old key
 +
! new key
 +
! migration steps
 +
|-
 +
| <samp>Data/ConcessionTastes</samp><br /><samp>Data/MovieReactions</samp><br /><samp>Data/RandomBundles</samp> (area)<br /><samp>Data/RandomBundles</samp> (bundle)
 +
| <samp>Name</samp><br /><samp>NPCName</samp><br /><samp>AreaName</samp><br />''none''
 +
|<samp>Id</samp>
 +
| None. The <samp>Id</samp> field is set automatically to the same value (or <samp>Name</samp> for bundles), so there's no change for content packs. Omit the new field when creating a new entry.
 +
|-
 +
| <samp>Data/FishPondData</samp><br /><samp>Data/RandomBundles</samp> (bundle set)
 +
| <samp>RequiredTags</samp><br />''none''
 +
| <samp>Id</samp>
 +
| Use the new <samp>Id</samp> field to target an entry, and add it when creating a new entry. Required.
 +
|-
 +
| <samp>Data/TailoringRecipes</samp>
 +
| <samp>FirstItemTags</samp> and <samp>SecondItemTags</samp>
 +
| <samp>Id</samp>
 +
| Use the new <samp>Id</samp> field to target an entry, and add it when creating a new entry. Defaults to the <samp>CraftedItemIds</samp> (comma-delimited) or <samp>CraftedItemId</samp> value if omitted, but there's a high chance of conflicts so mods should always specify a unique ID.
 +
|}
 +
 
 +
For example, let's say you have a patch like this using Content Patcher:
 +
{{#tag:syntaxhighlight|<nowiki>
 
{
 
{
 
     "Format": "</nowiki>{{Content Patcher version}}<nowiki>",
 
     "Format": "</nowiki>{{Content Patcher version}}<nowiki>",
Line 6,555: Line 6,390:  
         {
 
         {
 
             "Action": "EditData",
 
             "Action": "EditData",
             "Target": "Data/Movies",
+
             "Target": "Data/TailorRecipes",
 
             "Entries": {
 
             "Entries": {
                 "{{ModId}}_PufferchickII": {
+
                 "item_cloth|item_pufferchick": {
                     "Id": "{{ModId}}_PufferchickII", // must specify ID again when creating a new entry
+
                     "FirstItemTags": [ "item_cloth" ],
 
+
                     "SecondItemTags": [ "item_pufferchick" ],
                    "Seasons": [ "winter" ],
+
                     "CraftedItemId": "(S)1260"
                     "YearModulus": 3,
  −
                    "YearRemainder": 0,
  −
 
  −
                    "Title": "Pufferchick II", // display text should usually use {{i18n}} for translations in actual usage
  −
                    "Description": "A sequel to the breakthrough adventure anime Pufferchick. The world is saved; what happens next?",
  −
                    "Tags": [ "family", "adventure" ],
  −
 
  −
                     "Texture": "{{InternalAssetKey: assets/movie.png}}", // an image in your content pack
  −
                    "SheetIndex": 0,
  −
 
  −
                    "Scenes": [ ... ]
   
                 }
 
                 }
 
             }
 
             }
Line 6,578: Line 6,402:  
}</nowiki>|lang=javascript}}
 
}</nowiki>|lang=javascript}}
   −
===Custom wedding event===
+
When updating to Stardew Valley 1.6, replace the synthetic ID (<samp>item_cloth|item_pufferchick</samp>) with a real one:
The [[Marriage#The Wedding|wedding]] event can now be changed by editing the <samp>Data\Weddings</samp> data asset, which consists of a data model with two relevant fields (listed below).
+
* To edit an existing entry, unpack the asset and get its new <samp>Id</samp> value.
 +
* To add a custom entry, use a [[Modding:Common data field types#Unique string ID|unique string ID]].
   −
{| class="wikitable"
+
For example:
|-
+
{{#tag:syntaxhighlight|<nowiki>
! field
+
{
! effect
+
    "Format": "</nowiki>{{Content Patcher version}}<nowiki>",
|-
+
    "Changes": [
| <samp>EventScript</samp>
+
        {
| The [[Modding:Event data|event scripts]] which play the wedding. The game will use the script for the spouse NPC/player if it exists, otherwise it'll use the default script.
+
            "Action": "EditData",
 +
            "Target": "Data/TailorRecipes",
 +
            "Entries": {
 +
                "ExampleAuthor.ModId_RainCoatFromPufferchick": {
 +
                    "Id": "ExampleAuthor.ModId_RainCoatFromPufferchick", // need to specify ID again when creating it
 +
                    "FirstItemTags": [ "item_cloth" ],
 +
                    "SecondItemTags": [ "item_pufferchick" ],
 +
                    "CraftedItemId": "(S)1260"
 +
                }
 +
            }
 +
        }
 +
    ]
 +
}</nowiki>|lang=javascript}}
 +
 
 +
===Event ID changes===
 +
{{/doc status|[[Modding:Event data]]|done=false}}
 +
 
 +
: ''See also: [[#String event IDs|string event IDs in what's new]].''
 +
 
 +
Events now have unique string IDs.
 +
 
 +
When creating an event:
 +
<ul>
 +
<li>New events should use a globally unique ID in the form <samp>Your.ModId_EventName</samp>. Existing events should be fine as-is, but it may be worth migrating them to avoid future conflicts.</li>
 +
<li>Every non-fork event '''must''' have a precondition in its key (even if it's empty). For example, change <code>"Your.ModId_EventName": "..."</code> to <code>"Your.ModId_EventName/": "..."</code>. This is needed for the game to distinguish between events and fork scripts.
 +
 
 +
<syntaxhighlight lang="js">
 +
"Example.ModId_EventName/": "...", // event: loaded automatically by the game
 +
"SomeFork": "..."                  // event fork: ignored unless it's loaded through an event script
 +
</syntaxhighlight></li>
 +
</ul>
 +
 
 +
===Monster eradication goal flag changes===
 +
{{/doc status|a new doc page|done=false}}
 +
 
 +
: ''See also: [[#Custom monster eradication goals|Custom monster eradication goals]].''
   −
This consists of a string → string dictionary, where...
+
The game now tracks [[Adventurer's Guild]] monster eradication goal completion by the goal ID, instead of the produced item. You'll need to replace these mail flags if you check them:
* The key is an NPC internal name (like <samp>Abigail</samp>), unique player ID, or <samp>default</samp> for the default script (which handles marrying either an NPC or player);
  −
* The value is a [[Modding:Tokenizable strings|tokenizable strings]] for the event script to play.
     −
The event scripts also have access to three extra tokens:
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! token
+
! old flag
! effect
+
! new flag
 
|-
 
|-
| <samp>[SetupContextualWeddingAttendees]</samp>
+
| <samp>Gil_Slime Charmer Ring</samp>
| The concatenated <samp>Setup</samp> values for each of the <samp>Attendees</samp> present in the wedding.
+
| <samp>Gil_Slimes</samp>
 
|-
 
|-
| <samp>[ContextualWeddingCelebrations]</samp>
+
| <samp>Gil_Savage Ring</samp>
| The concatenated <samp>Celebration</samp> values for each of the <samp>Attendees</samp> present in the wedding.
+
| <samp>Gil_Shadows</samp>
 +
|-
 +
| <samp>Gil_Vampire Ring</samp>
 +
| <samp>Gil_Bats</samp>
 +
|-
 +
| <samp>Gil_Skeleton Mask</samp>
 +
| <samp>Gil_Skeletons</samp>
 
|-
 
|-
| <samp>[SpouseActor]</samp>
+
| <samp>Gil_Insect Head</samp>
| The actor ID for the NPC or other player being married (like <samp>Abigail</samp> for an NPC or <samp>farmer2</samp> for a player). This can be used in event commands like <code>faceDirection [SpouseActor] 1</code>.
+
| <samp>Gil_Insects</samp>
 
  −
(You can also use <samp>spouse</samp> as an actor ID, but that will only work when marrying an NPC.)
  −
|}
   
|-
 
|-
| <samp>Attendees</samp>
+
| <samp>Gil_Hard Hat</samp>
| The other NPCs which should attend the wedding (unless they're the spouse). This consists of a string → model lookup, where the key is the internal NPC name, and the value is a model with these fields:
+
| <samp>Gil_Duggy</samp>
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>Gil_Burglar's Ring</samp>
! effect
+
| <samp>Gil_DustSpirits</samp>
 
|-
 
|-
| <samp>ID</samp>
+
| <samp>Gil_Crabshell Ring</samp>
| The internal NPC name.
+
| <samp>Gil_Crabs</samp>
 
|-
 
|-
| <samp>Setup</samp>
+
| <samp>Gil_Arcane Hat</samp>
| The NPC's tile position and facing direction when they attend. This is equivalent to field index 2 in the [[Modding:Event data#Basic format|event basic data]].
+
| <samp>Gil_Mummies</samp>
 
|-
 
|-
| <samp>Celebration</samp>
+
| <samp>Gil_Knight's Helmet</samp>
| ''(Optional)'' The [[Modding:Event data|event script]] to run during the celebration, like <samp>faceDirection Pierre 3 true</samp> which makes Pierre turn to face left. This can contain any number of script commands.
+
| <samp>Gil_Dinos</samp>
 
|-
 
|-
| <samp>Condition</samp>
+
| <samp>Gil_Napalm Ring</samp>
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether the NPC should attend. Defaults to true.
+
| <samp>Gil_Serpents</samp>
 
|-
 
|-
| <samp>IgnoreUnlockConditions</samp>
+
| <samp>Gil_Telephone</samp>
| ''(Optional)'' Whether to add the NPC even if their entry in <samp>Data/Characters</samp> has an <samp>UnlockConditions</samp> field which doesn't match. Default false.
+
| <samp>Gil_FlameSpirits</samp>
|}
   
|}
 
|}
   −
===Game state queries===
+
===XNB impact===
A ''game state query'' is a new vanilla way to specify conditions for some content like [[#Custom shops|shop data]], inspired by [[Modding:Content Patcher|Content Patcher]]'s conditions.
+
====Overview====
 +
This section provides a summary of the XNB files which changed in Stardew Valley 1.6. This doesn't include new files (since they won't impact existing mods), or text changes in non-English files.
 +
 
 +
[[Modding:Using XNB mods|XNB mods]] are disproportionately affected, since...
 +
# they replace the entire file;
 +
# they're loaded through the MonoGame content pipeline which is less tolerant of format changes;
 +
# they don't benefit from the compatibility rewrites [[Modding:Content Patcher|Content Patcher]] provides for its content packs.
   −
See [[Modding:Game state queries]] for more information.
+
Content Patcher packs are typically unaffected (and Content Patcher will try to rewrite content packs automatically). However if a content pack replaces an entire asset instead of editing, it's more likely to be affected like an XNB mod.
   −
===Gender changes===
+
====Changed assets====
* Added an [[#gender-switch|''inline gender-switch token'']] to change text depending on the player's gender. This reduces duplicate text, works in more places than the <samp>^</samp> dialogue token, works in mail and other places where <samp>^</samp> has a different meaning, and supports non-binary gender.
+
Compatibility is broadly grouped into four categories:
* For C# mod authors, added a unified <samp>Gender</samp> field for players and NPCs with the possible values <samp>Male</samp>, <samp>Female</samp>, and <samp>Unspecified</samp>. This replaces <samp>Farmer.isMale</samp> and the numeric NPC gender constants. Note that vanilla still only sets players to male or female, though mods can override it.
+
* "'''✘ broken'''": mods will remove new content or significant changes, or the mod's intended changes will no longer work. Effects may range from display bugs to crashes, depending how the game uses that specific content.
* Gender-specific clothing variants can now be worn by any gender.
+
* "✘ will remove changes": mods will remove minor changes in 1.6 (e.g. typo fixes).
* Removed French-only support for using <samp>^</samp> dialogue token in non-dialogue text. This is superseded by the new inline gender-switch command.
+
* "✓ mostly unaffected": mods will only be affected if they replace the entire asset, or edit specific entries or fields.
 
+
* Blank: no expected impact for the vast majority of mods.
===Item queries===
  −
''Item queries'' are a new built-in way to choose one or more items dynamically, instead of specifying a single item ID. These are used in various places like [[#Custom machines|machine data]] and [[#Custom shops|shop data]].
  −
 
  −
For example, a shop can sell a random [[House Plant|house plant]] using the <samp>RANDOM_ITEMS</samp> query:
  −
<syntaxhighlight lang="js">
  −
{
  −
    "ItemId": "RANDOM_ITEMS (F) 1376 1390",
  −
    "MaxItems": 1
  −
}
  −
</syntaxhighlight>
  −
 
  −
See [[Modding:Item queries]] for more info.
  −
 
  −
===Item spawn fields===
  −
Several data assets (like [[#Custom machines|machines]] and [[#Custom shops|shops]]) let you configure items to create using item queries. For consistency, these all share a set of common fields.
  −
 
  −
See [[Modding:Item queries#Item spawn fields]] for more info.
  −
 
  −
===Color fields===
  −
1.6 adds a standardized color format for data fields in assets like [[#Custom wild trees|<samp>Data/WildTrees</samp>]]:
  −
<syntaxhighlight lang="js">
  −
"DebrisColor": "White"
  −
</syntaxhighlight>
     −
This supports colors in any of these formats:
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! format
+
!rowspan="2"| content asset
! example
+
!rowspan="2"| changes in 1.6
 +
!colspan="2"| compatibility for pre-1.6 mods
 
|-
 
|-
| A [https://learn.microsoft.com/en-us/dotnet/api/system.drawing.color?view=netframework-4.8.1#properties <samp>Color</samp> property name].
+
! XNB mods
 
+
! Content Patcher packs
{{collapse|show color names|content=&#32;
  −
<div style="border: 1px solid #0000; border-left-width:1.5em; padding: 2px;">Transparent</div>
  −
<div style="border: 1px solid #696969; border-left-width:1.5em; padding: 2px;">DimGray</div>
  −
<div style="border: 1px solid #808080; border-left-width:1.5em; padding: 2px;">Gray</div>
  −
<div style="border: 1px solid #A9A9A9; border-left-width:1.5em; padding: 2px;">DarkGray</div>
  −
<div style="border: 1px solid #C0C0C0; border-left-width:1.5em; padding: 2px;">Silver</div>
  −
<div style="border: 1px solid #D3D3D3; border-left-width:1.5em; padding: 2px;">LightGray</div>
  −
<div style="border: 1px solid #DCDCDC; border-left-width:1.5em; padding: 2px;">Gainsboro</div>
  −
<div style="border: 1px solid #F5F5F5; border-left-width:1.5em; padding: 2px;">WhiteSmoke</div>
  −
<div style="border: 1px solid #FFF; border-left-width:1.5em; padding: 2px;">White</div>
  −
<div style="border: 1px solid #000; border-left-width:1.5em; padding: 2px;">Black</div>
  −
<div style="border: 1px solid #FFFAFA; border-left-width:1.5em; padding: 2px;">Snow</div>
  −
<div style="border: 1px solid #BC8F8F; border-left-width:1.5em; padding: 2px;">RosyBrown</div>
  −
<div style="border: 1px solid #F08080; border-left-width:1.5em; padding: 2px;">LightCoral</div>
  −
<div style="border: 1px solid #CD5C5C; border-left-width:1.5em; padding: 2px;">IndianRed</div>
  −
<div style="border: 1px solid #A52A2A; border-left-width:1.5em; padding: 2px;">Brown</div>
  −
<div style="border: 1px solid #B22222; border-left-width:1.5em; padding: 2px;">Firebrick</div>
  −
<div style="border: 1px solid #800000; border-left-width:1.5em; padding: 2px;">Maroon</div>
  −
<div style="border: 1px solid #8B0000; border-left-width:1.5em; padding: 2px;">DarkRed</div>
  −
<div style="border: 1px solid #F00; border-left-width:1.5em; padding: 2px;">Red</div>
  −
<div style="border: 1px solid #FFE4E1; border-left-width:1.5em; padding: 2px;">MistyRose</div>
  −
<div style="border: 1px solid #FA8072; border-left-width:1.5em; padding: 2px;">Salmon</div>
  −
<div style="border: 1px solid #FF6347; border-left-width:1.5em; padding: 2px;">Tomato</div>
  −
<div style="border: 1px solid #E9967A; border-left-width:1.5em; padding: 2px;">DarkSalmon</div>
  −
<div style="border: 1px solid #E73C00; border-left-width:1.5em; padding: 2px;">MonoGameOrange</div>
  −
<div style="border: 1px solid #FF7F50; border-left-width:1.5em; padding: 2px;">Coral</div>
  −
<div style="border: 1px solid #FF4500; border-left-width:1.5em; padding: 2px;">OrangeRed</div>
  −
<div style="border: 1px solid #FFA07A; border-left-width:1.5em; padding: 2px;">LightSalmon</div>
  −
<div style="border: 1px solid #A0522D; border-left-width:1.5em; padding: 2px;">Sienna</div>
  −
<div style="border: 1px solid #FFF5EE; border-left-width:1.5em; padding: 2px;">SeaShell</div>
  −
<div style="border: 1px solid #D2691E; border-left-width:1.5em; padding: 2px;">Chocolate</div>
  −
<div style="border: 1px solid #8B4513; border-left-width:1.5em; padding: 2px;">SaddleBrown</div>
  −
<div style="border: 1px solid #F4A460; border-left-width:1.5em; padding: 2px;">SandyBrown</div>
  −
<div style="border: 1px solid #FFDAB9; border-left-width:1.5em; padding: 2px;">PeachPuff</div>
  −
<div style="border: 1px solid #CD853F; border-left-width:1.5em; padding: 2px;">Peru</div>
  −
<div style="border: 1px solid #FAF0E6; border-left-width:1.5em; padding: 2px;">Linen</div>
  −
<div style="border: 1px solid #FFE4C4; border-left-width:1.5em; padding: 2px;">Bisque</div>
  −
<div style="border: 1px solid #FF8C00; border-left-width:1.5em; padding: 2px;">DarkOrange</div>
  −
<div style="border: 1px solid #DEB887; border-left-width:1.5em; padding: 2px;">BurlyWood</div>
  −
<div style="border: 1px solid #FAEBD7; border-left-width:1.5em; padding: 2px;">AntiqueWhite</div>
  −
<div style="border: 1px solid #D2B48C; border-left-width:1.5em; padding: 2px;">Tan</div>
  −
<div style="border: 1px solid #FFDEAD; border-left-width:1.5em; padding: 2px;">NavajoWhite</div>
  −
<div style="border: 1px solid #FFEBCD; border-left-width:1.5em; padding: 2px;">BlanchedAlmond</div>
  −
<div style="border: 1px solid #FFEFD5; border-left-width:1.5em; padding: 2px;">PapayaWhip</div>
  −
<div style="border: 1px solid #FFE4B5; border-left-width:1.5em; padding: 2px;">Moccasin</div>
  −
<div style="border: 1px solid #FFA500; border-left-width:1.5em; padding: 2px;">Orange</div>
  −
<div style="border: 1px solid #F5DEB3; border-left-width:1.5em; padding: 2px;">Wheat</div>
  −
<div style="border: 1px solid #FDF5E6; border-left-width:1.5em; padding: 2px;">OldLace</div>
  −
<div style="border: 1px solid #FFFAF0; border-left-width:1.5em; padding: 2px;">FloralWhite</div>
  −
<div style="border: 1px solid #B8860B; border-left-width:1.5em; padding: 2px;">DarkGoldenrod</div>
  −
<div style="border: 1px solid #DAA520; border-left-width:1.5em; padding: 2px;">Goldenrod</div>
  −
<div style="border: 1px solid #FFF8DC; border-left-width:1.5em; padding: 2px;">Cornsilk</div>
  −
<div style="border: 1px solid #FFD700; border-left-width:1.5em; padding: 2px;">Gold</div>
  −
<div style="border: 1px solid #FFFACD; border-left-width:1.5em; padding: 2px;">LemonChiffon</div>
  −
<div style="border: 1px solid #F0E68C; border-left-width:1.5em; padding: 2px;">Khaki</div>
  −
<div style="border: 1px solid #EEE8AA; border-left-width:1.5em; padding: 2px;">PaleGoldenrod</div>
  −
<div style="border: 1px solid #BDB76B; border-left-width:1.5em; padding: 2px;">DarkKhaki</div>
  −
<div style="border: 1px solid #FFFFF0; border-left-width:1.5em; padding: 2px;">Ivory</div>
  −
<div style="border: 1px solid #F5F5DC; border-left-width:1.5em; padding: 2px;">Beige</div>
  −
<div style="border: 1px solid #FFFFE0; border-left-width:1.5em; padding: 2px;">LightYellow</div>
  −
<div style="border: 1px solid #FAFAD2; border-left-width:1.5em; padding: 2px;">LightGoldenrodYellow</div>
  −
<div style="border: 1px solid #808000; border-left-width:1.5em; padding: 2px;">Olive</div>
  −
<div style="border: 1px solid #FF0; border-left-width:1.5em; padding: 2px;">Yellow</div>
  −
<div style="border: 1px solid #6B8E23; border-left-width:1.5em; padding: 2px;">OliveDrab</div>
  −
<div style="border: 1px solid #9ACD32; border-left-width:1.5em; padding: 2px;">YellowGreen</div>
  −
<div style="border: 1px solid #556B2F; border-left-width:1.5em; padding: 2px;">DarkOliveGreen</div>
  −
<div style="border: 1px solid #ADFF2F; border-left-width:1.5em; padding: 2px;">GreenYellow</div>
  −
<div style="border: 1px solid #7FFF00; border-left-width:1.5em; padding: 2px;">Chartreuse</div>
  −
<div style="border: 1px solid #7CFC00; border-left-width:1.5em; padding: 2px;">LawnGreen</div>
  −
<div style="border: 1px solid #8FBC8B; border-left-width:1.5em; padding: 2px;">DarkSeaGreen</div>
  −
<div style="border: 1px solid #F0FFF0; border-left-width:1.5em; padding: 2px;">Honeydew</div>
  −
<div style="border: 1px solid #98FB98; border-left-width:1.5em; padding: 2px;">PaleGreen</div>
  −
<div style="border: 1px solid #90EE90; border-left-width:1.5em; padding: 2px;">LightGreen</div>
  −
<div style="border: 1px solid #228B22; border-left-width:1.5em; padding: 2px;">ForestGreen</div>
  −
<div style="border: 1px solid #32CD32; border-left-width:1.5em; padding: 2px;">LimeGreen</div>
  −
<div style="border: 1px solid #006400; border-left-width:1.5em; padding: 2px;">DarkGreen</div>
  −
<div style="border: 1px solid #008000; border-left-width:1.5em; padding: 2px;">Green</div>
  −
<div style="border: 1px solid #0F0; border-left-width:1.5em; padding: 2px;">Lime</div>
  −
<div style="border: 1px solid #2E8B57; border-left-width:1.5em; padding: 2px;">SeaGreen</div>
  −
<div style="border: 1px solid #3CB371; border-left-width:1.5em; padding: 2px;">MediumSeaGreen</div>
  −
<div style="border: 1px solid #00FF7F; border-left-width:1.5em; padding: 2px;">SpringGreen</div>
  −
<div style="border: 1px solid #F5FFFA; border-left-width:1.5em; padding: 2px;">MintCream</div>
  −
<div style="border: 1px solid #00FA9A; border-left-width:1.5em; padding: 2px;">MediumSpringGreen</div>
  −
<div style="border: 1px solid #66CDAA; border-left-width:1.5em; padding: 2px;">MediumAquamarine</div>
  −
<div style="border: 1px solid #7FFFD4; border-left-width:1.5em; padding: 2px;">Aquamarine</div>
  −
<div style="border: 1px solid #40E0D0; border-left-width:1.5em; padding: 2px;">Turquoise</div>
  −
<div style="border: 1px solid #20B2AA; border-left-width:1.5em; padding: 2px;">LightSeaGreen</div>
  −
<div style="border: 1px solid #48D1CC; border-left-width:1.5em; padding: 2px;">MediumTurquoise</div>
  −
<div style="border: 1px solid #F0FFFF; border-left-width:1.5em; padding: 2px;">Azure</div>
  −
<div style="border: 1px solid #E0FFFF; border-left-width:1.5em; padding: 2px;">LightCyan</div>
  −
<div style="border: 1px solid #AFEEEE; border-left-width:1.5em; padding: 2px;">PaleTurquoise</div>
  −
<div style="border: 1px solid #2F4F4F; border-left-width:1.5em; padding: 2px;">DarkSlateGray</div>
  −
<div style="border: 1px solid #008080; border-left-width:1.5em; padding: 2px;">Teal</div>
  −
<div style="border: 1px solid #008B8B; border-left-width:1.5em; padding: 2px;">DarkCyan</div>
  −
<div style="border: 1px solid #0FF; border-left-width:1.5em; padding: 2px;">Aqua</div>
  −
<div style="border: 1px solid #0FF; border-left-width:1.5em; padding: 2px;">Cyan</div>
  −
<div style="border: 1px solid #00CED1; border-left-width:1.5em; padding: 2px;">DarkTurquoise</div>
  −
<div style="border: 1px solid #5F9EA0; border-left-width:1.5em; padding: 2px;">CadetBlue</div>
  −
<div style="border: 1px solid #B0E0E6; border-left-width:1.5em; padding: 2px;">PowderBlue</div>
  −
<div style="border: 1px solid #ADD8E6; border-left-width:1.5em; padding: 2px;">LightBlue</div>
  −
<div style="border: 1px solid #00BFFF; border-left-width:1.5em; padding: 2px;">DeepSkyBlue</div>
  −
<div style="border: 1px solid #87CEEB; border-left-width:1.5em; padding: 2px;">SkyBlue</div>
  −
<div style="border: 1px solid #87CEFA; border-left-width:1.5em; padding: 2px;">LightSkyBlue</div>
  −
<div style="border: 1px solid #4682B4; border-left-width:1.5em; padding: 2px;">SteelBlue</div>
  −
<div style="border: 1px solid #F0F8FF; border-left-width:1.5em; padding: 2px;">AliceBlue</div>
  −
<div style="border: 1px solid #1E90FF; border-left-width:1.5em; padding: 2px;">DodgerBlue</div>
  −
<div style="border: 1px solid #708090; border-left-width:1.5em; padding: 2px;">SlateGray</div>
  −
<div style="border: 1px solid #789; border-left-width:1.5em; padding: 2px;">LightSlateGray</div>
  −
<div style="border: 1px solid #B0C4DE; border-left-width:1.5em; padding: 2px;">LightSteelBlue</div>
  −
<div style="border: 1px solid #6495ED; border-left-width:1.5em; padding: 2px;">CornflowerBlue</div>
  −
<div style="border: 1px solid #4169E1; border-left-width:1.5em; padding: 2px;">RoyalBlue</div>
  −
<div style="border: 1px solid #F8F8FF; border-left-width:1.5em; padding: 2px;">GhostWhite</div>
  −
<div style="border: 1px solid #E6E6FA; border-left-width:1.5em; padding: 2px;">Lavender</div>
  −
<div style="border: 1px solid #191970; border-left-width:1.5em; padding: 2px;">MidnightBlue</div>
  −
<div style="border: 1px solid #000080; border-left-width:1.5em; padding: 2px;">Navy</div>
  −
<div style="border: 1px solid #00008B; border-left-width:1.5em; padding: 2px;">DarkBlue</div>
  −
<div style="border: 1px solid #0000CD; border-left-width:1.5em; padding: 2px;">MediumBlue</div>
  −
<div style="border: 1px solid #00F; border-left-width:1.5em; padding: 2px;">Blue</div>
  −
<div style="border: 1px solid #6A5ACD; border-left-width:1.5em; padding: 2px;">SlateBlue</div>
  −
<div style="border: 1px solid #483D8B; border-left-width:1.5em; padding: 2px;">DarkSlateBlue</div>
  −
<div style="border: 1px solid #7B68EE; border-left-width:1.5em; padding: 2px;">MediumSlateBlue</div>
  −
<div style="border: 1px solid #9370DB; border-left-width:1.5em; padding: 2px;">MediumPurple</div>
  −
<div style="border: 1px solid #8A2BE2; border-left-width:1.5em; padding: 2px;">BlueViolet</div>
  −
<div style="border: 1px solid #4B0082; border-left-width:1.5em; padding: 2px;">Indigo</div>
  −
<div style="border: 1px solid #9932CC; border-left-width:1.5em; padding: 2px;">DarkOrchid</div>
  −
<div style="border: 1px solid #9400D3; border-left-width:1.5em; padding: 2px;">DarkViolet</div>
  −
<div style="border: 1px solid #BA55D3; border-left-width:1.5em; padding: 2px;">MediumOrchid</div>
  −
<div style="border: 1px solid #D8BFD8; border-left-width:1.5em; padding: 2px;">Thistle</div>
  −
<div style="border: 1px solid #DDA0DD; border-left-width:1.5em; padding: 2px;">Plum</div>
  −
<div style="border: 1px solid #EE82EE; border-left-width:1.5em; padding: 2px;">Violet</div>
  −
<div style="border: 1px solid #800080; border-left-width:1.5em; padding: 2px;">Purple</div>
  −
<div style="border: 1px solid #8B008B; border-left-width:1.5em; padding: 2px;">DarkMagenta</div>
  −
<div style="border: 1px solid #F0F; border-left-width:1.5em; padding: 2px;">Fuchsia</div>
  −
<div style="border: 1px solid #F0F; border-left-width:1.5em; padding: 2px;">Magenta</div>
  −
<div style="border: 1px solid #DA70D6; border-left-width:1.5em; padding: 2px;">Orchid</div>
  −
<div style="border: 1px solid #C71585; border-left-width:1.5em; padding: 2px;">MediumVioletRed</div>
  −
<div style="border: 1px solid #FF1493; border-left-width:1.5em; padding: 2px;">DeepPink</div>
  −
<div style="border: 1px solid #FF69B4; border-left-width:1.5em; padding: 2px;">HotPink</div>
  −
<div style="border: 1px solid #FFF0F5; border-left-width:1.5em; padding: 2px;">LavenderBlush</div>
  −
<div style="border: 1px solid #DB7093; border-left-width:1.5em; padding: 2px;">PaleVioletRed</div>
  −
<div style="border: 1px solid #DC143C; border-left-width:1.5em; padding: 2px;">Crimson</div>
  −
<div style="border: 1px solid #FFC0CB; border-left-width:1.5em; padding: 2px;">Pink</div>
  −
<div style="border: 1px solid #FFB6C1; border-left-width:1.5em; padding: 2px;">LightPink</div>
  −
}}
  −
| <samp>ForestGreen</samp>
   
|-
 
|-
| A [https://en.wikipedia.org/wiki/Web_colors#Hex_triplet hexadecimal color code]. The optional alpha is a value between <samp>00</samp> (transparent) and <samp>FF</samp> (opaque).
+
| <samp>Buildings/houses</samp>
| <samp>#228B22</samp><br /><samp>#228B22FF</samp>
+
| &#32;
 +
* fixed missing pixels
 +
| ✘ will remove changes
 +
| ✓ mostly unaffected
 
|-
 
|-
| An [https://en.wikipedia.org/wiki/RGB_color_model#Numeric_representations 8-bit RGB color code]. The optional alpha is a value between <samp>0</samp> (transparent) and <samp>255</samp> (opaque).
+
| <samp>Characters/Dialogue/Abigail</samp><br /><samp>Characters/Dialogue/Alex</samp>
| <samp>34 139 34</samp><br /><samp>34 139 34 255</samp>
+
| &#32;
|}
+
* added [[#Dialogue changes|flower dance dialogue]]
 
+
* fixed typos
C# mods can parse a color like <code>Utility.StringToColor("White")</code>.
+
| '''✘ broken'''
 
+
| ✓ mostly unaffected
===More <samp>modData</samp> fields===
  −
The <samp>modData</samp> fields are dictionaries of arbitrary string values which are synchronized in multiplayer and persisted in the save file, so mods can store custom data about the instances. The game already has the field for buildings, characters (including NPCs and players), items, locations, and terrain features.
  −
 
  −
Stardew Valley 1.6 adds <samp>modData</samp> fields to the <samp>Projectile</samp> and <samp>Quest</samp> types too, to support custom projectile/quest mods.
  −
 
  −
===Quantity modifiers===
  −
''Quantity modifiers'' apply dynamic changes to a numeric field in a data asset like [[#Custom shops|<samp>Data/Shops</samp>]] or [[#Custom machines|<samp>Data/Machines</samp>]]. For example, you can multiply a shop item's price or increase a machine output's quality. You can specify any number of modifiers for the same field.
  −
 
  −
====Modifier format====
  −
These consist of a list of models with these fields:
  −
{| class="wikitable"
   
|-
 
|-
! field
+
| <samp>Characters/Dialogue/Caroline</samp><br /><samp>Characters/Dialogue/Demetrius</samp>
! effect
+
| &#32;
 +
* fixed typos
 +
| ✘ will remove changes
 +
| ✓ mostly unaffected
 
|-
 
|-
| <samp>Id</samp>
+
| <samp>Characters/Dialogue/Elliott</samp>
| The [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for this modifier within the current list.
+
| &#32;
 +
* added [[#Dialogue changes|flower dance dialogue]]
 +
| '''✘ broken'''
 +
| ✓ mostly unaffected
 
|-
 
|-
| <samp>Modification</samp>
+
| <samp>Characters/Dialogue/Emily</samp>
| The type of change to apply. The possible values are <samp>Add</samp>, <samp>Subtract</samp>, <samp>Multiply</samp>, <samp>Divide</samp>, and <samp>Set</samp>.
+
| &#32;
 +
* added [[#Dialogue changes|flower dance dialogue]]
 +
* fixed typos
 +
* updated <samp>%revealtaste</samp> format (backwards-compatible)
 +
| '''✘ broken'''
 +
| ✓ mostly unaffected
 
|-
 
|-
| <samp>Amount</samp>
+
| <samp>Characters/Dialogue/George</samp>
| ''(Optional if <samp>RandomAmount</samp> specified)'' The operand applied to the target value (e.g. the multiplier if used with <samp>Multiply</samp>).
+
| &#32;
 +
* added [[#Dialogue changes|Winter Star gift exchange dialogue]]
 +
| '''✘ broken'''
 +
| ✓ mostly unaffected
 
|-
 
|-
| <samp>RandomAmount</samp>
+
| <samp>Characters/Dialogue/Gus</samp>
| ''(Optional)'' A list of possible amounts to randomly choose from. If set, <samp>Amount</samp> is optional and ignored. Each entry in the list has an equal probability of being chosen, and the choice is persisted for the current day. For example:
+
| &#32;
<syntaxhighlight lang="js">
+
* fixed typos
"RandomAmount": [ 1, 2, 3.5, 4 ]
+
| ✘ will remove changes
</syntaxhighlight>
+
| ✓ mostly unaffected
 
|-
 
|-
| <samp>Condition</samp>
+
| <samp>Characters/Dialogue/Haley</samp>
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether this change should be applied. Defaults to always true.
+
| &#32;
|}
+
* added [[#Dialogue changes|flower dance dialogue]]
 
+
* fixed typos
====Modifier mode====
+
| '''✘ broken'''
Quality modifier fields are often accompanied by a ''mode'' field (like <samp>PriceModifiers</samp> and <samp>PriceModifierMode</samp>), which indicate what to do when multiple modifiers apply to the same value. Available modes:
+
| ✓ mostly unaffected
 
  −
{| class="wikitable"
   
|-
 
|-
! value
+
| <samp>Characters/Dialogue/Harvey</samp>
! effect
+
| &#32;
 +
* added [[#Dialogue changes|flower dance dialogue]]
 +
| '''✘ broken'''
 +
| ✓ mostly unaffected
 
|-
 
|-
| <samp>Stack</samp>
+
| <samp>Characters/Dialogue/Jas</samp><br /><samp>Characters/Dialogue/Jodi</samp>
| Apply each modifier to the result of the previous one. For example, two modifiers which double a value will quadruple it.
+
| &#32;
 +
* fixed typos
 +
| ✘ will remove changes
 +
| ✓ mostly unaffected
 
|-
 
|-
| <samp>Minimum</samp>
+
| <samp>Characters/Dialogue/Krobus</samp>
| Apply the modifier which results in the lowest value.
+
| &#32;
|-
+
* added [[#Dialogue changes|roommate stardrop dialogue]]
| <samp>Maximum</samp>
+
| '''✘ broken'''
| Apply the modifier which results in the highest value.
+
| ✓ mostly unaffected
|}
+
|-
 
+
| <samp>Characters/Dialogue/Leah</samp>
====Examples====
+
| &#32;
For example, this will double the price of a shop item in <samp>Data/Shops</samp>:
+
* added [[#Dialogue changes|flower dance dialogue]]
<syntaxhighlight lang="js">
+
| '''✘ broken'''
"PriceModifiers": [
+
| ✓ mostly unaffected
    {
+
|-
        "Modification": "Multiply",
+
| <samp>Characters/Dialogue/Lewis</samp>
        "Amount": 2.0
+
| &#32;
    }
+
* updated <samp>%revealtaste</samp> format (backwards-compatible)
]
+
|
</syntaxhighlight>
+
|
 
+
|-
This will set the price to a random value between 100–1000, ''or'' 3–5 times the item's normal sell price, whichever is higher (like the [[Traveling Cart]]):
+
| <samp>Characters/Dialogue/Linus</samp>
<syntaxhighlight lang="js">
+
| &#32;
"PriceModifierMode": "Maximum",
+
* added [[#Dialogue changes|dumpster dive dialogue]]
"PriceModifiers": [
+
* fixed typos
    {
+
| '''✘ broken'''
        "Modification": "Set",
+
| ✓ mostly unaffected
        "RandomAmount": [ 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000 ]
+
|-
    },
+
| <samp>Characters/Dialogue/Marnie</samp>
    {
+
| &#32;
        "Modification": "Multiply",
+
* added [[#Dialogue changes|Stardew Valley Fair dialogue]]
        "RandomAmount": [ 3, 4, 5 ]
+
| '''✘ broken'''
    }
+
| ✓ mostly unaffected
]
+
|-
</syntaxhighlight>
+
| <samp>Characters/Dialogue/MarriageDialogue</samp><br /><samp>Characters/Dialogue/MarriageDialogueAbigail</samp><br /><samp>Characters/Dialogue/MarriageDialogueElliott</samp>
 
+
| &#32;
===Tokenizable string format===
+
* fixed typos
Stardew Valley 1.6 adds ''tokenizable strings'', which support any combination of literal text and token values. That includes a set of built-in tokens like <samp>FarmName</samp>, <samp>LocalizedText</samp>, etc.
+
| ✘ will remove changes
 
+
| ✓ mostly unaffected
For example, previously you often needed to load text from a [[Modding:Modder Guide/Game Fundamentals#String keys|translation string key]]. With this new format, you can use the literal text directly in the asset instead (including [[Modding:Content Patcher|Content Patcher]] tokens):
+
|-
 
+
| <samp>Characters/Dialogue/MarriageDialogueEmily</samp>
<syntaxhighlight lang="js">
+
| &#32;
// before
+
* changed <samp>spring_Maru</samp> key to <samp>spring_Emily</samp>
"Dialogue": "Strings\\StringsFromCSFiles:ShopMenu.cs.11488",
+
* fixed typos
 
+
| '''✘ broken'''
// after: any combination of literal text and tokens
+
| ✓ mostly unaffected
"Dialogue": "Welcome to Pierre's, {{PlayerName}}! How is [FarmName] doing?",
+
|-
</syntaxhighlight>
+
| <samp>Characters/Dialogue/MarriageDialogueKrobus</samp><br /><samp>Characters/Dialogue/MarriageDialogueLeah</samp><br /><samp>Characters/Dialogue/MarriageDialogueMaru</samp><br /><samp>Characters/Dialogue/MarriageDialoguePenny</samp><br /><samp>Characters/Dialogue/MarriageDialogueSam</samp>
 
+
| &#32;
Tokenizable strings are only usable in specific fields (as indicated in their wiki or code docs).
+
* fixed typos
 
+
| ✘ will remove changes
See [[Modding:Tokenizable strings]] for usage.
+
| ✓ mostly unaffected
 
+
|-
===[[Modding:Event data|Event]] changes===
+
| <samp>Characters/Dialogue/Maru</samp>
====High-level changes====
+
| &#32;
* Event IDs are now [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string IDs]], so mods can use a unique key instead of hoping no other mod uses the same number. Unconditional events must have an empty precondition in their key (like <samp>"Example.ModId_EventName/"</samp>) to distinguish them from forks.
+
* added [[#Dialogue changes|flower dance dialogue]]
* Event/festival commands with a direction argument now allow both case-insensitive names (like <samp>up</samp>) and numeric values.
+
* fixed typos
* Event script errors are now logged (in addition to being shown in the chatbox like before).
+
| '''✘ broken'''
* For C# mods:
+
| ✓ mostly unaffected
** You can now add custom event preconditions & commands using new <samp>Event</samp> methods (<samp>RegisterPrecondition</samp>, <samp>RegisterPreconditionAlias</samp>, <samp>RegisterCommand</samp>, and <samp>RegisterCommandAlias</samp>).
+
|-
** Added <samp>Event.fromAssetName</samp>, which indicates which data asset (if any) the event was loaded from.
+
| <samp>Characters/Dialogue/Penny</samp>
** Added <samp>Game1.eventsSeenSinceLastLocationChange</samp> to track the events that played since the player arrived in their current location.
+
| &#32;
 
+
* added [[#Dialogue changes|flower dance dialogue]]
====Precondition changes====
+
| '''✘ broken'''
<ul>
+
| ✓ mostly unaffected
<li>Added validation for preconditions. If a format or assumption is invalid, the game now logs a detailed error.</li>
  −
<li>Added case-insensitive readable names for all preconditions. For example, <code>j 4/t 800 1300/a 0 54/H</code> can now optionally be written <code>daysPlayed 4/time 800 1300/tile 0 54/isHost</code>.
  −
{{collapse|list of new names|content=
  −
List of new event precondition names:
  −
<pre>
  −
alias | readable name
  −
----- | ------------------------------
  −
*    | WorldState
  −
*n    | HostOrLocalMail
  −
a    | Tile
  −
b    | ReachedMineBottom
  −
B    | SpouseBed
  −
C    | CommunityCenterOrWarehouseDone
  −
c    | FreeInventorySlots
  −
D    | Dating
  −
e    | SawEvent
  −
f    | Friendship
  −
g    | Gender
  −
H    | IsHost
  −
h    | MissingPet
  −
Hn    | HostMail
  −
i    | HasItem
  −
j    | DaysPlayed
  −
J    | JojaBundlesDone
  −
L    | InUpgradedHouse
  −
m    | EarnedMoney
  −
M    | HasMoney
  −
N    | GoldenWalnuts
  −
n    | LocalMail
  −
O    | Spouse
  −
p    | NpcVisibleHere
  −
q    | ChoseDialogueAnswers
  −
r    | Random
  −
R    | Roommate
  −
S    | SawSecretNote
  −
s    | Shipped
  −
t    | Time
  −
u    | DayOfMonth
  −
v    | NpcVisible
  −
w    | Weather
  −
x    | SendMail
  −
y    | Year
  −
</pre>
  −
And for deprecated preconditions (e.g. <code>NotSeason</code> is superseded by <code>!Season</code>):
  −
<pre>
  −
alias | readable name
  −
----- | ---------------------------------
  −
*l    | NotHostOrLocalMail
  −
A    | NotActiveDialogueEvent
  −
d    | NotDayOfWeek
  −
F    | NotFestivalDay
  −
Hl    | NotHostMail
  −
k    | NotSawEvent
  −
l    | NotLocalMail
  −
o    | NotSpouse
  −
Rf    | NotRoommate
  −
U    | NotUpcomingFestival
  −
X    | NotCommunityCenterOrWarehouseDone
  −
z    | NotSeason
  −
</pre>
  −
}}
  −
</li>
  −
<li>Event & preconditions are now quote-aware, so you can escape spaces and slashes in arguments like <code>/G "SEASON Spring"/</code>.</li>
  −
<li>Added new preconditions:
  −
{| class="wikitable"
   
|-
 
|-
! precondition
+
| <samp>Characters/Dialogue/Pierre</samp>
! description
+
| &#32;
|-
+
* added [[#Dialogue changes|Stardew Valley Fair dialogue]]
| <samp>!</samp>
+
* fixed typos
| Prefixing <samp>!</samp> to any other precondition will now invert it. For example, <code>!spouse Abigail</code> will match if the player is ''not'' married to Abigail.
+
| '''✘ broken'''
 +
| ✓ mostly unaffected
 
|-
 
|-
| <samp>ActiveDialogueEvent {{t|id}}</samp>
+
| <samp>Characters/Dialogue/Robin</samp>
| The special dialogue event with the given ID (including [[Modding:Dialogue#Conversation_topics|Conversation Topics]]) is in progress.
+
| &#32;
 +
* fixed typos
 +
| ✘ will remove changes
 +
| ✓ mostly unaffected
 
|-
 
|-
| <samp>DayOfWeek {{t|day}}+</samp>
+
| <samp>Characters/Dialogue/Sam</samp>
| Today is one of the specified days (may specify multiple days). This can be a case-insensitive three-letter abbreviation (like <samp>Mon</samp>) or full name (like <samp>Monday</samp>).
  −
|-
  −
| <samp>FestivalDay</samp>
  −
| Today is a [[Festivals|festival]] day.
  −
|-
  −
| <samp>GameStateQuery {{t|query}}</samp>
  −
| A [[Modding:Game state queries|game state query]] matches, like <code>G !WEATHER Here Sun</code> for 'not sunny in this location'.
  −
|-
  −
| <samp>Season {{t|season}}+</samp>
  −
| The current season is one of the given values (may specify multiple seasons).
  −
|-
  −
| <samp>Skill {{t|skill name}} {{t|min level}}</samp>
  −
| The current farmer has reached at least {{t|min level}} for the given {{t|skill name}} (one of <samp>Combat</samp>, <samp>Farming</samp>, <samp>Fishing</samp>, <samp>Foraging</samp>, <samp>Luck</samp>, or <samp>Mining</samp>).
  −
|-
  −
| <samp>UpcomingFestival {{t|day offset}}</samp>
  −
| A [[Festivals|festival]] day will occur within the given number of days.
  −
|}</li>
  −
<li>Changed specific preconditions:
  −
{| class="wikitable"
  −
|-
  −
! name
  −
! changes
  −
|-
  −
| <samp>ChoseDialogueAnswers</samp> (<samp>q</samp>)
   
| &#32;
 
| &#32;
* Fixed precondition ignoring every second answer ID.
+
* added [[#Dialogue changes|flower dance dialogue]]
 +
* fixed typos
 +
| '''✘ broken'''
 +
| ✓ mostly unaffected
 
|-
 
|-
| <samp>InUpgradedHouse</samp> (<samp>L</samp>)
+
| <samp>Characters/Dialogue/Sandy</samp>
 
| &#32;
 
| &#32;
* Added optional argument for the min upgrade level.
+
* fixed typos
 +
| ✘ will remove changes
 +
| ✓ mostly unaffected
 
|-
 
|-
| <samp>MissingPet</samp> (<samp>h</samp>)
+
| <samp>Characters/Dialogue/Sebastian</samp>
 
| &#32;
 
| &#32;
* You can now specify any pet type ID.
+
* added [[#Dialogue changes|flower dance dialogue]]
* You can now omit the argument to check for a pet of any type.
+
* fixed typos
 +
| '''✘ broken'''
 +
| ✓ mostly unaffected
 
|-
 
|-
| <samp>NotDayOfWeek</samp> (<samp>d</samp>)
+
| <samp>Characters/Dialogue/Willy</samp>
 +
| &#32;
 +
* added [[#Dialogue changes|Stardew Valley Fair dialogue]]
 +
| '''✘ broken'''
 +
| ✓ mostly unaffected
 +
|-
 +
| <samp>Characters/Dialogue/Shane</samp>
 +
| &#32;
 +
* added [[#Dialogue changes|flower dance dialogue]]
 +
| '''✘ broken'''
 +
| ✓ mostly unaffected
 +
|-
 +
| <samp>Characters/Farmer/hats</samp>
 
| &#32;
 
| &#32;
* You can now specify a full name like <samp>Monday</samp>.
+
* removed stray pixel on chicken mask
* The day of week is now case-insensitive.
+
| ✘ will remove changes
 +
| ✓ mostly unaffected
 
|-
 
|-
| <samp>NotSeason</samp> (<samp>z</samp>)
+
| <samp>Characters/schedules/Elliott</samp>
 
| &#32;
 
| &#32;
* You can now list values (like <code>notSeason spring summer fall</code> instead of <code>notSeason fall/notSeason winter/notSeason fall</code>).
+
* fixed order of <samp>Fri_6</samp> and <samp>Fri</samp> entries
 +
| '''✘ broken'''
 +
|
 
|-
 
|-
| <samp>ReachedMineBottom</samp> (<samp>b</samp>)
+
| <samp>Characters/schedules/Lewis</samp>
 
| &#32;
 
| &#32;
* Argument is now optional (default 1).
+
* fixed <samp>winter_Sun</samp> schedule
 +
| '''✘ broken'''
 +
| ✓ mostly unaffected
 
|-
 
|-
| <samp>SendMail</samp> (<samp>x</samp>)
+
| <samp>Characters/schedules/Maru</samp>
 
| &#32;
 
| &#32;
* Deprecated; see [[#Send-mail (x) precondition deprecated|''Send-mail (x) precondition deprecated'']] for more info.
+
* fixed <samp>summer_Mon</samp> and <samp>summer_Sun</samp> schedules
 +
| '''✘ broken'''
 +
| ✓ mostly unaffected
 
|-
 
|-
| <samp>Tile</samp> (<samp>a</samp>)
+
| <samp>Characters/schedules/Penny</samp>
 
| &#32;
 
| &#32;
* Now also works when the player isn't currently warping, in which case it checks their current tile instead of their warp arrival tile.
+
* fixed <samp>summer_Sun</samp> schedule
|}</li>
+
| '''✘ broken'''
</ul>
+
| ✓ mostly unaffected
 
+
|-
====Command changes====
+
| <samp>Characters/Schedules/Shane</samp>
<ul>
+
| &#32;
<li>Added validation for event commands. If a format or assumption is invalid, the game now logs a detailed error and (if applicable) skips the command, instead of crashing or silently ignoring it. This also means event arguments are stricter (e.g. you can no longer set a true/false field to an invalid value, inner quotes in quoted arguments now need to be escaped, etc).</li>
+
* fixed dialogue key
<li>Event commands are now quote-aware, so you can escape spaces and slashes in arguments like <code>/speak "I'm running A/B tests"/</code>.</li>
+
| ✘ will remove changes
<li>Event commands now trim surrounding whitespace, so they can be multilined for readability. Line breaks must be before or after the <samp>/</samp> delimiter. For example:
+
| ✓ mostly unaffected
<syntaxhighlight lang="js">
  −
"SomeEventId/": "
  −
    none/
  −
    -1000 -1000/
  −
    farmer 5 7 0/
  −
    ...
  −
"
  −
</syntaxHighlight>
  −
This can be also combined with the [[Modding:Event data#Comments|comment syntax]] to add notes. For example:
  −
<syntaxhighlight lang="js">
  −
"SomeEventId/": "
  −
    none/            -- music/
  −
    -1000 -1000/    -- initial viewport position/
  −
    farmer 5 7 0/    -- actor positions/
  −
    ...
  −
"
  −
</syntaxHighlight>
  −
</li>
  −
<li>You can now mark NPCs optional in event commands by suffixing their name with <code>?</code>. For example, <code>jump Kent?</code> won't log an error if Kent is missing. When used in the initial event positions, the NPC is only added in they exist in <samp>Data/Characters</samp> and their <samp>UnlockConditions</samp> match.</li>
  −
<li>Added new event commands:
  −
{| class="wikitable"
   
|-
 
|-
! command
+
| <samp>Data/animationDescriptions</samp>
! description
+
| &#32;
 +
* fixed frame in Lewis' Saloon drinking animation
 +
| ✘ will remove changes
 +
| ✓ mostly unaffected
 
|-
 
|-
| <samp>action {{t|action}}</samp>
+
| <samp>Data/AquariumFish</samp>
| Run a [[Modding:Trigger actions|trigger action string]], like <samp>action AddMoney 500</samp> to add {{price|500}} to the current player.
+
| &#32;
 +
* [[#Custom items|changed key type]]
 +
* added hat position for [[Sea Urchin]]
 +
| '''✘ broken'''
 +
| ✓ mostly unaffected
 
|-
 
|-
| <samp>addItem {{t|item ID}} {{o|count}} {{o|quality}}</samp>
+
| <samp>Data/BigCraftablesInformation</samp>
| Add an item to the player inventory (or open a grab menu if their inventory is full). The {{t|item ID}} is the [[#Custom items|qualified or unqualified item ID]], and {{o|quality}} is a [[Modding:Items#Quality|numeric quality value]].
+
| &#32;
 +
* asset replaced by [[#Custom big craftables|<samp>Data/BigCraftables</samp>]]:
 +
** migrated to data model format
 +
** added new features
 +
| '''✘ broken'''
 +
| ✓ mostly unaffected<br /><small>(covered by runtime migration)</small>
 
|-
 
|-
| <samp>addSpecialOrder {{t|order ID}}</samp><br /><samp>removeSpecialOrder {{t|order ID}}</samp>
+
| <samp>Data/Blueprints</samp>
| Add or remove a special order to the player team. This affects all players, since special orders are shared.
+
| &#32;
 +
* asset replaced by [[#Custom buildings|<samp>Data/Buildings</samp>]]:
 +
** migrated to data model format
 +
** added new features
 +
| '''✘ broken'''
 +
| ✓ mostly unaffected<br /><small>(covered by runtime migration)</small>
 
|-
 
|-
| <samp>eventSeen {{t|event ID}} {{o|seen}}</samp>
+
| <samp>Data/Boots</samp>
| Add or remove an event ID from the player's list of seen events, based on {{o|seen}} (default <samp>true</samp> to add).
+
| &#32;
 
+
* [[#Custom items|changed key type]]
An event can mark ''itself'' unseen using <samp>eventSeen {{t|event ID}} false</samp>. This takes effect immediately (i.e. the event won't be added to the list when it completes), but the game will prevent the event from playing again until the player changes location to avoid event loops. The event will still replay when re-entering the location.
+
* added display name
 +
| '''✘ broken'''
 +
| ✓ mostly unaffected<br /><small>(covered by runtime migration)</small>
 
|-
 
|-
| <samp>mailToday {{t|mail key}}</samp>
+
| <samp>Data/Bundles</samp>
| Adds a letter to the mailbox immediately, given the {{t|mail key}} in <samp>Data/Mail</samp>.
+
| &#32;
 +
* can no longer omit empty fields before display name
 +
* added display name field in English
 +
* removed meat items in animal bundle
 +
| '''✘ broken'''
 +
| '''✘ likely broken'''
 
|-
 
|-
| <samp>questionAnswered {{t|answer ID}} {{o|answered}}</samp>
+
| <samp>Data/ClothingInformation</samp>
| Add or remove an answer ID from the player's list of chosen dialogue answers, based on {{o|answered}} (default <samp>true</samp> to add).
+
| &#32;
 +
* asset replaced by [[#Custom pants|<samp>Data/Pants</samp>]] and [[#Custom shirts|<samp>Data/Shirts</samp>]]:
 +
** migrated to data model format
 +
** added new features
 +
| '''✘ broken'''
 +
| '''✘ likely broken'''
 
|-
 
|-
| <samp>replaceWithClone {{t|NPC name}}</samp>
+
| <samp>Data/Concessions</samp>
| Replace an NPC already in the event with a temporary copy. This allows changing the NPC for the event without affecting the real NPC.
+
| &#32;
 
+
* [[#Custom movie concessions|added new required fields (<samp>Texture</samp> and <samp>SpriteIndex</samp>)]]
For example, this event changes Marnie's name/portrait only within the event:
+
* replaced translations with [[Modding:Tokenizable strings|tokenizable strings]]
<syntaxhighlight lang="js">
+
* changed IDs to strings
"Some.ModId_ExampleEvent/": "continue/64 15/farmer 64 15 2 Marnie 64 17 0/replaceWithClone Marnie/changeName Marnie Pufferchick/changePortrait Marnie Pufferchick/[...]/end"
+
| '''✘ broken'''
</syntaxhighlight>
+
| '''✘ likely broken'''
 
|-
 
|-
| <samp>setSkipActions {{o|actions}}</samp>
+
| <samp>Data/ConcessionTastes</samp>
| Set [[Modding:Trigger actions|trigger actions]] that should run if the player skips the event. You can list multiple actions delimited with <samp>#</samp>, or omit {{o|actions}} so no actions are run. When the player skips, the last <samp>setSkipActions</samp> before that point is applied.
+
| &#32;
 
+
* added automatic <samp>ID</samp> field
For example, this adds the [[Garden Pot|garden pot]] recipe and item to the player if the event is skipped, but avoids adding the item if the event already did it:
+
| '''✘ broken'''
<pre>
+
| ✓ mostly unaffected
/setSkipActions AddCraftingRecipe Current "Garden Pot"#AddItem (BC)62
  −
/skippable
  −
/...
  −
/addItem (BC)62
  −
/setSkipActions AddCraftingRecipe Current "Garden Pot"
  −
</pre>
  −
 
  −
Skip actions aren't applied if the event completes normally without being skipped.
   
|-
 
|-
| <samp>stopSound {{t|sound ID}} {{o|immediate}}</samp>
+
| <samp>Data/CookingRecipes</samp>
| Stop a sound started with the <samp>startSound</samp> command. This has no effect if the sound has already stopped playing on its own (or hasn't been started). If you started multiple sounds with the same ID, this will stop all of them (e.g. <code>startSound fuse/startSound fuse/stopSound fuse</code>).
+
| &#32;
 
+
* replaced translations with [[Modding:Tokenizable strings|tokenizable strings]]
By default the sound will stop immediately. For looping sounds, you can pass <samp>false</samp> to the {{o|immediate}} argument to stop the sound when it finishes playing the current iteration instead (e.g. <code>stopSound fuse false</code>).
+
* display names can now be omitted to use item name
 +
| ✘ will remove changes
 +
| ✓ may remove unaffected
 
|-
 
|-
| <samp>temporaryAnimatedSprite ...</samp>
+
| <samp>Data/CraftingRecipes</samp>
| Add a temporary animated sprite to the event, using these space-delimited fields:
+
| &#32;
{| class="wikitable"
+
* replaced translations with [[Modding:Tokenizable strings|tokenizable strings]]
 +
* display names can now be omitted to use item name
 +
* added <samp>default</samp> unlock condition
 +
* fixed typo in Cookout Kit entry
 +
| '''✘ broken'''
 +
| ✓ mostly unaffected
 
|-
 
|-
! index
+
| <samp>Data/Crops</samp>
! field
+
| &#32;
! effect
+
* [[#Custom crops|completely overhauled]]
 +
| '''✘ broken'''
 +
| ✓ mostly unaffected<br /><small>(covered by runtime migration)</small>
 
|-
 
|-
| 0
+
| <samp>Data/Events/AnimalShop</samp>
| <samp>texture</samp>
+
| &#32;
| The asset name for texture to draw.
+
* updated command syntax (backwards-compatible)
 +
|
 +
|
 
|-
 
|-
| 1&ndash;4
+
| <samp>Data/Events/Farm</samp>
| <samp>rectangle</samp>
+
| &#32;
| The pixel area within the <samp>texture</samp> to draw, in the form <samp>{{t|x}} {{t|y}} {{t|width}} {{t|height}}</samp>.
+
* replaced send-mail events with [[Modding:Trigger actions|trigger actions]]
 +
* updated pet event to support custom pet types
 +
| '''✘ broken'''
 +
| ✓ mostly unaffected<br /><small>(✘ may cause duplicate mail if they edit<br />send-mail events)</small>
 
|-
 
|-
| 5
+
| <samp>Data/Events/FishShop</samp>
| <samp>interval</samp>
+
| &#32;
| The millisecond duration for each frame in the animation.
+
* fixed typos
 +
| ✘ will remove changes
 +
| ✓ mostly unaffected
 
|-
 
|-
| 6
+
| <samp>Data/Events/Forest</samp>
| <samp>frames</samp>
+
| &#32;
| The number of frames in the animation.
+
* fixed typos
|-
+
* updated Jas <samp>faceDirection</samp> command for sewer event
| 7
+
| ✘ will remove changes
| <samp>loops</samp>
+
| ✓ mostly unaffected
| The number of times to repeat the animation.
   
|-
 
|-
| 8&ndash;9
+
| <samp>Data/Events/IslandHut</samp>
| <samp>tile</samp>
+
| &#32;
| The tile position at which to draw the sprite, in the form <samp>{{t|x}} {{t|y}}</samp>.
+
* updated how Leo's name is translated
 +
| ✘ will remove changes
 +
| ✓ mostly unaffected
 
|-
 
|-
| 10
+
| <samp>Data/Events/IslandNorth</samp>
| <samp>flicker</samp>
+
| &#32;
| '''[TODO: document what this does]''' (one of <samp>true</samp> or <samp>false</samp>).
+
* updated quote format
 +
* fixed blank music field (backwards-compatible)
 +
| '''✘ broken'''
 +
| ✓ mostly unaffected<br /><small>(✘ likely broken if they edit the <samp>6497421</samp> event)</small>
 
|-
 
|-
| 11
+
| <samp>Data/Events/IslandSouth</samp>
| <samp>flip</samp>
+
| &#32;
| Whether to flip the sprite horizontally when it's drawn (one of <samp>true</samp> or <samp>false</samp>).
+
* fixed blank music field (backwards-compatible)
 +
* fixed typos
 +
| ✘ will remove changes
 +
| ✓ mostly unaffected
 
|-
 
|-
| 12
+
| <samp>Data/Events/JoshHouse</samp>
| <samp>sort tile Y</samp>
+
| &#32;
| The tile Y position to use in the layer depth calculation, which affects which sprite is drawn on top if two sprites overlap.
+
* fixed typos
 +
| ✘ will remove changes
 +
| ✓ mostly unaffected
 
|-
 
|-
| 13
+
| <samp>Data/Events/LeahHouse</samp>
| <samp>alpha fade</samp>
+
| &#32;
| '''[TODO: document what this does]'''
+
* fixed <samp>move</samp> command format in Leah's 2-heart event
 +
* fixed typos
 +
| '''✘ broken'''
 +
| ✓ mostly unaffected
 
|-
 
|-
| 14
+
| <samp>Data/Events/Mountain</samp>
| <samp>scale</samp>
+
| &#32;
| A multiplier applied to the sprite size (in addition to the normal 4× pixel zoom).
+
* fixed skipped dialogue in Maru's 14-heart event
 +
* fixed typos
 +
| ✘ will remove changes
 +
| ✓ mostly unaffected
 
|-
 
|-
| 15
+
| <samp>Data/Events/Saloon</samp><br /><samp>Data/Events/ScienceHouse</samp><br /><samp>Data/Events/SebastianRoom</samp>
| <samp>scale change</samp>
+
| &#32;
| '''[TODO: document what this does]'''
+
* fixed typos
 +
| ✘ will remove changes
 +
| ✓ mostly unaffected
 
|-
 
|-
| 16
+
| <samp>Data/Events/Town</samp>
| <samp>rotation</samp>
+
| &#32;
| The rotation to apply to the sprite, measured in [[wikipedia:radians|radians]].
+
* fixed <samp>warp</samp> command format in community center completed event
 +
* fixed typos
 +
| '''✘ broken'''
 +
| ✓ mostly unaffected
 
|-
 
|-
| 17
+
| <samp>Data/Events/WizardHouse</samp>
| <samp>rotation change</samp>
+
| &#32;
| '''[TODO: document what this does]'''
+
* fixed typos
 +
| ✘ will remove changes
 +
| ✓ mostly unaffected
 
|-
 
|-
| 18+
+
| <samp>Data/ExtraDialogue</samp>
| ''flags''
+
| &#32;
| Any combination of these space-delimited flags:
+
* split <samp>SummitEvent_Dialogue1_Spouse</samp> entry
* <samp>color {{t|color}}</samp>: apply a [[#Color fields|standard color]] to the sprite.
+
* fixed event command formats in some summit dialogue
* <samp>hold_last_frame</samp>: after playing the animation once, freeze the last frame as long as the sprite is shown.
+
* moved [[#Dialogue changes|dumpster dive dialogue into NPC files]]
* <samp>ping_pong</samp>: '''[TODO: document what this does]'''
+
* removed unused entries
* <samp>motion {{t|x}} {{t|y}}</samp>: '''[TODO: document what this does]'''
+
* fixed typos
* <samp>acceleration {{t|x}} {{t|y}}</samp>: '''[TODO: document what this does]'''
+
| '''✘ broken'''
* <samp>acceleration_change {{t|x}} {{t|y}}</samp>: '''[TODO: document what this does]'''
+
| ✓ mostly unaffected
|}
   
|-
 
|-
| <samp>translateName {{t|actor}} {{t|translation key}}</samp>
+
| <samp>Data/FarmAnimals</samp>
| Set the display name for an NPC in the event to match the given translation key.
+
| &#32;
 +
* [[#Custom farm animals|completely overhauled]]
 +
| '''✘ broken'''
 +
| '''✘ broken'''
 
|-
 
|-
| <samp>warpFarmers [{{t|x}} {{t|y}} {{t|direction}}]+ {{t|default offset}} {{t|default x}} {{t|default}} {{t|direction}}</samp>
+
| <samp>Data/Festivals/fall16</samp>
| Warps connected players to the given [[Modding:Modder Guide/Game Fundamentals#Tiles|tile coordinates]] and [[Modding:Event data#Directions|numeric directions]]. The {{t|x}} {{t|y}} {{t|direction}} triplet is repeated for each connected player (e.g. the first triplet is for the main player, second triplet is for the first farmhand, etc). The triplets are followed by an offset direction (one of <samp>up</samp>, <samp>down</samp>, <samp>left</samp>, or <samp>right</samp>), and a final triplet which defines the default values used by any other player.
+
| &#32;
|}
+
* updated command syntax (backwards-compatible)
</li>
+
* fixed typos
<li>Fixed some commands assuming a boolean argument is true if present, regardless of its value. This affects the <samp>changeToTemporaryMap</samp>, <samp>emote</samp>, <samp>extendSourceRect</samp>, <samp>faceDirection</samp>, <samp>globalFade</samp>, <samp>globalFadeToClear</samp>, <samp>positionOffset</samp>, and <samp>warp</samp> commands.</li>
+
| ✘ will remove changes
<li>Fixed some commands assuming any value except the exact case-sensitive string <samp>true</samp> is false. This affects the <samp>animate</samp>, <samp>glow</samp>, <samp>hideShadow</samp>, <samp>ignoreMovementAnimation</samp>, <samp>temporaryAnimatedSprite</samp>, <samp>temporarySprite</samp>, and <samp>viewport</samp> commands.</li>
+
| ✓ mostly unaffected
<li>Fixed some commands silently ignoring values they can't parse as the expected type. This affects the <samp>addItem</samp>, <samp>makeInvisible</samp>, and <samp>removeItem</samp> commands.</li>
  −
<li>Fixed crash when some commands are passed <samp>farmer[number]</samp> for a player who's not available, or <samp>farmer[number]</samp> when they expect <samp>farmer</samp>.</li>
  −
<li>Fixed some commands not taking into account custom farmer actors when checking <samp>farmer*</samp> actor IDs.</li>
  −
<li>Fixed warp-out event commands able to use NPC-only or gendered warps. They now use a valid warp for the player if possible.</li>
  −
<li>Changed specific commands:
  −
{| class="wikitable"
   
|-
 
|-
! command
+
| <samp>Data/Festivals/fall27</samp>
! changes
+
| &#32;
 +
* removed <samp>shop</samp> field (moved into [[#Custom shops|<samp>Data/Shops</samp>]])
 +
| ✓ mostly unaffected
 +
| ✓ mostly unaffected
 
|-
 
|-
| <samp>addCookingRecipe</samp>
+
| <samp>Data/Festivals/spring13</samp>
| Fixed error if player already knows the recipe.
+
| &#32;
 +
* migrated to new <samp>warpFarmers</samp> command
 +
* removed <samp>shop</samp> field (moved into [[#Custom shops|<samp>Data/Shops</samp>]])
 +
* updated <samp>faceDirection</samp> syntax
 +
* fixed typos
 +
| '''✘ broken'''
 +
| ✓ mostly unaffected<br /><small>(✘ broken if they edit <samp>mainEvent</samp> or<br /><samp>afterEggHunt</samp> fields)</small>
 
|-
 
|-
| <samp>addMailReceived</samp>
+
| <samp>Data/Festivals/spring24</samp><br /><samp>Data/Festivals/summer11</samp><br /><samp>Data/Festivals/summer28</samp>
 
| &#32;
 
| &#32;
* Renamed to <samp>mailReceived</samp>. (The old name is now an alias, so it'll still work.)
+
* migrated to new <samp>warpFarmers</samp> command
* You can now remove a mail received by setting the optional third argument to false, like <samp>mailReceived {{t|id}} false</samp>.
+
* removed <samp>shop</samp> field (moved into [[#Custom shops|<samp>Data/Shops</samp>]])
 +
| '''✘ broken'''
 +
| ✓ mostly unaffected<br /><small>(✘ broken if they edit <samp>mainEvent</samp> field)</small>
 
|-
 
|-
| <samp>addTemporaryActor</samp>
+
| <br /><samp>Data/Festivals/winter8</samp>
 
| &#32;
 
| &#32;
* Underscores in the asset name are now only replaced with spaces if an exact match wasn't found. You should quote arguments containing spaces instead, like <code>addTemporaryActor "White Chicken" …</code>.
+
* migrated to new <samp>warpFarmers</samp> command
* Underscores in the display name are no longer replaced with spaces. You should quote arguments containing spaces instead.
+
* removed <samp>shop</samp> field (moved into [[#Custom shops|<samp>Data/Shops</samp>]])
 +
* removed broken <samp>loadActors MainEvent</samp> command
 +
| '''✘ broken'''
 +
| ✓ mostly unaffected<br /><small>(✘ broken if they edit <samp>mainEvent</samp> or<br /><samp>afterIceFishing</samp> field)</small>
 
|-
 
|-
| <samp>animate</samp>
+
| <samp>Data/Festivals/winter25</samp>
| Underscores in the NPC name are now only replaced with spaces if an exact match wasn't found. You should quote arguments containing spaces instead, like <code>animate "Mr Qi" …</code>.
+
| &#32;
 +
* removed <samp>shop</samp> field (moved into [[#Custom shops|<samp>Data/Shops</samp>]])
 +
| ✓ mostly unaffected
 +
| ✓ mostly unaffected
 
|-
 
|-
| <samp>ambientLight</samp>
+
| <samp>Data/Fish</samp>
| Removed four-argument form (which was unused and had confusing behavior). The other versions of <samp>ambientLight</samp> still work like before.
+
| &#32;
 +
* no longer has per-language versions
 +
* [[#Custom items|changed key type]]
 +
* field 13 now refers to whether fish can be tutorial catch
 +
| '''✘ broken'''
 +
| ✘ likely broken
 
|-
 
|-
| <samp>awardFestivalPrize</samp>
+
| <samp>Data/FishPondData</samp>
| Added support for arbitrary item IDs, like <code>awardFestivalPrize (O)128</code> for a pufferfish.
+
| &#32;
 +
* added required <samp>Id</samp> & optional <samp>Precedence</samp> fields
 +
* standardized <samp>ID</samp>→<samp>Id</samp> naming
 +
* changed to qualified item IDs
 +
* moved fallback entries to bottom
 +
| '''✘ broken'''
 +
| ✘ likely broken
 
|-
 
|-
| <samp>changeName</samp>
+
| <samp>Data/fruitTrees</samp>
| Underscores in the NPC name are no longer replaced with spaces. You should quote arguments containing spaces instead, like <code>changeName Leo "Neo Leo"</code>.
+
| &#32;
 +
* [[#Custom fruit trees|completely overhauled]]
 +
| '''✘ broken'''
 +
| '''✘ broken'''
 
|-
 
|-
| <samp>changePortrait</samp><br /><samp>changeSprite</samp>
+
| <samp>Data/Furniture</samp>
| You can now omit the suffix argument to reset the NPC back to their normal portrait/sprite.
+
| &#32;
 +
* [[#Custom items|changed key type]]
 +
* replaced translations with [[Modding:Tokenizable strings|tokenizable strings]]
 +
* [[#Custom items|changed key type]]
 +
* can no longer omit empty fields before display name
 +
| '''✘ broken'''
 +
| ✓ mostly unaffected<br /><small>(covered by runtime migration)</small>
 
|-
 
|-
| <samp>faceDirection</samp>
+
| <samp>Data/hats</samp>
| You can now specify the direction in words, like <samp>faceDirection up</samp>
+
| &#32;
 +
* [[#Custom items|changed key type]]
 +
* can no longer omit empty fields before display name
 +
* added display name field in English
 +
| '''✘ broken'''
 +
| '''✘ likely broken'''
 
|-
 
|-
| <samp>ignoreMovementAnimation</samp>
+
| <samp>Data/Locations</samp>
 
| &#32;
 
| &#32;
* Fixed its ''ignore'' argument being ignored.
+
* [[#Custom locations|completely overhauled]]
* Underscores in the NPC name are now only replaced with spaces if an exact match wasn't found. You should quote arguments containing spaces instead, like <code>ignoreMovementAnimation "Mr Qi" …</code>.
+
| '''✘ broken'''
 +
| ✓ mostly unaffected<br /><small>(covered by runtime migration)</small>
 
|-
 
|-
| <samp>itemAboveHead</samp>
+
| <samp>Data/mail</samp>
| Added support for arbitrary item IDs, like <code>itemAboveHead (O)128</code> for a pufferfish.
+
| &#32;
 +
* migrated to <samp>%item id</samp> (backwards-compatible)
 +
* removed unused entries
 +
* fixed typos
 +
| ✘ will remove changes
 +
| ✓ mostly unaffected
 
|-
 
|-
| <samp>makeInvisible</samp>
+
| <samp>Data/Monsters</samp>
| Fixed terrain features not hidden when using the default area size.
+
| &#32;
 +
* changed ''Dust Spirit'' display name to ''Dust Sprite''
 +
| ✘ will remove changes
 +
| ✓ mostly unaffected
 
|-
 
|-
| <samp>removeItem</samp>
+
| <samp>Data/Movies</samp>
| Added argument for an optional count, like <code>removeItem (O)128 10</code> to remove 10 pufferfish.
+
| &#32;
 +
* [[#Custom movies|significantly overhauled]]
 +
| '''✘ broken'''
 +
| '''✘ broken'''
 
|-
 
|-
| <samp>speak</samp>
+
| <samp>Data/MoviesReactions</samp>
| Fixed friendship & socialize quest not updated when calling it with a translation key.
+
| &#32;
|}</li>
+
* replaced translations with [[Modding:Tokenizable strings|tokenizable strings]]
<li>Removed some commands:
+
* standardized <samp>ID</samp>→<samp>Id</samp> naming
{| class="wikitable"
+
* fixed typo
 +
| '''✘ broken'''
 +
| ✓ mostly unaffected
 
|-
 
|-
! command
+
| <samp>Data/NPCDispositions</samp>
! changes
+
| &#32;
 +
* asset replaced by [[#Custom NPCs|<samp>Data/Characters</samp>]]
 +
| '''✘ broken'''
 +
| ✓ mostly unaffected<br /><small>(covered by runtime migration)</small>
 
|-
 
|-
| <samp>addToTable</samp>
+
| <samp>Data/NPCGiftTastes</samp>
| Removed (it was unused and worked in counterintuitive ways).
+
| &#32;
 +
* removed invalid item IDs
 +
| ✘ will remove changes
 +
| ✓ mostly unaffected
 
|-
 
|-
| <samp>addTool</samp>
+
| <samp>Data/ObjectContextTags</samp>
| Removed (it was unused and only supported the [[Return Scepter|return scepter]]). Use <samp>addItem</samp> instead, which supports adding tools.
+
| &#32;
 +
* asset removed (replaced by <samp>ContextTags</samp> field in [[#Custom big craftables|<samp>Data/BigCraftables</samp>]] and [[#Custom objects|<samp>Data/Objects</samp>]])
 +
| '''✘ broken'''
 +
| ✓ mostly unaffected<br /><small>(covered by runtime migration,<br />except context tags defined<br />before their objects and context<br />tags for bigcraftables.)
 +
</small>
 
|-
 
|-
| <samp>grabObject</samp>
+
| <samp>Data/ObjectInformation</samp>
| Removed (it was unused and broken).
+
| &#32;
 +
* asset replaced by [[#Custom objects|<samp>Data/Objects</samp>]]:
 +
** migrated to data model format
 +
** added new features
 +
** added new entries
 +
** adjusted [[#Other item changes|litter items]]
 +
** fixed typos
 +
| '''✘ broken'''
 +
| ✓ mostly unaffected<br /><small>(covered by runtime migration)</small>
 
|-
 
|-
| <samp>showRivalFrame</samp><br /><samp>taxVote</samp>
+
| <samp>Data/PaintData</samp>
| Removed (they were part of unimplemented features).
+
| &#32;
 +
* fixed trailing slash in <samp>Deluxe Barn</samp> entry
 +
|
 +
|
 
|-
 
|-
| <samp>weddingSprite</samp>
+
| <samp>Data/Quests</samp>
| Removed (it was broken and unused).
  −
|}
  −
</ul>
  −
 
  −
====Festival changes====
  −
* Festivals can now have a custom festival-started notification message by setting the <samp>startedMessage</samp> field in <samp>Data/Festivals/*</samp> to a [[Modding:Tokenizable strings|tokenizable string]].
  −
* Festivals now set the event ID to a value like <samp>festival_fall16</samp>, instead of <samp>-1</samp>.
  −
* All in-festival data fields now support [[Modding:Festival data#Year variants|year variants]].
  −
* Fixed NPCs getting duplicated in festivals if they're added to the <samp>set-up</samp> fields multiple times. Subsequent entries now move them instead.
  −
* Fixed [[Modding:Festival data#Year variants|year variants]] for festival <samp>set-up</samp> field being appended to the main script instead of replacing it.
  −
 
  −
====Send-mail (<samp>x</samp>) precondition deprecated====
  −
Using the <samp>x</samp> event precondition as a way to send mail is now deprecated (but still works). You should use [[#Trigger actions|trigger actions]] instead to perform actions like that.
  −
 
  −
All vanilla events which used it have been replaced by equivalent trigger actions. This event IDs below no longer exist; if you check them (e.g. via <samp>HasSeenEvent</samp>), you'll need to check the new action or the mail flag they set instead.
  −
{| class="wikitable"
  −
|-
  −
! old event ID
  −
! new action ID
  −
! mail flag
  −
|-
  −
| <samp>68</samp>
  −
| <samp>Mail_Mom_5K</samp>
  −
| <samp>mom1</samp>
  −
|-
  −
| <samp>69</samp>
  −
| <samp>Mail_Mom_15K</samp>
  −
| <samp>mom2</samp>
  −
|-
  −
| <samp>70</samp>
  −
| <samp>Mail_Mom_32K</samp>
  −
| <samp>mom3</samp>
  −
|-
  −
| <samp>71</samp>
  −
| <samp>Mail_Mom_120K</samp>
  −
| <samp>mom4</samp>
  −
|-
  −
| <samp>72</samp>
  −
| <samp>Mail_Dad_5K</samp>
  −
| <samp>dad1</samp>
  −
|-
  −
| <samp>73</samp>
  −
| <samp>Mail_Dad_15K</samp>
  −
| <samp>dad2</samp>
  −
|-
  −
| <samp>74</samp>
  −
| <samp>Mail_Dad_32K</samp>
  −
| <samp>dad3</samp>
  −
|-
  −
| <samp>75</samp>
  −
| <samp>Mail_Dad_120K</samp>
  −
| <samp>dad4</samp>
  −
|-
  −
| <samp>76</samp>
  −
| <samp>Mail_Tribune_UpAndComing</samp>
  −
| <samp>newsstory</samp>
  −
|-
  −
| <samp>706</samp>
  −
| <samp>Mail_Pierre_Fertilizers</samp>
  −
| <samp>fertilizers</samp>
  −
|-
  −
| <samp>707</samp>
  −
| <samp>Mail_Pierre_FertilizersHighQuality</samp>
  −
| <samp>fertilizers2</samp>
  −
|-
  −
| <samp>909</samp>
  −
| <samp>Mail_Robin_Woodchipper</samp>
  −
| <samp>WoodChipper</samp>
  −
|-
  −
| <samp>2111194</samp>
  −
| <samp>Mail_Emily_8heart</samp>
  −
| <samp>EmilyClothingTherapy</samp>
  −
|-
  −
| <samp>2111294</samp>
  −
| <samp>Mail_Emily_10heart</samp>
  −
| <samp>EmilyCamping</samp>
  −
|-
  −
| <samp>2346091</samp>
  −
| <samp>Mail_Alex_10heart</samp>
  −
| <samp>joshMessage</samp>
  −
|-
  −
| <samp>2346092</samp>
  −
| <samp>Mail_Sam_10heart</samp>
  −
| <samp>samMessage</samp>
  −
|-
  −
| <samp>2346093</samp>
  −
| <samp>Mail_Harvey_10heart</samp>
  −
| <samp>harveyBalloon</samp>
  −
|-
  −
| <samp>2346094</samp>
  −
| <samp>Mail_Elliott_10heart</samp>
  −
| <samp>elliottBoat</samp>
  −
|-
  −
| <samp>2346095</samp>
  −
| <samp>Mail_Elliott_8heart</samp>
  −
| <samp>elliottReading</samp>
  −
|-
  −
| <samp>2346096</samp>
  −
| <samp>Mail_Penny_10heart</samp>
  −
| <samp>pennySpa</samp>
  −
|-
  −
| <samp>2346097</samp>
  −
| <samp>Mail_Abigail_8heart</samp>
  −
| <samp>abbySpiritBoard</samp>
  −
|-
  −
| <samp>3333094</samp>
  −
| <samp>Mail_Pierre_ExtendedHours</samp>
  −
| <samp>pierreHours</samp>
  −
|-
  −
| <samp>3872126</samp>
  −
| <samp>Mail_Willy_BackRoomUnlocked</samp>
  −
| <samp>willyBackRoomInvitation</samp>
  −
|}
  −
 
  −
===[[Modding:Mail data|Mail]] changes===
  −
<ul>
  −
<li>Mail can now have multiple items attached (using multiple <samp>%item</samp> commands). When the player grabs the top item, the next one will appear in the slot to grab next.</li>
  −
<li>Added mail commands:
  −
{| class="wikitable"
  −
|-
  −
! command
  −
! effect
  −
|-
  −
| <samp>%action {{t|action}}%%</samp>
  −
| Run a [[Modding:Trigger actions|trigger action string]], like <samp>%action AddMoney 500%%</samp> to add {{price|500}} to the current player.
  −
|}</li>
  −
<li>Improved mail commands:
  −
{| class="wikitable"
  −
|-
  −
! command
  −
! changes
  −
|-
  −
| <samp>%item</samp>
  −
| &#32;
  −
* Added <samp>%item id {{t|item id}} {{o|count}}</samp> form which accepts a [[#Custom items|qualified or unqualified item ID]]. If multiple items are listed (''e.g.,'' <samp>%item id (BC)12 3 (O)34 5 %%</samp>) one set will be picked randomly. This deprecates the <samp>bigobject</samp>, <samp>furniture</samp>, <samp>object</samp>, and <samp>tools</samp> options.
  −
* Added <samp>%item specialOrder {{t|order id}} {{o|immediately}}</samp> form to attach a special order to the letter.
  −
* Added optional {{t|key}} argument to <samp>%item cookingRecipe {{t|key}}</samp>, to learn a specific [[Modding:Recipe data|cooking recipe]]. The previous <samp>%item cookingRecipe</samp> form (without a key) works the same way as before.
  −
* The type argument is now case-insensitive.
  −
* Fixed <samp>%item craftingRecipe</samp> not supporting recipe IDs containing underscores. It now checks for an exact match first, then tries replacing underscores with spaces like before, then logs a warning if neither was found instead of adding an invalid recipe.
  −
|}</li>
  −
<li>All wallet items are now tracked via mail flags. That adds these mail flags: <samp>HasClubCard</samp>, <samp>HasDarkTalisman</samp>, <samp>HasDwarvishTranslationGuide</samp>, <samp>HasMagicInk</samp>, <samp>HasMagnifyingGlass</samp>, <samp>HasRustyKey</samp>, <samp>HasSkullKey</samp>, <samp>HasSpecialCharm</samp>, <samp>HasTownKey</samp>, and <samp>HasUnlockedSkullDoor</samp>.</li>
  −
<li>Fixed letter viewer error when opening an invalid letter.</li>
  −
</ul>
  −
 
  −
===Stat changes for C# mods===
  −
The tracked stats API (e.g. <code>Game1.stats</code> and <code>Game1.player.stats</code>) has been overhauled.
  −
 
  −
In particular, all stats are now in the underlying stat dictionary. If you use a stat field directly (like <code>stats.dirtHoed</code>), you'll need to use the property (like <code>stats.DirtHoed</code>) or method (like <code>stats.Get(StatsKey.DirtHoed)</code>). This lets the game or mods access all stats in a standard way without reflection. 1.6 also adds <samp>StatsKey</samp> constants for all stats tracked by the game.
  −
 
  −
The <samp>stats</samp> API has also been redesigned:
  −
{| class="wikitable"
  −
|-
  −
! member
  −
! comments
  −
|-
  −
| <samp>Values</samp>
  −
| The numeric metrics tracked by the game. This replaces <samp>stats_dictionary</samp>.
  −
|-
  −
| <samp>Get(key)</samp>
  −
| Get the value of a tracked stat. This replaces <samp>getStat</samp>.
  −
 
  −
For example:
  −
<syntaxhighlight lang="c#">
  −
uint daysPlayed = Game1.stats.Get(StatKeys.DaysPlayed);
  −
</syntaxhighlight>
  −
|-
  −
| <samp>Set(key, value)</samp>
  −
| Set the new value of a tracked stat. This method is new.
  −
 
  −
For example:
  −
<syntaxhighlight lang="c#">
  −
Game1.stats.Set(StatKeys.ChildrenTurnedToDoves, 5);
  −
</syntaxhighlight>
  −
|-
  −
| <samp>Increment(key)</samp><br /><samp>Increment(key, amount)</samp>
  −
| Add the given amount to the stat (default 1), and return the new stat value. This improves on the original <samp>incrementStat</samp>.
  −
 
  −
For example:
  −
<syntaxhighlight lang="c#">
  −
uint stepsTaken = Game1.stats.Increment(StatKeys.StepsTaken);
  −
</syntaxhighlight>
  −
|}
  −
 
  −
This can also be used to track custom mod stats, they doesn't need to be stats normally tracked by the game. Custom stats should be prefixed with your mod's unique ID to avoid conflicts:
  −
<syntaxhighlight lang="c#">
  −
Game1.stats.Set("Your.ModId_CustomStat", 5);
  −
</syntaxhighlight>
  −
 
  −
And finally, setting a stat to 0 now removes it from the stats dictionary (since that's the default for missing stats).
  −
 
  −
===New C# utility methods===
  −
Stardew Valley 1.6 adds several new methods to simplify common logic.
  −
 
  −
====Argument handling====
  −
The new <samp>ArgUtility</samp> class handles splitting, reading, and validating <samp>string[]</samp> argument lists. The main methods are:
  −
 
  −
; Splitting arrays&#58;
  −
: {| class="wikitable"
  −
|-
  −
! <samp>ArgUtility</samp> method
  −
! effect
  −
|-
  −
| <samp>SplitBySpace</samp>
  −
| Split space-separated arguments in a string. This automatically ignores extra spaces, so <samp>" x &nbsp;y "</samp> and <samp>"x y"</samp> are equivalent. For example:
  −
<syntaxhighlight lang="c#">
  −
string[] fields = ArgUtility.SplitBySpace("a b c");
  −
string secondField = fields[1]; // "b"
  −
</syntaxhighlight>
  −
|-
  −
| <samp>SplitBySpaceAndGet</samp>
  −
| Get the value at an index in a space-delimited string (if found), else return the default value. For example:
  −
 
  −
<syntaxhighlight lang="c#">
  −
string thirdField = ArgUtility.SplitBySpaceAndGet("a b c", 2); // "c"
  −
string invalidFieldA = ArgUtility.SplitBySpaceAndGet("a b c", 5); // null
  −
string invalidFieldB = ArgUtility.SplitBySpaceAndGet("a b c", 5, defaultValue: "boop"); // "boop"
  −
</syntaxhighlight>
  −
 
  −
This is more efficient than <samp>SplitBySpace</samp> when you only need a single value, but it's slower if you need multiple values.
  −
|-
  −
| <samp>SplitBySpaceQuoteAware</samp>
  −
| Split space-separated arguments in a string, with support for using quotes to protect spaces within an argument. See <samp>SplitQuoteAware</samp> below for info on quote handling.
  −
 
  −
For example:
  −
<syntaxhighlight lang="c#">
  −
string buildingName = ArgUtility.SplitBySpaceQuoteAware("BUILDINGS_CONSTRUCTED Here \"Junimo Hut\"")[1]; // Junimo Hut
  −
</syntaxhighlight>
  −
|-
  −
| <samp>SplitQuoteAware</samp>
  −
| Split delimited arguments in a string, with support for using quotes to protect delimiters within an argument.
  −
 
  −
A quote in the text causes any delimiter to be ignored until the next quote, unless it's escaped like <code>\"</code>. Unescaped quotes are removed from the string. (Remember that backslashes need to be escaped in C# or JSON strings, like <code>"\\"</code> for a single backslash.)
  −
 
  −
For example:
  −
<syntaxhighlight lang="c#">
  −
ArgUtility.SplitQuoteAware("A,B,C", ',');        // [ "A", "B", "C" ]
  −
ArgUtility.SplitQuoteAware("A,\"B,C\",D", ','); // [ "A", "B,C", "D" ]
  −
ArgUtility.SplitQuoteAware("A,\\\"B,C", ',');    // [ "A", "\"B", "C" ]
  −
</syntaxhighlight>
  −
 
  −
You can also set the optional arguments for more advanced cases. For example, [[Modding:Game state queries|game state queries]] use this to split twice:
  −
<syntaxhighlight lang="c#">
  −
string gameStateQuery = "BUILDINGS_CONSTRUCTED Here \"Junimo Hut\", SEASON Spring";
  −
 
  −
string[] queries = ArgUtility.SplitQuoteAware(gameStateQuery, ',', StringSplitOptions.RemoveEmptyEntries, keepQuotesAndEscapes: true); // [ "BUILDINGS_CONSTRUCTED Here \"Junimo Hut\"", "SEASON Spring" ]
  −
string buildingName = ArgUtility.SplitBySpaceQuoteAware(queries[0]); // Junimo Hut
  −
</syntaxhighlight>
  −
|-
  −
| <samp>EscapeQuotes</samp>
  −
| Escape quotes in a string so they're ignored by methods like <samp>SplitQuoteAware</samp>.
  −
 
  −
This isn't idempotent (e.g. calling it twice will result in double-escaped quotes).
  −
|}
  −
 
  −
; Reading arrays&#58;
  −
: {| class="wikitable"
  −
|-
  −
! <samp>ArgUtility</samp> method
  −
! effect
  −
|-
  −
| <samp>HasIndex</samp>
  −
| Get whether an index is within the bounds of the array. For example:
  −
<syntaxhighlight lang="c#">
  −
string[] fields = ArgUtility.SplitByString("10 5");
  −
bool inRange = ArgUtility.HasIndex(fields, 1); // true (index 1 has the value '5')
  −
</syntaxhighlight>
  −
|-
  −
| <samp>Get</samp><br /><samp>GetBool</samp><br /><samp>GetDirection</samp><br /><samp>GetEnum</samp><br /><samp>GetFloat</samp><br /><samp>GetInt</samp>
  −
| Get the value at a position in an array, parsed as the relevant type (e.g. a string, boolean, [[Modding:Event data#Directions|direction]], enum, etc). If the index isn't in the array or the value can't be parsed as the expected type, returns a default value.
  −
 
  −
For example, code like this:
  −
<syntaxhighlight lang="c#">
  −
int value = fields.Length > 4 && int.TryParse(fields[4], out int parsed)
  −
    ? parsed
  −
    : -1;
  −
</syntaxhighlight>
  −
 
  −
Can now be rewritten like this:
  −
<syntaxhighlight lang="c#">
  −
int value = ArgUtility.GetInt(fields, 4, -1);
  −
</syntaxhighlight>
  −
|-
  −
| <samp>TryGet</samp><br /><samp>TryGetBool</samp><br /><samp>TryGetDirection</samp><br /><samp>TryGetEnum</samp><br /><samp>TryGetFloat</samp><br /><samp>TryGetInt</samp><br /><samp>TryGetPoint</samp><br /><samp>TryGetRectangle</samp><br /><samp>TryGetVector2</samp>
  −
| Try to get a parsed value from an array by its index. If it's not found or can't be converted to the expected value, it sets the <samp>out string error</samp> argument so you can log an error if needed.
  −
 
  −
For example, this parses a numeric value from a space-delimited string:
  −
<syntaxhighlight lang="c#">
  −
string[] fields = ArgUtility.SplitByString("10 35");
  −
if (ArgUtility.TryGetInt(fields, 1, out int value, out string error))
  −
    this.Helper.Monitor.Log($"Parsed value: {value}"); // "Parsed value: 35"
  −
else
  −
    this.Helper.Monitor.Log($"Failed parsing value: {error}", LogLevel.Warn);
  −
</syntaxhighlight>
  −
|-
  −
| <samp>TryGetOptional</samp><br /><samp>TryGetOptionalBool</samp><br /><samp>TryGetOptionalDirection</samp><br /><samp>TryGetOptionalEnum</samp><br /><samp>TryGetOptionalFloat</samp><br /><samp>TryGetOptionalInt</samp><br /><samp>TryGetOptionalRemainder</samp>
  −
| Equivalent to <samp>TryGet*</samp>, except that it'll return a default value if the argument is missing. For example:
  −
<syntaxhighlight lang="c#">
  −
string[] fields = ArgUtility.SplitByString("10");
  −
if (ArgUtility.TryGetOptionalInt(fields, 1, out int value, out error, defaultValue: 99))
  −
    this.Helper.Monitor.Log($"Parsed value: {value}"); // "Parsed value: 99"
  −
else
  −
    this.Helper.Monitor.Log($"Failed parsing value: {error}", LogLevel.Warn);
  −
</syntaxhighlight>
  −
|-
  −
| <samp>GetRemainder</samp><br /><samp>TryGetRemainder</samp><br /><samp>TryGetOptionalRemainder</samp>
  −
| Similar to the previous methods, but gets arguments starting from an index as a concatenated string. For example:
  −
<syntaxhighlight lang="c#">
  −
string[] fields = ArgUtility.SplitByString("A B C D E F");
  −
if (ArgUtility.TryGetRemainder(fields, 2, out string remainder, out string error))
  −
    this.Helper.Monitor.Log($"Remainder: {remainder}"); // "Remainder: C D E F"
  −
else
  −
    this.Helper.Monitor.Log($"Failed getting remainder: {error}", LogLevel.Warn);
  −
</syntaxhighlight>
  −
|}
  −
 
  −
====Content assets====
  −
{| class="wikitable"
  −
|-
  −
! method
  −
! effect
  −
|-
  −
| <samp>LocalizedContentManager.DoesAssetExist</samp>
  −
| Get whether an asset exists in the game's <samp>Content</samp> folder or is provided through [[Modding:Modder Guide/APIs/Content|SMAPI's content API]]. For example:
  −
<syntaxhighlight lang="c#">
  −
bool exists = Game1.content.DoesAssetExist<Map>("Maps/Town");
  −
</syntaxhighlight>
  −
|-
  −
| <samp>LocalizedContentManager.IsValidTranslationKey</samp>
  −
| Get whether a string is a translation key in the form <samp>{{t|asset name}}:{{t|key}}</samp>, and the asset and key both exist. For example:
  −
<syntaxhighlight lang="c#">
  −
bool exists = Game1.content.IsValidTranslationKey("Strings\\NPCNames:Abigail");
  −
</syntaxhighlight>
  −
|}
  −
 
  −
====Filtering====
  −
The game now has an optimized <samp>RemoveWhere</samp> method for O(n) filtering on <samp>NetCollection</samp>, <samp>NetDictionary</samp>, <samp>NetList</samp>, and (via extension) <samp>IDictionary</samp>. This also deprecates <samp>Filter</samp> methods where they existed.
  −
 
  −
For example:
  −
<syntaxhighlight lang="c#">
  −
int dirtTilesRemoved = Game1.currentLocation.terrainFeatures.RemoveWhere(pair => pair.Value is HoeDirt);
  −
</syntaxhighlight>
  −
 
  −
====Game paths====
  −
The game folder paths were previously hardcoded throughout the code. These are now centralized with a few methods:
  −
 
  −
{| class="wikitable"
  −
|-
  −
! method
  −
! effect
  −
|-
  −
| <samp>Program.GetLocalAppDataFolder</samp><br /><samp>Program.GetAppDataFolder</samp>
  −
| Get the absolute path to the game's app data folder (which contains the [[saves|<Samp>Saves</samp> folder]]) or local app data folder (which contains <samp>ErrorLogs</samp> and <samp>Screenshots</samp>). These methods are equivalent on Windows, but different on Linux/macOS.
  −
|-
  −
| <samp>Program.GetSavesFolder</samp>
  −
| Get the absolute path to the game's [[saves|<samp>Saves</samp> folder]].
  −
|-
  −
| <samp>Game1.GetScreenshotFolder</samp>
  −
| Get the absolute path to the game's <samp>Screenshots</samp> folder.
  −
|-
  −
| <samp>options.GetFilePathForDefaultOptions</samp>
  −
| Get the absolute path to the game's <samp>default_options</samp> file.
  −
|}
  −
 
  −
====Hash sets====
  −
Since the [[#Hash set fields|game now uses hash sets]], it has a few extensions for working with them:
  −
 
  −
{| class="wikitable"
  −
|-
  −
! method
  −
! effect
  −
|-
  −
| <samp>AddRange</samp>
  −
| Add all the values from a list or enumerable to the set.
  −
|-
  −
| <samp>RemoveWhere</samp>
  −
| Remove all values matching a condition.
  −
|-
  −
| <samp>Toggle</samp>
  −
| Add or remove a value in the set based on a boolean. For example:
  −
<syntaxhighlight lang="c#">
  −
public bool hasClubCard
  −
{
  −
    get { return mailReceived.Contains("HasClubCard"); }
  −
    set { mailReceived.Toggle("HasClubCard", value); }
  −
}
  −
</syntaxhighlight>
  −
|}
  −
 
  −
====Iteration====
  −
The new <samp>Utility.ForEach*</samp> methods let you check every thing of a type in the game world quickly and efficiently (with minimal allocations, boxing, etc). These are significantly faster than equivalent code using LINQ or <samp>yield</samp> methods.
  −
 
  −
{| class="wikitable"
  −
|-
  −
! method
  −
! effect
  −
|-
  −
| <samp>Utility.ForEachBuilding</samp>
  −
| Perform an action for each building in the game world.
  −
|-
  −
| <samp>Utility.ForEachCharacter</samp><br /><samp>Utility.ForEachVillager</samp>
  −
| Perform an action for each NPC in the game world. <samp>ForEachCharacter</samp> matches all NPC types (villagers, horses, pets, monsters, player children, etc), while <samp>ForEachVillager</samp> only matches villager NPCs like [[Abigail]].
  −
|-
  −
| <samp>Utility.ForEachCrop</samp>
  −
| Perform an action for each crop in the game world planted in the ground or in a [[Garden Pot|garden pot]].
  −
|-
  −
| <samp>Utility.ForEachItem</samp>
  −
| Perform an action for each item in the game world, including items within items (e.g. in a chest or on a table), hats placed on children, items in player inventories, etc.
  −
|-
  −
| <samp>Utility.ForEachItemIn</samp>
  −
| Perform an action for each item within a given location, including items within items (e.g. in a chest or on a table).
  −
|-
  −
| <samp>Utility.ForEachLocation</samp>
  −
| Perform an action for each location in the game world, optionally including building interiors and generated [[The Mines|mine]] or [[Volcano Dungeon|volcano]] levels.
  −
|}
  −
 
  −
For example, this code counts how many parsnips are planted everywhere in the world:
  −
<syntaxhighlight lang="c#">
  −
int parsnips = 0;
  −
Utility.ForEachCrop(crop =>
  −
{
  −
    if (crop.IndexOfHarvest == "24")
  −
        parsnips++;
  −
    return true; // whether to keep iterating after this crop
  −
});
  −
</syntaxhighlight>
  −
 
  −
Or you could replace all instances of an obsolete item with a new one:
  −
<syntaxhighlight lang="c#">
  −
Utility.ForEachItem((item, remove, replaceWith) =>
  −
{
  −
    if (item.QualifiedItemId == "(O)OldId")
  −
    {
  −
        Item newItem = ItemRegistry.Create("(O)NewId", item.Stack, item.Quality);
  −
        replaceWith(newItem);
  −
    }
  −
 
  −
    return true;
  −
});
  −
</syntaxhighlight>
  −
C# mods which add custom item types can override <samp>Item.ForEachItem</samp> to add support for nested items.
  −
 
  −
====Randomization====
  −
{| class="wikitable"
  −
|-
  −
! method
  −
! effect
  −
|-
  −
| <samp>Utility.CreateDaySaveRandom</samp>
  −
| Creates a <samp>Random</samp> instance using the most common seed (based on the save ID and total days played).
  −
|-
  −
| <samp>Utility.CreateRandom</samp><br /><samp>Utility.CreateRandomSeed</samp>
  −
| Creates a <samp>Random</samp> (or seed for a <samp>Random</samp>) by combining the given seed values, which can be any numeric type.
  −
|-
  −
| <samp>Utility.TryCreateIntervalRandom</samp>
  −
| Get an RNG which produces identical results for all RNGs created with the same sync key during the given interval (one of <samp>tick</samp>, <samp>day</samp>, <samp>season</samp>, or <samp>year</samp>), including between players in multiplayer mode.
  −
 
  −
For example, this will return the same number each time it's called until the in-game day changes:
  −
<syntaxhighlight lang="c#">
  −
public int GetDailyRandomNumber()
  −
{
  −
    Utility.TryCreateIntervalRandom("day", "example sync key", out Random random, out _);
  −
    return random.Next();
  −
}
  −
</syntaxhighlight>
  −
|-
  −
| <samp>Utility.TryGetRandom</samp>
  −
| Get a random entry from a dictionary.
  −
|-
  −
| <samp>random.Choose</samp>
  −
| Choose a random option from the values provided:
  −
<syntaxhighlight lang="c#">
  −
string npcName = Game1.random.Choose("Abigail", "Penny", "Sam");
  −
</syntaxhighlight>
  −
|-
  −
| <samp>random.ChooseFrom</samp>
  −
| Choose a random option from a list or array:
  −
<syntaxhighlight lang="c#">
  −
string[] names = new[] { "Abigail", "Penny", "Sam" };
  −
string npcName = Game1.random.ChooseFrom(names);
  −
</syntaxhighlight>
  −
|-
  −
| <samp>random.NextBool</samp>
  −
| Randomly choose <samp>true</samp> or <samp>false</samp>. For example:
  −
<syntaxhighlight lang="c#">
  −
bool flipSprite = Game1.random.NextBool();
  −
</syntaxhighlight>
  −
 
  −
You can optionally set the probability of <samp>true</samp>:
  −
<syntaxhighlight lang="c#">
  −
bool flipSprite = Game1.random.NextBool(0.8);
  −
</syntaxhighlight>
  −
|}
  −
 
  −
====Other====
  −
Here are some of the other new methods:
  −
 
  −
{| class="wikitable"
  −
|-
  −
! method
  −
! effect
  −
|-
  −
| <samp>Game1.getOfflineFarmhands()</samp>
  −
| Get all farmhands who aren't connected to the game.
  −
|-
  −
| <samp>Game1.createRadialDebris_MoreNatural</samp>
  −
| Scatter item debris around a position with a more randomized distribution than <samp>createRadialDebris</samp>.
  −
|-
  −
| <samp>Object.GetCategoryColor</samp><br /><samp>Object.GetCategoryDisplayName</samp>
  −
| Get the color and display name for the given category number when it's shown in a tooltip.
  −
|-
  −
| <samp>Utility.distanceFromScreen</samp>
  −
| Get the pixel distance between a position in the world and the player's screen viewport, where 0 is within the viewport.
  −
|-
  −
| <samp>Utility.DrawErrorTexture</samp>
  −
| Draw the game's missing-texture image (🚫) to the screen, stretched to fit a given pixel area.
  −
|-
  −
| <samp>Utility.DrawSquare</samp>
  −
| Draw a square to the screen with a background color and/or borders.
  −
|-
  −
| <samp>Utility.GetEnumOrDefault</samp>
  −
| Get an enum value if it's valid, else get a default value. This is mainly used to validate input from data files.
  −
 
  −
For example:
  −
<syntaxhighlight lang="c#">
  −
NpcGender gender = (NPCGender)999999;
  −
gender = Utility.GetEnumOrDefault(gender, Gender.Male); // returns Gender.Male since there's no enum constant with value 999999
  −
</syntaxhighlight>
  −
|-
  −
| <samp>Utility.getRandomNpcFromHomeRegion</samp>
  −
| Get a random social NPC based on their <samp>HomeRegion</samp> value in [[#Custom NPCs|<samp>Data/Characters</samp>]]. For example, this gets a random NPC for the <samp>Town</samp> home region:
  −
<syntaxhighlight lang="c#">
  −
NPC npc = Utility.getRandomNpcFromHomeRegion(NPC.region_town);
  −
</syntaxhighlight>
  −
|-
  −
| <samp>Utility.isFestivalDay</samp>
  −
| This method existed before 1.6, but you can now omit arguments to check today instead of a specific date:
  −
<syntaxhighlight lang="c#">
  −
bool festivalToday = Utility.isFestivalToday();
  −
</syntaxhighlight>
  −
 
  −
Or check for a festival in specific location context:
  −
<syntaxhighlight lang="c#">
  −
bool desertFestivalToday = Utility.isFestivalToday(LocationContexts.DesertId);
  −
</syntaxhighlight>
  −
|-
  −
| <samp>Utility.IsPassiveFestivalDay</samp>
  −
| This method existed before 1.6, but now can now omit arguments to check today instead of a specific date:
  −
<syntaxhighlight lang="c#">
  −
bool passiveFestivalToday = Utility.IsPassiveFestivalDay();
  −
</syntaxhighlight>
  −
 
  −
Or check for a specific passive festival:
  −
<syntaxhighlight lang="c#">
  −
bool nightMarketToday = Utility.IsPassiveFestivalDay("NightMarket");
  −
</syntaxhighlight>
  −
|-
  −
| <samp>Utility.TryGetPassiveFestivalData</samp><br /><samp>Utility.TryGetPassiveFestivalDataForDay</samp>
  −
| Get the [[#Custom passive festivals|passive festival data]] for the given ID or date.
  −
|-
  −
| <samp>Utility.TryParseDirection</samp>
  −
| Parse a string into a direction value (like <samp>Game1.down</samp>), if it's valid. This supports case-insensitive direction names (one of <samp>down</samp>, <samp>left</samp>, <samp>right</samp>, or <samp>up</samp>) or [[Modding:Event data#Directions|numeric values]].
  −
|-
  −
| <samp>Utility.TryParseEnum</samp>
  −
| Parse a string into an enum value if possible, case-insensitively. Unlike [https://learn.microsoft.com/en-us/dotnet/api/system.enum.tryparse <samp>Enum.TryParse</samp>], an invalid numeric value won't be cast:
  −
<syntaxhighlight lang="c#">
  −
Enum.TryParse("999999", out DayOfWeek day);        // true, even though there's no matching DayOfWeek value
  −
Utility.TryParseEnum("999999", out DayOfWeek day); // false
  −
</syntaxhighlight>
  −
|-
  −
| <samp>Utility.fuzzyCompare</samp>
  −
| Get whether a term is a fuzzy match for a search query. Returns the numeric match priority (where lower values are a better match), or null if the term doesn't match the query.
  −
|-
  −
| <samp>rectangle.GetPoints</samp><br /><samp>rectangle.GetVectors</samp>
  −
| Get all the integer coordinates within a given <samp>Rectangle</samp>. For example:
  −
<syntaxhighlight lang="c#">
  −
var tileArea = new Rectangle(0, 0, 2, 2);
  −
Point[] tiles = tileArea.GetPoints(); // (0, 0), (1, 0), (0, 1), (1, 1)
  −
</syntaxhighlight>
  −
|-
  −
| <samp>Utility.GetDeterministicHashCode</samp>
  −
| ''(Specialized)'' Get a [https://en.wikipedia.org/wiki/Hash_function hash code] for a string key or numeric values. Unlike [https://learn.microsoft.com/en-us/dotnet/api/system.object.gethashcode <samp>string.GetHashCode</samp>] or [https://learn.microsoft.com/en-us/dotnet/api/system.hashcode.combine <samp>HashCode.Combine</samp>], this produces a consistent hash for the same inputs between sessions and connected players.
  −
|-
  −
| <samp>Utility.WrapIndex</samp>
  −
| Constrain an index to a range by wrapping out-of-bounds values to the other side (e.g. last index + 1 is the first index, and first index - 1 is the last one).
  −
 
  −
For example:
  −
<syntaxhighlight lang="c#">
  −
string[] values = new[] { "0", "1", "2" };
  −
int index = Utility.WrapIndex(-1, values.Length); // 2
  −
</syntaxhighlight>
  −
|}
  −
 
  −
===Static delegate builder===
  −
For C# mods, <samp>StaticDelegateBuilder</samp> is a specialized class which converts a method name into an optimized delegate which can be called by code. This is used by vanilla code to optimize methods referenced in assets like [[#Custom machines|<samp>Data/Machines</samp>]].
  −
 
  −
For example, given a static method like this:
  −
<syntaxhighlight lang="c#">
  −
public static bool OutputDeconstructor(Object machine, Item inputItem, bool probe, MachineItemOutput outputData, out int? overrideMinutesUntilReady) { ... }
  −
</syntaxhighlight>
  −
 
  −
And a delegate which matches it:
  −
<syntaxhighlight lang="c#">
  −
public delegate bool MachineOutputDelegate(Object machine, Item inputItem, bool probe, MachineItemOutput outputData, out int? overrideMinutesUntilReady);
  −
</syntaxhighlight>
  −
 
  −
You can create an optimized delegate and call it like this:
  −
<syntaxhighlight lang="c#">
  −
if (StaticDelegateBuilder.TryCreateDelegate("StardewValley.Object.OutputDeconstructor", out MachineOutputDelegate method, out string error))
  −
    return method(this, inputItem, probe, outputData, out minutesUntilMorning);
  −
else
  −
    Game1.log.Warn($"Machine {ItemId} has invalid output method: {error}");
  −
</syntaxhighlight>
  −
 
  −
The <samp>TryCreateDelegate</samp> method will cache created delegates, so calling it again will just return the same delegate instance.
  −
 
  −
===Game logging changes===
  −
The game now writes debug output through an internal <samp>Game1.log</samp> wrapper, instead of using <samp>Console.WriteLine</samp> directly. For example:
  −
<syntaxhighlight lang="c#">
  −
// old code
  −
Console.WriteLine("Error playing sound: " + ex);
  −
 
  −
// new code
  −
Game1.log.Error("Error playing sound.", ex);
  −
</syntaxhighlight>
  −
 
  −
This has a few benefits:
  −
* For vanilla players, the game no longer uses time & resources writing to a console that's not visible anyway.
  −
* For modded players, SMAPI can now...
  −
** distinguish between the game's debug/warn/error messages (so many warnings/errors that would previously appear as hidden <samp>TRACE</samp> messages will now be shown with the correct level);
  −
** apply its formatting rules to exceptions logged by the game too;
  −
** redirect game output much more efficiently without console interception.
  −
 
  −
===Other changes===
  −
====Audio====
  −
<ul>
  −
<li>Added <samp>Game1.sounds</samp>, which unifies the high-level sound effect logic (e.g. distance fading and multiplayer sync).</li>
  −
<li>Added <samp>silence</samp> [[Modding:Audio|audio cue]] for music. This is different from <samp>none</samp> in that it suppresses both town music and ambient sounds.</li>
  −
<li>Added <samp>Game1.soundBank.Exists(cueName)</samp> method to check if an audio cue exists.</li>
  −
<li>Added <samp>Game1.playSound</samp> overloads to get the audio cue being played.</li>
  −
<li>Added <samp>character.playNearbySoundAll</samp> and <samp>playNearbySoundAllLocal</samp> methods to play a sound for players near the player/character.</li>
  −
<li>Added position argument to <samp>DelayedAction.playSoundAfterDelay</samp>.</li>
  −
<li>Removed <samp>NetAudioCueManager</samp> and <samp>Game1.locationCues</samp> (unused).</li>
  −
<li>Unified the methods for playing normal/pitched/positional sounds (which also adds support for pitched non-synced & pitched positional sounds):
  −
{| class="wikitable"
  −
|-
  −
! old methods
  −
! new method
  −
|-
  −
| <samp>Game1.playSound</samp><br /><samp>Game1.playSoundAt</samp><br /><samp>Game1.playSoundPitched</samp>
  −
| <samp>Game1.playSound</samp>
  −
|-
  −
| <samp>GameLocation.playSound</samp><br /><samp>GameLocation.playSoundAt</samp><br /><samp>GameLocation.playSoundPitched</samp>
  −
| <samp>GameLocation.playSound</samp>
  −
|-
  −
| <samp>GameLocation.localSound</samp><br /><samp>GameLocation.localSoundAt</samp>
  −
| <samp>GameLocation.localSound</samp>
  −
|-
  −
| <samp>NetAudio.Play</samp><br /><samp>NetAudio.PlayAt</samp><br /><samp>NetAudio.PlayPitched</samp>
  −
| <samp>NetAudio.Play</samp>
  −
|-
  −
| <samp>NetAudio.PlayLocal</samp><br /><samp>NetAudio.PlayLocalAt</samp>
  −
| <samp>NetAudio.PlayLocal</samp>
  −
|}</li>
  −
</ul>
  −
 
  −
====Debug commands====
  −
<ul>
  −
<li>All debug commands are now quote-aware, so you can pass spaces in arguments like <code>debug build "Junimo Hut"</code>.</li>
  −
<li>Added new [[Modding:Console commands|debug commands]]:
  −
{| class="wikitable"
  −
|-
  −
! command
  −
! description
  −
|-
  −
| <samp>action {{t|action}}</samp>
  −
| Run a [[Modding:Trigger actions|trigger action string]], like <samp>action AddMoney 500</samp> to add {{price|500}} to the current player.
  −
|-
  −
| <samp>artifactSpots</samp>
  −
| Spawn an [[Artifact Spot|artifact spot]] in each empty tile around the player.
  −
|-
  −
| <samp>endEvent</samp> / <samp>ee</samp>
  −
| Immediately end the current event or festival, applying the event's skip logic (if any). The event is marked seen, but you can rewatch it using the <samp>eventById</samp> command if needed.
  −
 
  −
This replaces the pre-1.6 commands (<samp>ee</samp>, <samp>endEvent</samp>/<samp>leaveEvent</samp>, and <samp>eventOver</samp>) which worked in different ways and had side-effects like restarting the event or clearing the player's mail.
  −
|-
  −
| <samp>exportShops</samp>
  −
| Export a summary of what's in every shop in the game, taking into account their current conditions. This is saved to a file on disk, and the file path shown in the console.
  −
|-
  −
| <samp>filterLoadMenu</samp> / <samp>flm</samp>
  −
| ''Syntax: <samp>filterLoadMenu {{t|search text}}''
  −
 
  −
Filter the current list of saves to those whose player name or farm name contains the given text.
  −
|-
  −
| <samp>forcebuild</samp>
  −
| Equivalent to <samp>build</samp>, but disables all safety checks so you can build in a location that wouldn't normally allow buildings, build on top of farm animals or placed objects, etc.
  −
|-
  −
| <samp>gamequery</samp> / <samp>gq</samp>
  −
| ''Syntax:'' <samp>gq {{t|query}}</samp>
  −
 
  −
Check whether the given [[Modding:Game state queries|game state query]] matches in the current context. For example:
  −
<pre>
  −
gq !SEASON Spring, WEATHER Here Sun
  −
> Result: true.
  −
</pre>
  −
|-
  −
| <samp>itemquery</samp> / <samp>iq</samp>
  −
| ''Syntax:'' <samp>iq {{t|query}}</samp>
  −
 
  −
Open a shop menu with all the items matching an [[Modding:Item queries|item query]] (all items free). For example:
  −
* <samp>debug iq ALL_ITEMS</samp> shows all items;
  −
* <samp>debug iq ALL_ITEMS (W)</samp> shows all weapons;
  −
* <samp>debug iq (O)128</samp> shows a pufferfish (object 128);
  −
* <samp>debug iq FLAVORED_ITEM Wine (O)128</samp> shows Pufferfish Wine.
  −
|-
  −
| <samp>logFile</samp>
  −
| Begin writing debug messages to a log file at <samp>%appdata%/StardewValley/ErrorLogs/game-latest.txt</samp> to simplify troubleshooting. You can also enter <samp>/logtext</samp> into the in-game chatbox to enable it.
  −
 
  −
This does nothing if SMAPI is installed, since the debug messages are already saved to SMAPI's log.
  −
|-
  −
| <samp>logSounds</samp>
  −
| Log info about each sound effect played to the SMAPI console window.
  −
|-
  −
| <samp>movieSchedule {{o|year}}</samp>
  −
| Lists the movies that will play in a given {{o|year}} (default this year), with the dates they'll play.
  −
|-
  −
| <samp>qualifiedid</samp>
  −
| Print the held item's display name and [[#Custom items|qualified item ID]].
  −
|-
  −
| <samp>search</samp>
  −
| ''Syntax:'' <samp>search {{o|term}}</samp>
  −
 
  −
List all debug commands that match the given search term (or all debug commands if the search term is omitted). For example:
  −
<pre>debug search backpack
  −
> Found 2 debug commands matching search term 'backpack':
  −
    - Backpack
  −
    - FillBackpack (fbp, fill, fillbp)</pre>
  −
|-
  −
| <samp>setFarmEvent</samp> / <samp>sfe</samp>
  −
| ''Syntax:'' <samp>setFarmEvent {{t|event id}}</samp>
  −
 
  −
Queue an [[Random Events#Farm events|overnight farm event]] if one doesn't plan naturally instead. The {{t|event id}} can be one of...
  −
* <samp>dogs</samp>;
  −
* [[Random Events#Earthquake|<samp>earthquake</samp>]];
  −
* [[Random Events#The Crop Fairy|<samp>fairy</samp>]];
  −
* [[Random Events#Meteorite|<samp>meteorite</samp>]];
  −
* [[Random Events#Stone Owl|<samp>owl</samp>]];
  −
* [[Random Events#Strange Capsule|<samp>ufo</samp>]];
  −
* [[Random Events#The Witch|<samp>witch</samp>]].
  −
 
  −
Note that even if the farm event runs, it may exit without doing anything (e.g. rare events like <samp>ufo</samp> have extra condition checks when the start).
  −
|-
  −
| <samp>shop</samp>
  −
| ''Syntax:'' <samp>shop {{t|shop ID}} {{o|owner name}}</samp>
  −
 
  −
Open a [[#Custom shops|shop defined in <samp>Data/Shops</samp>]], regardless of whether one of the owners is nearby. Specifying {{o|owner name}} will use that NPC, otherwise the command will find the closest valid NPC if possible (else open with no NPC).
  −
|-
  −
| <samp>skinBuilding</samp> / <samp>bsm</samp>
  −
| If the player is standing right under a building, open a menu to change the building appearance.
  −
|-
  −
| <samp>testwedding</samp>
  −
| Immediately play the [[Marriage#The Wedding|wedding]] event.
  −
|-
  −
| <samp>thishouseupgrade</samp> / <samp>thishouse</samp> / <samp>thu</samp>
  −
| Equivalent to <samp>houseupgrade</samp>, but can be used to upgrade another player's house by running it from inside or just south of its exterior.
  −
|-
  −
| <samp>toggleCheats</samp>
  −
| Enable or disable entering debug commands into the in-game chat (prefixed with <samp>/</samp>).
  −
|-
  −
| <samp>tokens</samp>
  −
| ''Syntax:'' <samp>tokens {{t|tokenized string}}</samp>
  −
 
  −
Parses a [[Modding:Tokenizable strings|tokenizable string]] and prints its output. For example:
  −
<pre>
  −
tokens [LocalizedText Strings\StringsFromCSFiles:MapPage.cs.11064 [EscapedText [FarmName]]]
  −
> Result: "Lon Lon Farm"
  −
</pre>
  −
|-
  −
| <samp>worldMapLines</samp>
  −
| Toggles the [[Modding:World map#Debug view|world map's debug view]].
  −
|}</li>
  −
<li>Improved existing debug commands:
  −
{| class="wikitable"
  −
|-
  −
! command
  −
! changes
  −
|-
  −
| <samp>build</samp>
  −
| Removed custom space handling; quote arguments with spaces instead of replacing them with 9 (e.g. <code>Junimo9Hut</code> → <code>"Junimo Hut"</code>).
  −
|-
  −
| <samp>clearFurniture</samp>
  −
| Now works outside the farmhouse too.
  −
|-
  −
| <samp>dialogue</samp>
  −
| Removed custom space handling; quote NPC names containing spaces instead, with all text after the first argument treated as part of the dialogue (e.g. <code>debug dialogue "Some NPC" Some dialogue text$h</code>).
  −
|-
  −
| <samp>ebi</samp>
  −
| Fixed event not played correctly if called from the same location as the event.
  −
|-
  −
| <samp>fish</samp>
  −
| Fixed error if you're not holding a fishing rod. It now opens the fishing minigame with no tackle instead.
  −
|-
  −
| <samp>frameOffset</samp>
  −
| &#32;
  −
* Simplified usage. You can now pass negative offsets directly (like <samp>debug frameOffset -5 -10</samp>) instead of using the <samp>s</samp> number prefix.
  −
* Fixed command only taking the last digit in each number.
  −
|-
  −
| <samp>getStat</samp><br /><samp>setStat</samp>
  −
| Added argument validation.
  −
|-
  −
| <samp>grass</samp>
  −
| Now applies to the current location, instead of the farm.
  −
|-
  −
| <samp>growAnimals</samp><br /><samp>growAnimalsFarm</samp>
  −
| Merged into one <samp>growAnimals</samp> command that supports any location and doesn't reset the age of animals which are already adults.
  −
|-
  −
| <samp>growCrops</samp>
  −
| Fixed error growing mixed seeds or giant crops.
  −
|-
  −
| <samp>itemNamed</samp>
  −
| Removed custom space handling; quote arguments with spaces instead of removing them (e.g. <code>EelRoe</code> → <code>"Eel Roe"</code>).
  −
|-
  −
| <samp>junimoGoodbye</samp><br /><samp><samp>junimoStar</samp>
  −
| Added validation to check that you're inside the community center.
  −
|-
  −
| <samp>killAll</samp><br /><samp>killAllHorses</samp><br /><samp>killNpc</samp>
  −
| These now remove matching NPCs inside constructed buildings too.
  −
|-
  −
| <samp>killMonsterStat</samp>
  −
| Removed custom space handling; quote arguments with spaces instead of replacing them with 0 (e.g. <code>Dust0Spirit</code> → <code>"Dust Spirit"</code>).
  −
|-
  −
| <samp>mailForTomorrow</samp>
  −
| Fixed zeros in the mail ID getting replaced with underscores.
  −
|-
  −
| <samp>monster</samp>
  −
| Added validation for the monster name.
  −
|-
  −
| <samp>moveBuilding</samp>
  −
| Now applies to the current location, instead of the farm.
  −
|-
  −
| <samp>movie</samp>
  −
| Rewritten; it's now simpler, applies the normal game logic, defaults to today's movie, and avoids depending on NPC indexes in <samp>Data/NPCDispositions</samp> since those can change with custom NPCs.
  −
 
  −
New usage:
  −
: ''<samp>debug movie {{o|movie ID}} {{o|invite NPC name}}''
  −
: ''<samp>debug movie current {{o|invite NPC name}}''
  −
 
  −
The movie ID defaults to today's movie, and the NPC name can be omitted to watch the movie without an invitee. Specifying <samp>current</samp> as the movie uses the default value.
  −
|-
  −
| <samp>panMode</samp>
  −
| The command no longer overrides debug command handling while it's active. Instead you can now turn it back off by running <samp>debug panMode</samp> again, clear with <samp>debug panMode clear</samp>, or set a time with <samp>debug panMode {time}</samp>.
  −
|-
  −
| <samp>paintBuilding</samp>
  −
| &#32;
  −
* Now applies to the current location, instead of the farm.
  −
* Added validation for the target building.
  −
|-
  −
| <samp>playSound</samp>
  −
| Added an optional pitch argument, like <samp>debug playSound barrelBreak 1200</samp>. The pitch is a value from 1 (low pitch) to 2400 (high pitch) inclusively.
  −
|-
  −
| <samp>question</samp>
  −
| You can now forget a selected answer (instead of adding it) by setting the second argument to false, like <samp>question {{t|id}} false</samp>.
  −
|-
  −
| <samp>seenEvent</samp>
  −
| You can now forget an event (instead of adding it) by setting the second argument to false, like <samp>seenEvent {{t|id}} false</samp>.
  −
|-
  −
| <samp>seenMail</samp>
  −
| You can now remove a mail received (instead of adding it) by setting the second argument to false, like <samp>seenMail {{t|id}} false</samp>.
  −
|-
  −
| <samp>skinBuilding</samp>
  −
| &#32;
  −
* Now applies to the current location, instead of the farm.
  −
* Added validation for the target building.
  −
|-
  −
| <samp>skullGear</samp>
  −
| &#32;
  −
* Fixed command setting 32 slots instead of 36.
  −
* Fixed command not adding empty inventory slots as expected by some game code.
  −
|-
  −
| <Samp>setupFishPondFarm</samp>
  −
| Fixed error if the farm already has non-fish-pond buildings constructed.
  −
|-
  −
| <samp>speech</samp>
  −
| Removed custom space handling; quote NPC names containing spaces instead, with all text after the first argument treated as part of the dialogue (e.g. <code>debug speech "Some NPC" Some dialogue text$h</code>).
  −
|-
  −
| <samp>spreadDirt</samp>
  −
| Now applies to the current location, instead of the farm.
  −
|-
  −
| <samp>spreadSeeds</samp>
  −
| Now applies to the current location, instead of the farm.
  −
|-
  −
| <samp>thisHouseUpgrade</samp>
  −
| Now applies to the current location, instead of the farm.
  −
|-
  −
| <samp>warpToPlayer</samp>
  −
| Removed custom space handling; quote arguments with spaces instead of removing them (e.g. <code>JohnSmith</code> → <code>"John Smith"</code>).
  −
|-
  −
| <samp>whereIs</samp>
  −
| &#32;
  −
* Now lists all matching NPCs instead of the first one.
  −
* Now searches the current event or festival, if any.
  −
|}</li>
  −
 
  −
<li>Removed some debug commands:
  −
{| class="wikitable"
  −
|-
  −
! command
  −
! notes
  −
|-
  −
| <samp>ax</samp><br /><samp>bigItem</samp>/<samp>b</samp>/<samp>bi</samp>/<samp>big</samp><br /><samp>boots</samp><br /><samp>clothes</samp><br /><samp>hoe</samp><br /><samp>milkPail</samp>/<samp>mp</samp><br /><samp>pan</samp><br /><samp>pickaxe</samp>/<samp>pick</samp>/<samp>pickax</samp><br /><samp>ring</samp>/<samp>addRing</samp><br /><samp>shears</samp>/<samp>scissors</samp><br /><samp>slingshot</samp><br /><samp>tool</samp><br /><samp>wateringCan</samp>/<samp>can</samp><br /><samp>wand</samp><br /><samp>weapon</samp>
  −
| These are replaced by more general commands like <code>item (O)128</code> (spawn item by ID), <code>fuzzyItemNamed pufferfish</code> (spawn by item name), or <code>itemQuery FLAVORED_ITEM Wine (O)128</code> (spawn by [[Modding:Item queries|item query]]).
  −
|-
  −
| <samp>addQuartz</samp><br /><samp>blueBook</samp><br /><samp>blueprint</samp><br /><samp>end</samp>
  −
| These were part of unused features removed in 1.6.
  −
|-
  −
| <samp>changeStat</samp>
  −
| Removed; use <samp>setStat</samp> instead.
  −
|-
  −
| <samp>ee</samp><br /><samp>endEvent</samp>/<samp>leaveEvent</samp><br /><samp>eventOver</samp>
  −
| Replaced by the new <samp>endEvent</samp> command.
  −
|-
  −
| <samp>oldMineGame</samp>
  −
| Removed along with the pre-1.4 [[Junimo Kart]] code.
  −
|-
  −
| <samp>pathSpouseToMe</samp>/<samp>pstm</samp>
  −
| Removed along with the unimplemented farm activities code.
  −
|}</li>
  −
 
  −
<li>Added alternative names for some debug commands (new names in parentheses): <samp>bpm</samp> + <samp>bsm</samp> (<samp>paintBuilding</samp> + <samp>skinBuilding</samp>), <samp>craftingRecipe</samp> (</samp>addCraftingRecipe</samp>), <samp>db</samp> (</samp>speakTo</samp>), <samp>dialogue</samp> (</samp>addDialogue</samp>), <samp>pdb</samp> (</samp>printGemBirds</samp>), <samp>r</samp> (</samp>resetForPlayerEntry</samp>), <samp>removeLargeTf</samp> (</samp>removeLargeTerrainFeature</samp>), <samp>sb</samp> (</samp>showTextAboveHead</samp>), <samp>sl</samp> + <samp>sr</samp> (<samp>shiftToolbarLeft</samp> + </samp>shiftToolbarRight</samp>), <samp>sn</samp> (</samp>secretNote</samp>), and <samp>tls</samp> (</samp>toggleLightingScale</samp>).</li>
  −
<li>Reworked how debug commands log output. This fixes an issue where they don't always log to the right place (e.g. a command run through the chatbox might log to the console or vice-versa), and lets mods pass a custom logger to capture or redirect output.</li>
  −
</ul>
  −
 
  −
====Location logic====
  −
* The [[desert]] no longer assumes the player arrived by bus unless their previous location was the [[Bus Stop|bus stop]].
  −
* The ticket price for the bus and Willy's boat can now be edited by C# mods via <samp>BusStop.TicketPrice</samp> and <samp>BoatTunnel.TicketPrice</samp> respectively.
  −
 
  −
====Menus & UI====
  −
* Rewrote calendar menu (<samp>Billboard</samp>) to simplify custom events & event types. C# mods can now edit <samp>billboard.calendarDayData</samp> or patch <samp>billboard.GetEventsForDay</samp> to add new events.
  −
* Added <samp>Game1.textShadowDarkerColor</samp> field for the colors previously hardcoded in <samp>Utility.drawTextWithShadow</samp>.
  −
* Added <samp>MoneyDial.ShouldShakeMainMoneyBox</samp> field to simplify custom dials.
  −
* The <samp>SpriteText</samp> methods now accept arbitrary <samp>Color</samp> tints instead of a few predefined color IDs.
  −
* The <samp>DiscreteColorPicker.getColorFromSelection</samp> methods are now static for reuse.
  −
* Fixed <samp>DiscreteColorPicker</samp> constructor ignoring the initial color argument, and added a constructor which takes a <samp>Color</samp> value.
  −
* Fixed an edge case where a custom language's fonts wouldn't be loaded when switching language.
  −
 
  −
====[[Modding:Modder Guide/Game Fundamentals#Net fields|Net fields]]====
  −
* Removed implicit conversion operators for most types due to their sometimes counter-intuitive behavior. The only ones left are <samp>NetBool</samp>, <samp>NetInt</samp>, and <samp>NetString</samp>; those are now marked obsolete and will raise build warnings on use.
  −
* <samp>NetLocationRef</samp> now has a public <samp>LocationName</samp> and <samp>IsStructure</samp>, and its <samp>Update</samp> method allows forcing an update.
  −
 
  −
====Quests====
  −
* Quests now have string IDs, to simplify custom quest frameworks.
  −
* Added validation for quest data parsing.
  −
* In [[Modding:Special orders|<samp>Data/SpecialOrders</samp>]], the <samp>Duration</samp> and <samp>Repeatable</samp> fields are now strongly-typed and case-insensitive.
  −
* For C# mods, fixed <samp>DescriptionElement</samp> not allowing more than four translation token substitutions.
  −
 
  −
====Dates & seasons====
  −
* Added a <samp>Season</samp> enum for strongly-typed, case-insensitive season checks (like <code>Game1.season == Season.Spring</code> instead of <code>Game1.currentSeason == "spring"</code>).
  −
* Added <samp>Game1.season</samp>, <samp>Game1.GetSeasonForLocation</samp>, <samp>Game1.WorldDate.Season</samp>, and <samp>location.GetSeason()</samp> to get the season enum.
  −
* Added <samp>Utility.getSeasonKey</samp> to get the key form from a season enum.
  −
* Improved <samp>WorldDate</samp>:
  −
** added <samp>Now()</samp> to get a new instance matching the current date;
  −
** added <samp>WorldDate.Equals</samp> and <samp>GetHashCode</samp> implementations;
  −
** added code docs;
  −
** <samp>TotalDays</samp> is no longer written to the save file.
  −
* Renamed some members for clarity (<samp>Game1.GetSeasonForLocation</samp> → <samp>GetSeasonKeyForLocation</samp>, <samp>location.GetSeasonForLocation</samp> → <samp>GetSeasonKey</samp>, <samp>WorldDate.Season</samp> → <samp>SeasonKey</samp>).
  −
* Fixed <samp>location.GetSeasonKey()</samp> not applying the greenhouse logic.
  −
 
  −
====Time====
  −
* For C# mods, the <samp>Game1.realMilliSecondsPerGame</samp> and <samp>Game1.realMilliSecondsPerGameTenMinutes</samp> fields are no longer marked <samp>const</samp>, and the <samp>GameLocation.getExtraMillisecondsPerInGameMinuteForThisLocation()</samp> method has been replaced with a settable <samp>ExtraMillisecondsPerInGameMinute</samp> property. That lets you change the time rate used by the vanilla game code, but you should be careful doing this since it may cause unintended effects.
  −
 
  −
====Other====
  −
* Error stack traces on Linux/macOS now have line numbers.
  −
* All space-delimited fields now ignore extra spaces instead of crashing. This affects map/tile properties, data assets, event commands, game state queries, etc.
  −
* All players and NPCs now have <samp>Tile</samp> & <samp>TilePoint</samp> properties (their cached tile position) and a <samp>StandingPixel</samp> property (the cached pixel coordinate at the center of their bounding box). These [[#Other breaking API changes|replace various deleted methods]].
  −
* All terrain features now have <samp>Tile</samp> and <samp>Location</samp> properties, and their methods no longer have location/tile parameters in most cases.
  −
* All [[Modding:Modder Guide/Game Fundamentals#Net fields|net fields]] now have <samp>Name</samp> and <samp>Owner</samp> fields, which are used to show informative error messages when there's a sync issue and validate common mistakes (e.g. a net field not added to the <samp>NetFields</samp> collection).
  −
* The game now tracks the locations a player has visited. Mods can check the list in C# (via <samp>Game1.player.locationsVisited</samp>) or [[Modding:Game state queries|game state queries]] (via <samp>PLAYER_VISITED_LOCATION</samp>). For pre-existing saves, the list is retroactively populated based on accessible locations, events seen, mail flags set, etc.
  −
* Added menu queuing (via <samp>Game1.nextClickableMenu</samp> in C#). For example, this applies if you try to take an item from a mail letter when your inventory is full.
  −
* Added C# code docs in many places.
  −
* Added <samp>Id</samp> fields to simplify content pack edits in fish pond, movie concession, random bundle, and tailoring recipe data.
  −
* Added <samp>Game1.Multiplayer</samp> to get the game's low-level handler. (Most code should still use [[Modding:Modder Guide/APIs/Multiplayer|SMAPI's multiplayer API]] though.)
  −
* Added <samp>Game1.versionBuildNumber</samp> with the build number (like <samp>26039</samp>).
  −
* Added field-changed events to <samp>NetPosition</samp>.
  −
* Added <samp>LocalizedContentManager.CurrentLanguageString</samp>, which caches the language code like <samp>pt-BR</samp>).
  −
* The game now uses <samp>[XmlInclude]</samp> on its types more consistently. That means the default save serializer can handle more types (e.g. all monsters), and it's easier to create custom serializers.
  −
* Refactored many parts of the code to make it more moddable for C# mods. This includes marking all classes public, changing <samp>private</samp> members to <samp>protected</samp> or <samp>public</samp>, marking members <samp>virtual</samp>, rewriting or splitting code so it's easier to extend, etc.
  −
* Fixed many cases where the game used <samp>Game1.player</samp> instead of the provided player.
  −
 
  −
==Breaking changes for C# mods==
  −
'''This section only describes how this update may break existing mods. See the ''what's new'' sections above for more info, including new functionality mods can use.'''
  −
 
  −
See also [[#Breaking changes for content packs|''Breaking changes for content packs'']], which affect C# mods too.
  −
 
  −
===.NET 6===
  −
: ''See also: [[#.NET 6|.NET 6]] under what's new.''
  −
 
  −
Stardew Valley 1.6 updates from .NET 5 to .NET 6. SMAPI can still load .NET 5 mods fine, but you'll get a build error when compiling them. To update a C# mod:
  −
<ol>
  −
<li>Make sure you have [https://visualstudio.microsoft.com/vs Visual Studio Community 2022] or later. (Compiling .NET 6 with earlier versions of Visual Studio isn't officially supported.)</li>
  −
<li>In Visual Studio, click ''Help > Check For Updates'' and install the latest version.</li>
  −
<li>Fully exit Visual Studio.</li>
  −
<li>Open each mod's <samp>.csproj</samp> file in a text editor, then find this line:
  −
<syntaxhighlight lang="xml">
  −
<TargetFramework>net5.0</TargetFramework>
  −
</syntaxhighlight>
  −
 
  −
And change it to this:
  −
<syntaxhighlight lang="xml">
  −
<TargetFramework>net6.0</TargetFramework>
  −
</syntaxhighlight>
  −
</li>
  −
<li>Delete your solution's hidden <samp>.vs</samp> folder, and every project's <samp>bin</samp> and <samp>obj</samp> folders.</li>
  −
<li>Reopen the solution in Visual Studio, click ''Build > Rebuild Solution'', and make sure it still loads into the game fine.</li>
  −
</ol>
  −
 
  −
===Item ID changes===
  −
: ''See also: [[#Custom items|custom items in what's new]].''
  −
 
  −
The [[#Custom items|main <samp>Item</samp> properties have changed]]. To migrate existing code:
  −
<ul>
  −
<li>Don't use <samp>ParentSheetIndex</samp> to compare items. For example, <samp>item.ParentSheetIndex == 0</samp> will match both [[weeds]] and any custom item whose sprite is the first one in its custom spritesheet. You should compare items using [[#Custom items|their new <samp>ItemId</samp> and <samp>QualifiedItemId</samp> properties]] instead. For example, here's how to migrate various common forms:
  −
 
  −
{| class="wikitable"
  −
|-
  −
! old code
  −
! new code
  −
|-
  −
|-
  −
| <samp>item.ParentSheetIndex == 848</samp>
  −
| <samp>item.QualifiedItemId == "(O)848"</samp>
  −
|-
  −
| <samp>IsNormalObjectAtParentSheetIndex(item, 74)</samp>
  −
| <samp>item.QualifiedItemId == "(O)74"</samp>
  −
|-
  −
| <samp>!item.bigCraftable && item.ParentSheetIndex == 128</samp>
  −
| <samp>item.QualifiedItemId == "(O)128"</samp>
  −
|-
  −
| <samp>item is Boots && item.ParentSheetIndex == 505</samp>
  −
| <samp>item.QualifiedItemId == "(B)505"</samp>
  −
|}</li>
  −
<li>Don't assume item sprites are in the vanilla spritesheets. For example, instead of rendering <samp>Game1.objectSpriteSheet</samp> for an object, call <code>ItemRegistry.GetMetadata(item.QualifiedItemId).GetTexture()</code> to get its texture.</li>
  −
<li>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>. This is the same value for vanilla items. For example:
  −
 
  −
<syntaxhighlight lang="c#">
  −
new Object("634", 1);                      // vanilla item
  −
new Object("Example.ModId_Watermelon", 1); // custom item
  −
</syntaxhighlight>
  −
 
  −
You can also use the new <samp>ItemRegistry</samp> API to construct items from their <samp>QualifiedItemId</samp>:
  −
 
  −
<syntaxhighlight lang="c#">
  −
Item item = ItemRegistry.Create("(B)505"); // Rubber Boots
  −
</syntaxhighlight></li>
  −
</ul>
  −
 
  −
===Other ID changes===
  −
Many other things in the game now have unique string IDs too (including [[#Buff overhaul|buffs]], [[#String event IDs|events]], and fruit trees). To migrate existing code:
  −
 
  −
* When referencing numeric IDs, you usually just need to convert them into a string (like <code>Game1.player.hasBuff("1590166")</code> or <code>Game1.player.eventsSeen.Contains("1590166")</code>).
  −
* When creating buffs, see [[#Buff overhaul|buff overhaul]] for how to create buffs now.
  −
 
  −
===Building and animal changes===
  −
: ''See also: [[#Build anywhere|build anywhere in what's new]].''
  −
 
  −
* Since all locations now allow buildings and animals, mod code which handles <samp>BuildableGameLocation</samp> and <samp>IAnimalLocation</samp> won't detect all buildable locations. You can replace them with <samp>location.IsBuildableLocation()</samp> (or just access <samp>location.buildings</samp> directly) and <samp>location.animals.Any()</samp> instead. Mods should no longer have any reference at all to <samp>BuildableGameLocation</samp> and <samp>IAnimalLocation</samp>.
  −
* Since buildings can be built anywhere, you can no longer assume a building is on the farm. You can check the new <samp>building.buildingLocation</samp> field instead.
  −
* You should review direct references to the farm (like <code>Game1.getFarm()</code> or <code>Game1.getLocationFromName("Farm")</code>) to see if it needs to be rewritten to allow other locations.
  −
* <code>Utility.numSilos()</code> should no longer be used to calculate available hay, since it doesn't account for custom buildings with hay storage. Use <code>Game1.getFarm().GetHayCapacity()</code> instead.
  −
* The <samp>Cat</samp> and <samp>Dog</samp> classes are now unused; all pets are now <samp>Pet</samp> directly.
  −
 
  −
===Player changes===
  −
: ''See also: [[#Buff overhaul|buff overhaul in what's new]].''
  −
 
  −
<ul>
  −
<li>Several <samp>Game1.player</samp> / <samp>Farmer</samp> fields changed as part of the [[#Buff overhaul|buff overhaul]]:
  −
{| class="wikitable"
  −
|-
  −
! old field
  −
! how to migrate
  −
|-
  −
| <samp>appliedBuffs</samp><br /><samp>appliedSpecialBuffs</samp>
  −
| Use <code>Game1.player.hasBuff(id)</code> instead.
  −
|-
  −
| <samp>attack</samp><br /><samp>immunity</samp>
  −
| Use <samp>Attack</samp> and <samp>Immunity</samp> instead.
  −
|-
  −
| <samp>addedCombatLevel</samp><br /><samp>addedFarmingLevel</samp><br /><samp>addedFishingLevel</samp><br /><samp>addedForagingLevel</samp><br /><samp>addedLuckLevel</samp><br /><samp>addedMiningLevel</samp><br /><samp>attackIncreaseModifier</samp><br /><samp>critChanceModifier</samp><br /><samp>critPowerModifier</samp><br /><samp>knockbackModifier</samp><br /><samp>resilience</samp><br /><samp>weaponPrecisionModifier</samp><br /><samp>weaponSpeedModifier</samp>
  −
| Use equivalent properties under <samp>Game1.player.buffs</samp> instead (e.g. <samp>Game1.player.buffs.CombatLevel</code>).
  −
|-
  −
| <samp>addedSpeed</samp><br /><samp>CombatLevel</samp><br /><samp>CraftingTime</samp><br /><samp>FarmingLevel</samp><br /><samp>FishingLevel</samp><br /><samp>ForagingLevel</samp><br /><samp>LuckLevel</samp><br /><samp>MagneticRadius</samp><br /><samp>MaxStamina</samp><br /><samp>MiningLevel</samp><br /><samp>Stamina</samp>
  −
| These are now readonly and can't be set directly. You can change them by [[#Buff overhaul|adding a buff]], equipment bonus, etc instead.
  −
|}</li>
  −
<li>Buffs are now recalculated automatically, and you can reset a buff by just reapplying it. See [[#Buff overhaul|buff overhaul]] for more info.</li>
  −
<li>Buff logic has been centralized into <samp>Game1.player.buffs</samp>. This replaces a number of former fields/methods like <samp>Game1.buffsDisplay</samp>.</li>
  −
</ul>
  −
 
  −
===Collision changes===
  −
The game's tile collision logic has been overhauled and merged into a simpler set of methods on <samp>GameLocation</samp> instances:
  −
 
  −
{| class="wikitable"
  −
|-
  −
! method
  −
! effect
  −
|-
  −
| <samp>CanSpawnCharacterHere</samp>
  −
| Get whether NPCs can be placed on the given tile (e.g. it's within the map bounds and tile is walkable), there's no placed object there, and the <samp>NoFurniture</samp> [[Modding:Maps|tile property]] isn't set.
  −
|-
  −
| <samp>CanItemBePlacedHere</samp>
  −
| Get whether items can be placed on the given tile in non-floating form (e.g. it's within the map bounds and not blocked by a non-walkable item), and the <samp>NoFurniture</samp> [[Modding:Maps|tile property]] isn't set.
  −
|-
  −
| <samp>isBuildable</samp>
  −
| Get whether buildings can be placed on the given tile.
  −
|-
  −
| <samp>IsTilePassable</samp>
  −
| Get whether the tile can be walked on (ignoring collisions with in-game objects, NPCs, etc).
  −
|-
  −
| <samp>IsTileOccupiedBy</samp>
  −
| Get whether the tile contains a player, object, NPC/monster/pet/etc, terrain feature, building, etc. You can choose which entities to check, and which ones to ignore if they don't block movement.
  −
|-
  −
| <samp>IsTileBlockedBy</samp>
  −
| Equivalent to calling both <samp>IsTilePassable</samp> and <samp>IsTileOccupiedBy</samp>.
  −
|-
  −
| <samp>IsLocationSpecificOccupantOnTile</samp><br /><samp>IsLocationSpecificPlacementRestriction</samp>
  −
| Generally shouldn't be used directly. Checks for location-specific collisions (e.g. ladders in [[The Mines|the mines]] or parrot platforms on [[Ginger Island]]).
  −
|}
  −
 
  −
===Other breaking API changes===
  −
''(This section is meant as a quick reference if you have build errors; there's no need to read through it otherwise.)''
  −
 
  −
====Removed unused code====
  −
1.6 removes a lot of unused code. That includes these classes:
  −
{| class="wikitable"
  −
|-
  −
! namespace
  −
! class name
  −
|-
  −
| <samp>StardewValley</samp>
  −
| &#32;
  −
* <samp>BuildingUpgrade</samp>
  −
* <samp>DisposableList</samp>
  −
* <samp>FurniturePlacer</samp>
  −
* <samp>ListPool</samp>
  −
* <samp>OneTimeRandom</samp>
  −
|-
  −
| <samp>StardewValley.Characters</samp>
  −
| &#32;
  −
* <samp>BotchedNetBool</samp>
  −
* <samp>BotchedNetField</samp>
  −
* <samp>BotchedNetInt</samp>
  −
* <samp>BotchedNetLong</samp>
  −
|-
  −
| <samp>StardewValley.Menus</samp>
  −
| &#32;
  −
* <samp>FarmInfoPage</samp>
  −
* <samp>MiniatureTerrainFeature</samp><!-- not a typo, it really was in StardewValley.Menus -->
  −
|-
  −
| <samp>StardewValley.Monsters</samp>
  −
| &#32;
  −
* <samp>LavaCrab</samp>
  −
|-
  −
| <samp>StardewValley.Objects</samp>
  −
| &#32;
  −
* <samp>ObjectFactory</samp> (replaced by [[#Custom items|<samp>ItemRegistry</samp>]])
  −
|-
  −
| <samp>StardewValley.TerrainFeatures</samp>
  −
| &#32;
  −
* <samp>Quartz</samp>
  −
|-
  −
| <samp>StardewValley.Tools</samp>
  −
| &#32;
  −
* <samp>Blueprints</samp>
  −
* <samp>ToolFactory</samp> (replaced by [[#Custom items|<samp>ItemRegistry</samp>]])
  −
|}
  −
 
  −
And these class members:
  −
{| class="wikitable"
  −
|-
  −
! type
  −
! members
  −
|-
  −
| <samp>Axe</samp>
  −
| &#32;
  −
* <samp>StumpStrength</samp>
  −
|-
  −
| <samp>Bush</samp>
  −
| &#32;
  −
* <samp>alpha</samp>
  −
* <samp>lastPlayerToHit</samp>
  −
|-
  −
| <samp>Chest</samp>
  −
| &#32;
  −
* <samp>chestType</samp>
  −
* <samp>coins</samp>
  −
|-
  −
| <samp>CosmeticPlant</samp>
  −
| &#32;
  −
* <samp>scale</samp>
  −
|-
  −
| <samp>CraftingRecipe</samp>
  −
| &#32;
  −
* <samp>itemType</samp>
  −
|-
  −
| <samp>Critter</samp>
  −
| &#32;
  −
* <samp>InitShared()</samp>
  −
|-
  −
| <samp>Crop</samp>
  −
| &#32;
  −
* <samp>daysOfUnclutteredGrowth</samp>
  −
|-
  −
| <samp>Dialogue</samp>
  −
| &#32;
  −
* <samp>dialogueToBeKilled</samp>
  −
|-
  −
| <samp>Farm</samp>
  −
| &#32;
  −
* <samp>GetSpouseOutdoorAreaSpritesheetIndex()</samp>
  −
|-
  −
| <samp>FarmAnimal</samp>
  −
| &#32;
  −
* <samp>homeLocation</samp>
  −
|-
  −
| <samp>Farmer</samp>
  −
| &#32;
  −
* <samp>barnUpgradeLevel</samp> and <samp>BarnUpgradeLevel</samp>
  −
* <samp>blueprints</samp>
  −
* <samp>coalPieces</samp> and <samp>CoalPieces</samp>
  −
* <samp>coopUpgradeLevel</samp> and <samp>CoopUpgradeLevel</samp>
  −
* <samp>copperPieces</samp> and <samp>CopperPieces</samp>
  −
* <samp>eyeColor</samp>
  −
* <samp>feed</samp> and <samp>Feed</samp>
  −
* <samp>furnitureOwned</samp>
  −
* <samp>goldPieces</samp> and <samp>GoldPieces</samp>
  −
* <samp>hasBusTicket</samp>
  −
* <samp>hasGreenhouse</samp>
  −
* <samp>iridiumPieces</samp> and <samp>IridiumPieces</samp>
  −
* <samp>ironPieces</samp> and <samp>IronPieces</samp>
  −
* <samp>newSkillPointsToSpend</samp>
  −
* <samp>overallsColor</samp>
  −
* <samp>ownsFurniture</samp>
  −
* <samp>quartzPieces</samp> and <samp>QuartzPieces</samp>
  −
* <samp>shirtColor</samp>
  −
* <samp>skinColor</samp>
  −
* <samp>stonePieces</samp> and <samp>StonePieces</samp>
  −
* <samp>theaterBuildDate</samp>
  −
* <samp>woodPieces</samp> and <samp>WoodPieces</samp>
  −
|-
  −
| <samp>Game1</samp>
  −
| &#32;
  −
* <samp>boardingBus</samp>
  −
* <samp>chanceToRainTomorrow</samp>
  −
* <samp>checkForNewLevelPerks</samp>
  −
* <samp>cloud</samp>
  −
* <samp>coopDwellerBorn<samp>
  −
* <samp>cropsOfTheWeek</samp>
  −
* <samp>currentBarnTexture</samp>
  −
* <samp>currentBillboard</samp>
  −
* <samp>currentCoopTexture</samp>
  −
* <samp>currentFloor</samp>
  −
* <samp>currentHouseTexture</samp>
  −
* <samp>currentWallpaper</samp>
  −
* <samp>dealerCalicoJackTotal</samp>
  −
* <samp>FarmerFloor</samp>
  −
* <samp>farmerWallpaper</samp>
  −
* <samp>fertilizer</samp>
  −
* <samp>floorPrice</samp>
  −
* <samp>greenhouseTexture</samp>
  −
* <samp>inMine<samp>
  −
* <samp>jukeboxPlaying</samp>
  −
* <samp>keyHelpString</samp>
  −
* <samp>listeningForKeyControlDefinitions<samp>
  −
* <samp>littleEffect</samp>
  −
* <samp>logoScreenTexture</samp>
  −
* <samp>mailboxTexture</samp>
  −
* <samp>menuChoice</samp>
  −
* <samp>menuUp<samp>
  −
* <samp>nameSelectUp<samp>
  −
* <samp>nameSelectType</samp>
  −
* <samp>numberOfSelectedItems</samp>
  −
* <samp>particleRaining<samp>
  −
* <samp>pickingTool</samp>
  −
* <samp>pickToolDelay</samp>
  −
* <samp>pickToolInterval</samp>
  −
* <samp>priceOfSelectedItem</samp>
  −
* <samp>progressBar</samp>
  −
* <samp>removeSquareDebrisFromTile(…)</samp>
  −
* <samp>selectedItemsType</samp>
  −
* <samp>shiny</samp>
  −
* <samp>shippingTax</samp>
  −
* <samp>showKeyHelp<samp>
  −
* <samp>slotResult</samp>
  −
* <samp>startedJukeboxMusic</samp>
  −
* <samp>tinyFontBorder</samp>
  −
* <samp>toolHeld</samp>
  −
* <samp>toolIconBox</samp>
  −
* <samp>tvStation</samp>
  −
* <samp>tvStationTexture</samp>
  −
* <samp>wallpaperPrice</samp>
  −
|-
  −
| <samp>GameLocation</samp>
  −
| &#32;
  −
* <samp>boardBus(…)</samp>
  −
* <samp>checkForMapChanges()</samp>
  −
* <samp>getWallDecorItem(…)</samp>
  −
* <samp>removeBatch(…)</samp>
  −
* <samp>removeDirt(…)</samp>
  −
* <samp>removeStumpOrBoulder(…)</samp>
  −
* <samp>tryToBuyNewBackpack()</samp>
  −
|-
  −
| <samp>GiantCrop</samp>
  −
| &#32;
  −
* <samp>forSale</samp>
  −
|-
  −
| <samp>IClickableMenu</samp>
  −
| &#32;
  −
* <samp>currentRegion</samp>
  −
|-
  −
| <samp>MeleeWeapon</samp>
  −
| &#32;
  −
* <samp>attackSwordCooldownTime</samp>
  −
* <samp>doStabbingSwordFunction(…)</samp>
  −
|-
  −
| <samp>Monster</samp>
  −
| &#32;
  −
* <samp>doHorizontalMovement(…)</samp>
  −
* <samp>durationOfRandomMovements</samp>
  −
* <samp>coinsToDrop</samp>
  −
|-
  −
| <samp>NPC</samp>
  −
| &#32;
  −
* <samp>canReceiveThisItemAsGift(…)</samp>
  −
* <samp>idForClones</samp>
  −
|-
  −
| <samp>Object</samp>
  −
| &#32;
  −
* <samp>attachToSprinklerAttachment(…)</samp>
  −
* <samp>canBePlacedInWater()</samp>
  −
* <samp>consumeRecipe(…)</samp>
  −
* <samp>copperBar</samp>
  −
* <samp>goldBar</samp>
  −
* <samp>iridiumBar</samp>
  −
* <samp>ironBar</samp>
  −
* <samp>isHoeDirt</samp> and <samp>IsHoeDirt</samp>
  −
|-
  −
| <samp>PathFindController</samp>
  −
| &#32;
  −
* <samp>CheckClearance(…)</samp>
  −
* <samp>limit</samp>
  −
|-
  −
| <samp>SaveGame</samp>
  −
| &#32;
  −
* <samp>cropsOfTheWeek</samp>
  −
* <samp>currentFloor</samp>
  −
* <samp>currentWallpaper</samp>
  −
* <samp>FarmerFloor</samp>
  −
* <samp>farmerWallpaper</samp>
  −
* <samp>shippingTax</samp>
  −
|-
  −
| <samp>Spiker</samp>
  −
| &#32;
  −
* <samp>GetSpawnPosition</samp>
  −
|-
  −
| <samp>Stats</samp>
  −
| &#32;
  −
* <samp>barsSmelted</samp> and <samp>BarsSmelted</samp>
  −
* <samp>coalFound</samp> and <samp>CoalFound</samp>
  −
* <samp>coinsFound</samp> and <samp>coinsFound</samp>
  −
* <samp>starLevelCropsShipped</samp> and <samp>starLevelCropsShipped</samp>
  −
|-
  −
| <samp>Tool</samp>
  −
| &#32;
  −
* <samp>batteredSwordSpriteIndex</samp>
  −
* <samp>copperColor</samp>
  −
* <samp>GetSecondaryEnchantmentCount()</samp>
  −
* <samp>goldColor</samp>
  −
* <samp>iridiumColor</samp>
  −
* <samp>nonUpgradeable</samp>
  −
* <samp>parsnipSpriteIndex</samp>
  −
* <samp>Stackable</samp>
  −
* <samp>startOfNegativeWeaponIndex</samp>
  −
* <samp>steelColor</samp>
  −
|-
  −
| <samp>Utility</samp>
  −
| &#32;
  −
* <samp>buyFloor()</samp>
  −
* <samp>buyWallpaper()</samp>
  −
* <samp>cropsOfTheWeek()</samp>
  −
* <samp>facePlayerEndBehavior(…)</samp>
  −
* <samp>getRandomSlotCharacter()</samp>
  −
* <samp>plantCrops(…)</samp>
  −
* <samp>showLanternBar()</samp>
  −
|}
  −
 
  −
====Renamed classes====
  −
These classes were renamed in 1.6:
  −
{| class="wikitable"
  −
|-
  −
! old name
  −
! new name
  −
|-
  −
| <samp>Game1.MusicContext</samp>
  −
| <samp>MusicContext</samp> (in <samp>StardewValley.GameData</samp>)
  −
|-
  −
| <samp>LocationContext</samp>
  −
| <samp>LocationContexts</samp>
  −
|-
  −
| <samp>SpecialOrder.QuestStatus</samp>
  −
| <samp>SpecialOrderStatus</samp> (in <samp>StardewValley.SpecialOrders</samp>)
  −
|}
  −
 
  −
And these were moved to a different namespace:
  −
{| class="wikitable"
  −
|-
  −
! type
  −
! old namespace
  −
! new namespace
  −
|-
  −
| <samp>AmethystEnchantment</samp><br /><samp>AquamarineEnchantment</samp><br /><samp>ArchaeologistEnchantment</samp><br /><samp>ArtfulEnchantment</samp><br /><samp>AutoHookEnchantment</samp><br /><samp>AxeEnchantment</samp><br /><samp>BaseEnchantment</samp><br /><samp>BaseWeaponEnchantment</samp><br /><samp>BottomlessEnchantment</samp><br /><samp>BugKillerEnchantment</samp><br /><samp>CrusaderEnchantment</samp><br /><samp>DiamondEnchantment</samp><br /><samp>EfficientToolEnchantment</samp><br /><samp>EmeraldEnchantment</samp><br /><samp>FishingRodEnchantment</samp><br /><samp>GalaxySoulEnchantment</samp><br /><samp>GenerousEnchantment</samp><br /><samp>HaymakerEnchantment</samp><br /><samp>HoeEnchantment</samp><br /><samp>JadeEnchantment</samp><br /><samp>MagicEnchantment</samp><br /><samp>MasterEnchantment</samp><br /><samp>MilkPailEnchantment</samp><br /><samp>PanEnchantment</samp><br /><samp>PickaxeEnchantment</samp><br /><samp>PowerfulEnchantment</samp><br /><samp>PreservingEnchantment</samp><br /><samp>ReachingToolEnchantment</samp><br /><samp>RubyEnchantment</samp><br /><samp>ShavingEnchantment</samp><br /><samp>ShearsEnchantment</samp><br /><samp>SwiftToolEnchantment</samp><br /><samp>TopazEnchantment</samp><br /><samp>VampiricEnchantment</samp><br /><samp>WateringCanEnchantment</samp>
  −
| <samp>StardewValley</samp>
  −
| <samp>StardewValley.Enchantments</samp>
  −
|-
  −
| <samp>Extensions</samp>
  −
| <samp>StardewValley</samp>
  −
| <samp>StardewValley.Extensions</samp>
  −
|-
  −
| <samp>ModDataDictionary</samp><br /><samp>ModHooks</samp>
  −
| <samp>StardewValley</samp>
  −
| <samp>StardewValley.Mods</samp>
  −
|-
  −
| <samp>PathFindController</samp><br /><samp>PathNode</samp><br /><samp>PriorityQueue</samp><br /><samp>SchedulePathDescription</samp>
  −
| <samp>StardewValley</samp>
  −
| <samp>StardewValley.Pathfinding</samp>
  −
|-
  −
| <samp>SpecialOrder</samp>
  −
| <samp>StardewValley</samp>
  −
| <samp>StardewValley.SpecialOrders</samp>
  −
|-
  −
| <samp>CollectObjective</samp><br /><samp>DeliverObjective</samp><br /><samp>DonateObjective</samp><br /><samp>FishObjective</samp><br /><samp>GiftObjective</samp><br /><samp>JKScoreObjective</samp><br /><samp>OrderObjective</samp><br /><samp>ReachMineFloorObjective</samp><br /><samp>ShipObjective</samp><br /><samp>SlayObjective</samp>
  −
| <samp>StardewValley</samp>
  −
| <samp>StardewValley.SpecialOrders.Objectives</samp>
  −
|-
  −
| <samp>FriendshipReward</samp><br /><samp>GemsReward</samp><br /><samp>MailReward</samp><br /><samp>MoneyReward</samp><br /><samp>OrderReward</samp><br /><samp>ResetEventReward</samp>
  −
| <samp>StardewValley</samp>
  −
| <samp>StardewValley.SpecialOrders.Rewards</samp>
  −
|}
  −
 
  −
====Other API changes====
  −
These class members changed in 1.6:
  −
 
  −
{| class="wikitable"
  −
|-
  −
! type
  −
! member
  −
! migration
  −
|-
  −
| <samp>BigSlime</samp>
  −
| <samp>heldObject</samp>
  −
| Replaced by <samp>heldItem</samp>, which allows non-object items too.
  −
|-
  −
|rowspan="3"| <samp>Bush</samp>
  −
| <samp>overrideSeason</samp>
  −
| Removed; use <code>bush.currentLocation.GetSeason()</code> instead.
  −
|-
  −
| <samp>greenhouseBush</samp>
  −
| Removed; use <code>bush.IsSheltered()</code> or <code>bush.currentLocation.IsGreenhouse</code> instead.
  −
|-
  −
| <samp>inBloom</samp>
  −
| Remove the arguments, like <code>bush.inBloom(Game1.currentSeason, Game1.dayOfMonth)</code> → <code>bush.inBloom()</code>.
  −
|-
  −
|rowspan="3"| <samp>Character</samp>
  −
| <samp>getStandingX</samp><br /><samp>getStandingY</samp><br /><samp>getStandingXY</samp>
  −
| Removed; use <samp>character.StandingPixel</samp> instead.
  −
|-
  −
| <samp>getTileLocation</samp><br /><samp>getTileX</samp><br /><samp>getTileY</samp><br />
  −
| Removed; use <samp>character.Tile</samp> instead.
  −
|-
  −
| <samp>getTileLocationPoint</samp>
  −
| Removed; use <samp>character.TilePoint</samp> instead.
  −
|-
  −
| <samp>Chest</samp>
  −
| <samp>MoveToSafePosition</samp>
  −
| Replaced by the simpler <samp>TryMoveToSafePosition</samp>
  −
|-
  −
|rowspan="3"| <samp>Farmer</samp>
  −
| <samp>changePants(…)</samp>
  −
| Renamed to <samp>changePantsColor(…)</samp> for consistency with <samp>change[Eye&#124;Hair&#124;Shoe]Color</samp>.
  −
|-
  −
| <samp>isMarried()</samp>
  −
| Renamed to <samp>isMarriedOrRoommates()</samp> for clarity.
  −
|-
  −
| <samp>visibleQuestCount</samp>
  −
| Replaced by <samp>hasVisibleQuests</samp>.
  −
|-
  −
| <samp>Flooring</samp>
  −
| <samp>GetFloorPathLookup</samp>
  −
| Use <samp>Game1.floorPathData</samp> instead.
  −
|-
  −
| <samp>Forest</samp>
  −
| <samp>log</samp>
  −
| Moved into <samp>Forest.resourceClumps</samp>.
  −
|-
  −
| <samp>FruitTree</samp>
  −
| <samp>GreenHouseTree</samp>
  −
| Replaced by <samp>IgnoresSeasonsHere()</samp>.
  −
|-
  −
|rowspan="3"| <samp>Game1</samp>
  −
| <samp>bigCraftableInformation</samp>
  −
| Overhauled into [[#Custom big craftables|<samp>Game1.bigCraftableData</samp>]].
  −
|-
  −
| <samp>clothingInformation</samp>
  −
| Overhauled into [[#Custom shirts|<samp>Game1.shirtData</samp>]] and [[#Custom pants|<samp>Game1.pantsData</samp>]].
  −
|-
  −
| <samp>objectInformation</samp>
  −
| Overhauled into [[#Custom objects|<samp>Game1.objectData</samp>]].
  −
|-
  −
|rowspan="2"| <samp>GameLocation</samp>
  −
| <samp>getCharacters</samp>
  −
| Removed; use the <samp>characters</samp> field instead.
  −
|-
  −
| <samp>isTileOccupied</samp><br /><samp>isTileOccupiedForPlacement</samp><br /><samp>isTileOccupiedIgnoreFloors</samp><br /><samp>isTileLocationOpenIgnoreFrontLayers</samp><br /><samp>isTileLocationTotallyClearAndPlaceable</samp><br /><samp>isTileLocationTotallyClearAndPlaceableIgnoreFloors</samp>
  −
| Removed. The collision logic has been significantly rewritten and uses a new set of methods (mainly <samp>isTilePassable</samp>, <samp>IsTileOccupiedBy</samp>, and <samp>CanItemBePlacedHere</samp>). Mods should ideally be updated to use the new methods.
  −
 
  −
Here's a drop-in set of extension methods which re-add the older methods. This lets you temporarily fix code until you can update it properly, but depending on these isn't recommended since they won't be maintained in future versions.
  −
{{collapse|expand for non-recommended code|content=<syntaxhighlight lang="c#">
  −
public static class GameLocationExtensions
  −
{
  −
    public static bool isTileOccupiedForPlacement(this GameLocation location, Vector2 tileLocation, Object toPlace = null)
  −
    {
  −
        return location.CanItemBePlacedHere(tileLocation, toPlace != null && toPlace.isPassable());
  −
    }
  −
 
  −
    public static bool isTileOccupied(this GameLocation location, Vector2 tileLocation, string characterToIgnore = "", bool ignoreAllCharacters = false)
  −
    {
  −
        CollisionMask mask = ignoreAllCharacters ? CollisionMask.All & ~CollisionMask.Characters & ~CollisionMask.Farmers : CollisionMask.All;
  −
        return location.IsTileOccupiedBy(tileLocation, mask);
  −
    }
  −
 
  −
    public static bool isTileOccupiedIgnoreFloors(this GameLocation location, Vector2 tileLocation, string characterToIgnore = "")
  −
    {
  −
        return location.IsTileOccupiedBy(tileLocation, CollisionMask.Buildings | CollisionMask.Furniture | CollisionMask.Objects | CollisionMask.Characters | CollisionMask.TerrainFeatures, ignorePassables: CollisionMask.Flooring);
  −
    }
  −
 
  −
    public static bool isTileLocationOpenIgnoreFrontLayers(this GameLocation location, Location tile)
  −
    {
  −
        return location.map.RequireLayer("Buildings").Tiles[tile.X, tile.Y] == null && !location.isWaterTile(tile.X, tile.Y);
  −
    }
  −
 
  −
    public static bool isTileLocationTotallyClearAndPlaceable(this GameLocation location, int x, int y)
  −
    {
  −
        return location.isTileLocationTotallyClearAndPlaceable(new Vector2(x, y));
  −
    }
  −
 
  −
    public static bool isTileLocationTotallyClearAndPlaceableIgnoreFloors(this GameLocation location, Vector2 v)
  −
    {
  −
        return location.isTileOnMap(v) && !location.isTileOccupiedIgnoreFloors(v) && location.isTilePassable(new Location((int)v.X, (int)v.Y), Game1.viewport) && location.isTilePlaceable(v);
  −
    }
  −
 
  −
    public static bool isTileLocationTotallyClearAndPlaceable(this GameLocation location, Vector2 v)
  −
    {
  −
        Vector2 pixel = new Vector2((v.X * Game1.tileSize) + Game1.tileSize / 2, (v.Y * Game1.tileSize) + Game1.tileSize / 2);
  −
        foreach (Furniture f in location.furniture)
  −
        {
  −
            if (f.furniture_type != Furniture.rug && !f.isPassable() && f.GetBoundingBox().Contains((int)pixel.X, (int)pixel.Y) && !f.AllowPlacementOnThisTile((int)v.X, (int)v.Y))
  −
                return false;
  −
        }
  −
 
  −
        return location.isTileOnMap(v) && !location.isTileOccupied(v) && location.isTilePassable(new Location((int)v.X, (int)v.Y), Game1.viewport) && location.isTilePlaceable(v);
  −
    }
  −
}
  −
</syntaxhighlight>
  −
}}
  −
|-
  −
| <samp>GiantCrop</samp>
  −
| <samp>which</samp>
  −
| Replaced by <samp>itemId</samp>.
  −
|-
  −
| <samp>Item</samp>
  −
| <samp>SanitizeContextTag</samp>
  −
| Replaced by <samp>ItemContextTagManager.SanitizeContextTag</samp>.
  −
|-
  −
| <samp>LocalizedContentManager</samp>
  −
| <samp>LanguageCodeString</samp>
  −
| Now static.
  −
|-
  −
| <samp>LocationContextData</samp>
  −
| <samp>Name</samp>
  −
| Removed; use its dictionary key in <samp>Game1.locationContextData</samp> instead.
  −
|-
  −
| <samp>NetFields</samp>
  −
| <samp>AddFields</samp>
  −
| Removed; use <samp>AddField</samp> instead. For example:
  −
<syntaxhighlight lang="c#">
  −
// old code
  −
NetFields.AddFields(textureName, spriteWidth, spriteHeight);
  −
 
  −
// new code
  −
NetFields
  −
    .AddField(textureName)
  −
    .AddField(spriteWidth)
  −
    .AddField(spriteHeight);
  −
</syntaxhighlight>
  −
Note that the second argument (<samp>name</samp>) should usually be omitted, since it'll be auto-populated from the value passed to the first argument.
  −
|-
  −
|rowspan="4"| <samp>NPC</samp>
  −
| <samp>homeRegion</samp>
  −
| Removed; use <samp>npc.GetData()?.HomeRegion</samp> instead. Change <samp>0</samp> to <samp>"Other"</samp> or <samp>NPC.region_other</samp>, <samp>1</samp> to <samp>"Desert"</samp> or <samp>NPC.region_desert</samp>, and <samp>2</samp> to <samp>"Town"</samp> or <samp>NPC.region_town</samp>.
  −
|-
  −
| <samp>isBirthday</samp>
  −
| Remove the arguments, like <code>npc.isBirthday(Game1.currentSeason, Game1.dayOfMonth)</code> → <code>npc.isBirthday()</code>.
  −
|-
  −
| <samp>populateRoutesFromLocationToLocationList</samp>
  −
| Replaced by <samp>WarpPathfindingCache.PopulateCache</samp>.
  −
|-
  −
| <samp>Schedule</samp>
  −
| No longer assignable, use one of the <samp>TryLoadSchedule</samp> overloads instead.
  −
|-
  −
|rowspan="3"| <samp>Object</samp>
  −
| <samp>GetContextTagList()</samp>
  −
| Replaced by <samp>GetContextTags()</samp>, which returns a hash set instead of a list.
  −
|-
  −
| <samp>HasBeenPickedUpByPlayer</samp>
  −
| Removed; use <samp>HasBeenInInventory</samp> instead.
  −
|-
  −
| <samp>isPotentialBasicShippedCategory</samp>
  −
| The second argument should now be an integer (like <samp>-75</samp> or <samp>Object.VegetableCategory</samp>) instead of a string (like <samp>"-75"</samp>).
  −
|-
  −
|rowspan="9"| <samp>Utility</samp>
  −
| <samp>doesItemWithThisIndexExistAnywhere</samp>
  −
| Replace with <samp>Utility.doesItemExistAnywhere</samp>, which takes a string item ID. For example:
  −
* <code>Utility.doesItemWithThisIndexExistAnywhere(128)</code> &rarr; <code>Utility.doesItemExistAnywhere("(O)128")</code>;
  −
* <code>Utility.doesItemWithThisIndexExistAnywhere(128, true)</code> &rarr; <code>Utility.doesItemExistAnywhere("(BC)128")</code>.
  −
|-
  −
| <samp>ForAllLocations</samp><br /><samp>iterateAllCrops</samp><br /><samp>iterateAllItems</samp>
  −
| Removed; use the equivalent <samp>Utility.ForEach*</samp> methods instead.
  −
|-
  −
| <samp>GetHorseWarpRestrictionsForFarmer</samp>
  −
| This now returns a flag enum instead of a list of integer values. The equivalent values are 1 → <samp>NoOwnedHorse</samp>, 2 → <samp>Indoors</samp>, 3 → <samp>NoRoom</samp>, and 4 → <samp>InUse</samp>.
  −
 
  −
For example:
  −
<syntaxhighlight lang="c#">
  −
// old code
  −
bool inUse = Utility.GetHorseWarpRestrictionsForFarmer(player).Any(p => p == 4);
  −
 
  −
// new code
  −
bool inUse = Utility.GetHorseWarpRestrictionsForFarmer(player).HasFlag(Utility.HorseWarpRestrictions.InUse);
  −
</syntaxhighlight>
  −
 
  −
Or to check if no restrictions apply:
  −
<syntaxhighlight lang="c#">
  −
bool canSummon = Utility.GetHorseWarpRestrictionsForFarmer(player) == Utility.HorseWarpRestrictions.None;
  −
</syntaxhighlight>
  −
 
  −
C# mods can patch <samp>Utility.GetHorseWarpErrorMessage</samp> if they need to add an error message for a custom restriction value.
  −
|-
  −
| <samp>getRandomTownNPC(…)</samp>
  −
| Replaced by either <code>Utility.GetRandomWinterStartParticipant(…)</code> or <code>Utility.getRandomNpcFromHomeRegion(NPC.region_town)</code>.
  −
|-
  −
| <samp>getTodaysBirthdayNPC</samp>
  −
| Remove the arguments, like <code>Utility.getTodaysBirthdayNPC(Game1.currentSeason, Game1.dayOfMonth)</code> → <code>Utility.getTodaysBirthdayNPC()</code>.
  −
|-
  −
| <samp>getPooledList</samp><br /><samp>returnPooledList</samp>
  −
| The game no longer uses a list pool. In most cases you should use the [[#Iteration|<samp>Utility.ForEach*</samp> methods]] instead, which don't need it.
  −
|-
  −
| <samp>numObelisksOnFarm</samp>
  −
| Renamed to <samp>GetObeliskTypesBuilt</samp>, which searches all locations.
  −
|-
  −
| <samp>numSilos</samp>
  −
| Removed.
  −
 
  −
If you're using this to calculate hay capacity, it's a bit more complicated in 1.6 since hay storage can be enabled for custom buildings and building construction can be enabled for any location. To get capacity for the current location, use <samp>Game1.currentLocation.GetHayCapacity()</samp> instead. To get total hay capacity in the world, use <samp>Utility.ForEachLocation</samp> to call it on every location.
  −
 
  −
If you actually need the number of silos, use <samp>location.getNumberBuildingsConstructed("Silo")</samp> (one location) or <samp>Game1.GetNumberBuildingsConstructed("Silo")</samp> (all locations).
  −
|-
  −
| <samp>removeThisCharacterFromAllLocations</samp>
  −
| Removed; use <samp>Game1.removeCharacterFromItsLocation</samp> instead.
  −
|-
  −
| <samp>ShopMenu</samp>
  −
| <samp>storeContext</samp>
  −
| Replaced by <samp>ShopId</samp>.
  −
|-
  −
|rowspan="3"| <samp>Stats</samp>
  −
| <samp>averageBedtime</samp><br /><samp>beveragesMade</samp><br /><samp>bouldersCracked</samp><br /><samp>caveCarrotsFound</samp><br /><samp>cheeseMade</samp><br /><samp>chickenEggsLayed</samp><br /><samp>copperFound</samp><br /><samp>cowMilkProduced</samp><br /><samp>cropsShipped</samp><br /><samp>daysPlayed</samp><br /><samp>diamondsFound</samp><br /><samp>dirtHoed</samp><br /><samp>duckEggsLayed</samp><br /><samp>fishCaught</samp><br /><samp>geodesCracked</samp><br /><samp>giftsGiven</samp><br /><samp>goatCheeseMade</samp><br /><samp>goatMilkProduced</samp><br /><samp>goldFound</samp><br /><samp>goodFriends</samp><br /><samp>individualMoneyEarned</samp><br /><samp>iridiumFound</samp><br /><samp>ironFound</samp><br /><samp>itemsCooked</samp><br /><samp>itemsCrafted</samp><br /><samp>itemsForaged</samp><br /><samp>itemsShipped</samp><br /><samp>monstersKilled</samp><br /><samp>mysticStonesCrushed</samp><br /><samp>notesFound</samp><br /><samp>otherPreciousGemsFound</samp><br /><samp>piecesOfTrashRecycled</samp><br /><samp>preservesMade</samp><br /><samp>prismaticShardsFound</samp><br /><samp>questsCompleted</samp><br /><samp>rabbitWoolProduced</samp><br /><samp>rocksCrushed</samp><br /><samp>seedsSown</samp><br /><samp>sheepWoolProduced</samp><br /><samp>slimesKilled</samp><br /><samp>stepsTaken</samp><br /><samp>stoneGathered</samp><br /><samp>stumpsChopped</samp><br /><samp>timesFished</samp><br /><samp>timesUnconscious</samp><br /><samp>totalMoneyGifted</samp><br /><samp>trufflesFound</samp><br /><samp>weedsEliminated</samp>
  −
| Removed; use the equivalent property or methods. For example, <code>Game1.stats.daysPlayed</code> can be replaced with <code>Game1.stats.DaysPlayed</code> or methods like <code>Game1.stats.Get(StatKeys.DaysPlayed)</code>. See [[#Stat changes for C# mods|stat changes for C# mods]].
  −
|-
  −
| <samp>getStat(…)</samp><br /><samp>incrementStat(…)</samp>
  −
| Replaced by <samp>Get(…)</samp> and <samp>Increment(…)</samp>. See [[#Stat changes for C# mods|stat changes for C# mods]].
  −
|-
  −
| <samp>stat_dictionary</samp>
  −
| Renamed to <samp>Values</samp>. See [[#Stat changes for C# mods|stat changes for C# mods]].
  −
|-
  −
| <samp>Woods</samp>
  −
| <samp>stumps</samp>
  −
| Moved into <samp>resourceClumps</samp>.
  −
|}
  −
 
  −
===Check for obsolete code===
  −
Perform a full rebuild of your mod (in Visual Studio, click ''Build > Rebuild Solution''), then check the Error List pane for any warnings like "'''X' is obsolete''". Anything from the vanilla game code which is marked obsolete won't work anymore and is only kept for save migrations. Usually the warning will include an explanation of what you should use instead.
  −
 
  −
==Breaking changes for content packs==
  −
'''This section only describes how this update may break existing mods. See the ''what's new'' sections above for more info, including new functionality mods can use.'''
  −
 
  −
===Standardized ID fields===
  −
Stardew Valley 1.6 adds an <samp>Id</samp> field to these assets. For Content Patcher content packs, these replace the previous synthetic ID:
  −
 
  −
{| class="wikitable"
  −
|-
  −
! asset
  −
! old key
  −
! new key
  −
! migration steps
  −
|-
  −
| <samp>Data/ConcessionTastes</samp><br /><samp>Data/MovieReactions</samp><br /><samp>Data/RandomBundles</samp> (area)<br /><samp>Data/RandomBundles</samp> (bundle)
  −
| <samp>Name</samp><br /><samp>NPCName</samp><br /><samp>AreaName</samp><br />''none''
  −
|<samp>Id</samp>
  −
| None. The <samp>Id</samp> field is set automatically to the same value (or <samp>Name</samp> for bundles), so there's no change for content packs. Omit the new field when creating a new entry.
  −
|-
  −
| <samp>Data/FishPondData</samp><br /><samp>Data/RandomBundles</samp> (bundle set)
  −
| <samp>RequiredTags</samp><br />''none''
  −
| <samp>Id</samp>
  −
| Use the new <samp>Id</samp> field to target an entry, and add it when creating a new entry. Required.
  −
|-
  −
| <samp>Data/TailoringRecipes</samp>
  −
| <samp>FirstItemTags</samp> and <samp>SecondItemTags</samp>
  −
| <samp>Id</samp>
  −
| Use the new <samp>Id</samp> field to target an entry, and add it when creating a new entry. Defaults to the <samp>CraftedItemIds</samp> (comma-delimited) or <samp>CraftedItemId</samp> value if omitted, but there's a high chance of conflicts so mods should always specify a unique ID.
  −
|}
  −
 
  −
For example, let's say you have a patch like this using Content Patcher:
  −
{{#tag:syntaxhighlight|<nowiki>
  −
{
  −
    "Format": "</nowiki>{{Content Patcher version}}<nowiki>",
  −
    "Changes": [
  −
        {
  −
            "Action": "EditData",
  −
            "Target": "Data/TailorRecipes",
  −
            "Entries": {
  −
                "item_cloth|item_pufferchick": {
  −
                    "FirstItemTags": [ "item_cloth" ],
  −
                    "SecondItemTags": [ "item_pufferchick" ],
  −
                    "CraftedItemId": "(S)1260"
  −
                }
  −
            }
  −
        }
  −
    ]
  −
}</nowiki>|lang=javascript}}
  −
 
  −
When updating to Stardew Valley 1.6, replace the synthetic ID (<samp>item_cloth|item_pufferchick</samp>) with a real one:
  −
* To edit an existing entry, unpack the asset and get its new <samp>Id</samp> value.
  −
* To add a custom entry, use a [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]].
  −
 
  −
For example:
  −
{{#tag:syntaxhighlight|<nowiki>
  −
{
  −
    "Format": "</nowiki>{{Content Patcher version}}<nowiki>",
  −
    "Changes": [
  −
        {
  −
            "Action": "EditData",
  −
            "Target": "Data/TailorRecipes",
  −
            "Entries": {
  −
                "ExampleAuthor.ModId_RainCoatFromPufferchick": {
  −
                    "Id": "ExampleAuthor.ModId_RainCoatFromPufferchick", // need to specify ID again when creating it
  −
                    "FirstItemTags": [ "item_cloth" ],
  −
                    "SecondItemTags": [ "item_pufferchick" ],
  −
                    "CraftedItemId": "(S)1260"
  −
                }
  −
            }
  −
        }
  −
    ]
  −
}</nowiki>|lang=javascript}}
  −
 
  −
===Event ID changes===
  −
: ''See also: [[#String event IDs|string event IDs in what's new]].''
  −
 
  −
Events now have unique string IDs.
  −
 
  −
When creating an event:
  −
<ul>
  −
<li>New events should use a globally unique ID in the form <samp>Your.ModId_EventName</samp>. Existing events should be fine as-is, but it may be worth migrating them to avoid future conflicts.</li>
  −
<li>Every non-fork event '''must''' have a precondition in its key (even if it's empty). For example, change <code>"Your.ModId_EventName": "..."</code> to <code>"Your.ModId_EventName/": "..."</code>. This is needed for the game to distinguish between events and fork scripts.
  −
 
  −
<syntaxhighlight lang="js">
  −
"Example.ModId_EventName/": "...", // event: loaded automatically by the game
  −
"SomeFork": "..."                  // event fork: ignored unless it's loaded through an event script
  −
</syntaxhighlight></li>
  −
</ul>
  −
 
  −
===Monster eradication goal flag changes===
  −
: ''See also: [[#Custom monster eradication goals|Custom monster eradication goals]].''
  −
 
  −
The game now tracks [[Adventurer's Guild]] monster eradication goal completion by the goal ID, instead of the produced item. You'll need to replace these mail flags if you check them:
  −
 
  −
{| class="wikitable"
  −
|-
  −
! old flag
  −
! new flag
  −
|-
  −
| <samp>Gil_Slime Charmer Ring</samp>
  −
| <samp>Gil_Slimes</samp>
  −
|-
  −
| <samp>Gil_Savage Ring</samp>
  −
| <samp>Gil_Shadows</samp>
  −
|-
  −
| <samp>Gil_Vampire Ring</samp>
  −
| <samp>Gil_Bats</samp>
  −
|-
  −
| <samp>Gil_Skeleton Mask</samp>
  −
| <samp>Gil_Skeletons</samp>
  −
|-
  −
| <samp>Gil_Insect Head</samp>
  −
| <samp>Gil_Insects</samp>
  −
|-
  −
| <samp>Gil_Hard Hat</samp>
  −
| <samp>Gil_Duggy</samp>
  −
|-
  −
| <samp>Gil_Burglar's Ring</samp>
  −
| <samp>Gil_DustSpirits</samp>
  −
|-
  −
| <samp>Gil_Crabshell Ring</samp>
  −
| <samp>Gil_Crabs</samp>
  −
|-
  −
| <samp>Gil_Arcane Hat</samp>
  −
| <samp>Gil_Mummies</samp>
  −
|-
  −
| <samp>Gil_Knight's Helmet</samp>
  −
| <samp>Gil_Dinos</samp>
  −
|-
  −
| <samp>Gil_Napalm Ring</samp>
  −
| <samp>Gil_Serpents</samp>
  −
|-
  −
| <samp>Gil_Telephone</samp>
  −
| <samp>Gil_FlameSpirits</samp>
  −
|}
  −
 
  −
===XNB impact===
  −
====Overview====
  −
This section provides a summary of the XNB files which changed in Stardew Valley 1.6. This doesn't include new files (since they won't impact existing mods), or text changes in non-English files.
  −
 
  −
[[Modding:Using XNB mods|XNB mods]] are disproportionately affected, since...
  −
# they replace the entire file;
  −
# they're loaded through the MonoGame content pipeline which is less tolerant of format changes;
  −
# they don't benefit from the compatibility rewrites [[Modding:Content Patcher|Content Patcher]] provides for its content packs.
  −
 
  −
Content Patcher packs are typically unaffected (and Content Patcher will try to rewrite content packs automatically). However if a content pack replaces an entire asset instead of editing, it's more likely to be affected like an XNB mod.
  −
 
  −
====Changed assets====
  −
Compatibility is broadly grouped into four categories:
  −
* "'''✘ broken'''": mods will remove new content or significant changes, or the mod's intended changes will no longer work. Effects may range from display bugs to crashes, depending how the game uses that specific content.
  −
* "✘ will remove changes": mods will remove minor changes in 1.6 (e.g. typo fixes).
  −
* "✓ mostly unaffected": mods will only be affected if they replace the entire asset, or edit specific entries or fields.
  −
* Blank: no expected impact for the vast majority of mods.
  −
 
  −
{| class="wikitable"
  −
|-
  −
!rowspan="2"| content asset
  −
!rowspan="2"| changes in 1.6
  −
!colspan="2"| compatibility for pre-1.6 mods
  −
|-
  −
! XNB mods
  −
! Content Patcher packs
  −
|-
  −
| <samp>Buildings/houses</samp>
  −
| &#32;
  −
* fixed missing pixels
  −
| ✘ will remove changes
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Characters/Dialogue/Abigail</samp><br /><samp>Characters/Dialogue/Alex</samp>
  −
| &#32;
  −
* added [[#Dialogue changes|flower dance dialogue]]
  −
* fixed typos
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Characters/Dialogue/Caroline</samp><br /><samp>Characters/Dialogue/Demetrius</samp>
  −
| &#32;
  −
* fixed typos
  −
| ✘ will remove changes
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Characters/Dialogue/Elliott</samp>
  −
| &#32;
  −
* added [[#Dialogue changes|flower dance dialogue]]
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Characters/Dialogue/Emily</samp>
  −
| &#32;
  −
* added [[#Dialogue changes|flower dance dialogue]]
  −
* fixed typos
  −
* updated <samp>%revealtaste</samp> format (backwards-compatible)
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Characters/Dialogue/George</samp>
  −
| &#32;
  −
* added [[#Dialogue changes|Winter Star gift exchange dialogue]]
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Characters/Dialogue/Gus</samp>
  −
| &#32;
  −
* fixed typos
  −
| ✘ will remove changes
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Characters/Dialogue/Haley</samp>
  −
| &#32;
  −
* added [[#Dialogue changes|flower dance dialogue]]
  −
* fixed typos
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Characters/Dialogue/Harvey</samp>
  −
| &#32;
  −
* added [[#Dialogue changes|flower dance dialogue]]
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Characters/Dialogue/Jas</samp><br /><samp>Characters/Dialogue/Jodi</samp>
  −
| &#32;
  −
* fixed typos
  −
| ✘ will remove changes
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Characters/Dialogue/Krobus</samp>
  −
| &#32;
  −
* added [[#Dialogue changes|roommate stardrop dialogue]]
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Characters/Dialogue/Leah</samp>
  −
| &#32;
  −
* added [[#Dialogue changes|flower dance dialogue]]
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Characters/Dialogue/Lewis</samp>
  −
| &#32;
  −
* updated <samp>%revealtaste</samp> format (backwards-compatible)
  −
|
  −
|
  −
|-
  −
| <samp>Characters/Dialogue/Linus</samp>
  −
| &#32;
  −
* added [[#Dialogue changes|dumpster dive dialogue]]
  −
* fixed typos
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Characters/Dialogue/Marnie</samp>
  −
| &#32;
  −
* added [[#Dialogue changes|Stardew Valley Fair dialogue]]
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Characters/Dialogue/MarriageDialogue</samp><br /><samp>Characters/Dialogue/MarriageDialogueAbigail</samp><br /><samp>Characters/Dialogue/MarriageDialogueElliott</samp>
  −
| &#32;
  −
* fixed typos
  −
| ✘ will remove changes
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Characters/Dialogue/MarriageDialogueEmily</samp>
  −
| &#32;
  −
* changed <samp>spring_Maru</samp> key to <samp>spring_Emily</samp>
  −
* fixed typos
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Characters/Dialogue/MarriageDialogueKrobus</samp><br /><samp>Characters/Dialogue/MarriageDialogueLeah</samp><br /><samp>Characters/Dialogue/MarriageDialogueMaru</samp><br /><samp>Characters/Dialogue/MarriageDialoguePenny</samp><br /><samp>Characters/Dialogue/MarriageDialogueSam</samp>
  −
| &#32;
  −
* fixed typos
  −
| ✘ will remove changes
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Characters/Dialogue/Maru</samp>
  −
| &#32;
  −
* added [[#Dialogue changes|flower dance dialogue]]
  −
* fixed typos
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Characters/Dialogue/Penny</samp>
  −
| &#32;
  −
* added [[#Dialogue changes|flower dance dialogue]]
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Characters/Dialogue/Pierre</samp>
  −
| &#32;
  −
* added [[#Dialogue changes|Stardew Valley Fair dialogue]]
  −
* fixed typos
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Characters/Dialogue/Robin</samp>
  −
| &#32;
  −
* fixed typos
  −
| ✘ will remove changes
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Characters/Dialogue/Sam</samp>
  −
| &#32;
  −
* added [[#Dialogue changes|flower dance dialogue]]
  −
* fixed typos
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Characters/Dialogue/Sandy</samp>
  −
| &#32;
  −
* fixed typos
  −
| ✘ will remove changes
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Characters/Dialogue/Sebastian</samp>
  −
| &#32;
  −
* added [[#Dialogue changes|flower dance dialogue]]
  −
* fixed typos
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Characters/Dialogue/Willy</samp>
  −
| &#32;
  −
* added [[#Dialogue changes|Stardew Valley Fair dialogue]]
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Characters/Dialogue/Shane</samp>
  −
| &#32;
  −
* added [[#Dialogue changes|flower dance dialogue]]
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Characters/Farmer/hats</samp>
  −
| &#32;
  −
* removed stray pixel on chicken mask
  −
| ✘ will remove changes
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Characters/schedules/Elliott</samp>
  −
| &#32;
  −
* fixed order of <samp>Fri_6</samp> and <samp>Fri</samp> entries
  −
| '''✘ broken'''
  −
|
  −
|-
  −
| <samp>Characters/schedules/Lewis</samp>
  −
| &#32;
  −
* fixed <samp>winter_Sun</samp> schedule
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Characters/schedules/Maru</samp>
  −
| &#32;
  −
* fixed <samp>summer_Mon</samp> and <samp>summer_Sun</samp> schedules
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Characters/schedules/Penny</samp>
  −
| &#32;
  −
* fixed <samp>summer_Sun</samp> schedule
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Characters/Schedules/Shane</samp>
  −
| &#32;
  −
* fixed dialogue key
  −
| ✘ will remove changes
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Data/animationDescriptions</samp>
  −
| &#32;
  −
* fixed frame in Lewis' Saloon drinking animation
  −
| ✘ will remove changes
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Data/AquariumFish</samp>
  −
| &#32;
  −
* [[#Custom items|changed key type]]
  −
* added hat position for [[Sea Urchin]]
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Data/BigCraftablesInformation</samp>
  −
| &#32;
  −
* asset replaced by [[#Custom big craftables|<samp>Data/BigCraftables</samp>]]:
  −
** migrated to data model format
  −
** added new features
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected<br /><small>(covered by runtime migration)</small>
  −
|-
  −
| <samp>Data/Blueprints</samp>
  −
| &#32;
  −
* asset replaced by [[#Custom buildings|<samp>Data/Buildings</samp>]]:
  −
** migrated to data model format
  −
** added new features
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected<br /><small>(covered by runtime migration)</small>
  −
|-
  −
| <samp>Data/Boots</samp>
  −
| &#32;
  −
* [[#Custom items|changed key type]]
  −
* added display name
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected<br /><small>(covered by runtime migration)</small>
  −
|-
  −
| <samp>Data/Bundles</samp>
  −
| &#32;
  −
* can no longer omit empty fields before display name
  −
* added display name field in English
  −
* removed meat items in animal bundle
  −
| '''✘ broken'''
  −
| '''✘ likely broken'''
  −
|-
  −
| <samp>Data/ClothingInformation</samp>
  −
| &#32;
  −
* asset replaced by [[#Custom pants|<samp>Data/Pants</samp>]] and [[#Custom shirts|<samp>Data/Shirts</samp>]]:
  −
** migrated to data model format
  −
** added new features
  −
| '''✘ broken'''
  −
| '''✘ likely broken'''
  −
|-
  −
| <samp>Data/Concessions</samp>
  −
| &#32;
  −
* [[#Custom movie concessions|added new required fields (<samp>Texture</samp> and <samp>SpriteIndex</samp>)]]
  −
* replaced translations with [[Modding:Tokenizable strings|tokenizable strings]]
  −
* changed IDs to strings
  −
| '''✘ broken'''
  −
| '''✘ likely broken'''
  −
|-
  −
| <samp>Data/ConcessionTastes</samp>
  −
| &#32;
  −
* added automatic <samp>ID</samp> field
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Data/CookingRecipes</samp>
  −
| &#32;
  −
* replaced translations with [[Modding:Tokenizable strings|tokenizable strings]]
  −
* display names can now be omitted to use item name
  −
| ✘ will remove changes
  −
| ✓ may remove unaffected
  −
|-
  −
| <samp>Data/CraftingRecipes</samp>
  −
| &#32;
  −
* replaced translations with [[Modding:Tokenizable strings|tokenizable strings]]
  −
* display names can now be omitted to use item name
  −
* added <samp>default</samp> unlock condition
  −
* fixed typo in Cookout Kit entry
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Data/Crops</samp>
  −
| &#32;
  −
* [[#Custom crops|completely overhauled]]
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected<br /><small>(covered by runtime migration)</small>
  −
|-
  −
| <samp>Data/Events/AnimalShop</samp>
  −
| &#32;
  −
* updated command syntax (backwards-compatible)
  −
|
  −
|
  −
|-
  −
| <samp>Data/Events/Farm</samp>
  −
| &#32;
  −
* replaced send-mail events with [[Modding:Trigger actions|trigger actions]]
  −
* updated pet event to support custom pet types
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected<br /><small>(✘ may cause duplicate mail if they edit<br />send-mail events)</small>
  −
|-
  −
| <samp>Data/Events/FishShop</samp>
  −
| &#32;
  −
* fixed typos
  −
| ✘ will remove changes
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Data/Events/Forest</samp>
  −
| &#32;
  −
* fixed typos
  −
* updated Jas <samp>faceDirection</samp> command for sewer event
  −
| ✘ will remove changes
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Data/Events/IslandHut</samp>
   
| &#32;
 
| &#32;
* updated how Leo's name is translated
+
* changed key type to string
| ✘ will remove changes
+
* migrated to use item IDs (backwards-compatible)
| ✓ mostly unaffected
+
* fixed typo
|-
  −
| <samp>Data/Events/IslandNorth</samp>
  −
| &#32;
  −
* updated quote format
  −
* fixed blank music field (backwards-compatible)
   
| '''✘ broken'''
 
| '''✘ broken'''
| ✓ mostly unaffected<br /><small>(✘ likely broken if they edit the <samp>6497421</samp> event)</small>
  −
|-
  −
| <samp>Data/Events/IslandSouth</samp>
  −
| &#32;
  −
* fixed blank music field (backwards-compatible)
  −
* fixed typos
  −
| ✘ will remove changes
   
| ✓ mostly unaffected
 
| ✓ mostly unaffected
 
|-
 
|-
| <samp>Data/Events/JoshHouse</samp>
+
| <samp>Data/RandomBundles</samp>
 
| &#32;
 
| &#32;
* fixed typos
+
* add optional <samp>Id</samp> field
| ✘ will remove changes
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Data/Events/LeahHouse</samp>
  −
| &#32;
  −
* fixed <samp>move</samp> command format in Leah's 2-heart event
  −
* fixed typos
   
| '''✘ broken'''
 
| '''✘ broken'''
 
| ✓ mostly unaffected
 
| ✓ mostly unaffected
 
|-
 
|-
| <samp>Data/Events/Mountain</samp>
+
| <samp>Data/SecretNotes</samp>
 
| &#32;
 
| &#32;
* fixed skipped dialogue in Maru's 14-heart event
+
* updated <samp>%revealtaste</samp> format (backwards-compatible)
* fixed typos
   
| ✘ will remove changes
 
| ✘ will remove changes
 
| ✓ mostly unaffected
 
| ✓ mostly unaffected
 
|-
 
|-
| <samp>Data/Events/Saloon</samp><br /><samp>Data/Events/ScienceHouse</samp><br /><samp>Data/Events/SebastianRoom</samp>
+
| <samp>Data/SpecialOrders</samp>
 
| &#32;
 
| &#32;
* fixed typos
+
* changed type of <samp>Repeatable</samp> and <samp>Duration</samp> fields
| ✘ will remove changes
+
* added optional <samp>CustomFields</samp> and <samp>Conditions</samp> fields
| ✓ mostly unaffected
  −
|-
  −
| <samp>Data/Events/Town</samp>
  −
| &#32;
  −
* fixed <samp>warp</samp> command format in community center completed event
  −
* fixed typos
   
| '''✘ broken'''
 
| '''✘ broken'''
| ✓ mostly unaffected
+
|  
 
|-
 
|-
| <samp>Data/Events/WizardHouse</samp>
+
| <samp>Data/SpousePatios</samp><br /><samp>Data/SpouseRooms</samp>
| &#32;
  −
* fixed typos
  −
| ✘ will remove changes
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Data/ExtraDialogue</samp>
  −
| &#32;
  −
* split <samp>SummitEvent_Dialogue1_Spouse</samp> entry
  −
* fixed event command formats in some summit dialogue
  −
* moved [[#Dialogue changes|dumpster dive dialogue into NPC files]]
  −
* removed unused entries
  −
* fixed typos
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Data/FarmAnimals</samp>
   
| &#32;
 
| &#32;
* [[#Custom farm animals|completely overhauled]]
+
* removed asset (merged into [[#Custom NPCs|<samp>Data/Characters</samp>]])
 
| '''✘ broken'''
 
| '''✘ broken'''
 
| '''✘ broken'''
 
| '''✘ broken'''
 
|-
 
|-
| <samp>Data/Festivals/fall16</samp>
+
| <samp>Data/TailoringRecipes</samp>
 
| &#32;
 
| &#32;
* updated command syntax (backwards-compatible)
+
* changed to [[#Custom items|string item IDs]] (backwards-compatible)
* fixed typos
+
* added optional <samp>Id</samp> and <samp>CraftedItemIdFeminine</samp> fields
| ✘ will remove changes
+
* removed <samp>CraftedItemColor</samp> field
| ✓ mostly unaffected
+
* adjusted recipes for gender-variant shirts
|-
+
* standardized <samp>ID</samp><samp>Id</samp> naming
| <samp>Data/Festivals/fall27</samp>
  −
| &#32;
  −
* removed <samp>shop</samp> field (moved into [[#Custom shops|<samp>Data/Shops</samp>]])
  −
| ✓ mostly unaffected
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Data/Festivals/spring13</samp>
  −
| &#32;
  −
* migrated to new <samp>warpFarmers</samp> command
  −
* removed <samp>shop</samp> field (moved into [[#Custom shops|<samp>Data/Shops</samp>]])
  −
* updated <samp>faceDirection</samp> syntax
  −
* fixed typos
   
| '''✘ broken'''
 
| '''✘ broken'''
| ✓ mostly unaffected<br /><small>(✘ broken if they edit <samp>mainEvent</samp> or<br /><samp>afterEggHunt</samp> fields)</small>
+
| ✓ mostly unaffected<br /><small>(<samp>MoveEntries</samp> may break, but fallback entries<br />are now checked last automatically)</small>
|-
  −
| <samp>Data/Festivals/spring24</samp><br /><samp>Data/Festivals/summer11</samp><br /><samp>Data/Festivals/summer28</samp>
  −
| &#32;
  −
* migrated to new <samp>warpFarmers</samp> command
  −
* removed <samp>shop</samp> field (moved into [[#Custom shops|<samp>Data/Shops</samp>]])
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected<br /><small>(✘ broken if they edit <samp>mainEvent</samp> field)</small>
  −
|-
  −
| <br /><samp>Data/Festivals/winter8</samp>
  −
| &#32;
  −
* migrated to new <samp>warpFarmers</samp> command
  −
* removed <samp>shop</samp> field (moved into [[#Custom shops|<samp>Data/Shops</samp>]])
  −
* removed broken <samp>loadActors MainEvent</samp> command
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected<br /><small>(✘ broken if they edit <samp>mainEvent</samp> or<br /><samp>afterIceFishing</samp> field)</small>
  −
|-
  −
| <samp>Data/Festivals/winter25</samp>
  −
| &#32;
  −
* removed <samp>shop</samp> field (moved into [[#Custom shops|<samp>Data/Shops</samp>]])
  −
| ✓ mostly unaffected
  −
| ✓ mostly unaffected
   
|-
 
|-
| <samp>Data/Fish</samp>
+
| <samp>Data/TV/CookingChannel</samp><br /><samp>Data/TV/TipChannel</samp>
| &#32;
  −
* no longer has per-language versions
  −
* [[#Custom items|changed key type]]
  −
* field 13 now refers to whether fish can be tutorial catch
  −
| '''✘ broken'''
  −
| ✘ likely broken
  −
|-
  −
| <samp>Data/FishPondData</samp>
  −
| &#32;
  −
* added required <samp>Id</samp> & optional <samp>Precedence</samp> fields
  −
* standardized <samp>ID</samp>→<samp>Id</samp> naming
  −
* changed to qualified item IDs
  −
* moved fallback entries to bottom
  −
| '''✘ broken'''
  −
| ✘ likely broken
  −
|-
  −
| <samp>Data/fruitTrees</samp>
  −
| &#32;
  −
* [[#Custom fruit trees|completely overhauled]]
  −
| '''✘ broken'''
  −
| '''✘ broken'''
  −
|-
  −
| <samp>Data/Furniture</samp>
  −
| &#32;
  −
* [[#Custom items|changed key type]]
  −
* replaced translations with [[Modding:Tokenizable strings|tokenizable strings]]
  −
* [[#Custom items|changed key type]]
  −
* can no longer omit empty fields before display name
  −
| '''✘ broken'''
  −
| '''✘ likely broken'''
  −
|-
  −
| <samp>Data/hats</samp>
   
| &#32;
 
| &#32;
* [[#Custom items|changed key type]]
  −
* can no longer omit empty fields before display name
  −
* added display name field in English
  −
| '''✘ broken'''
  −
| '''✘ likely broken'''
  −
|-
  −
| <samp>Data/Locations</samp>
  −
| &#32;
  −
* [[#Custom locations|completely overhauled]]
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected<br /><small>(covered by runtime migration)</small>
  −
|-
  −
| <samp>Data/mail</samp>
  −
| &#32;
  −
* migrated to <samp>%item id</samp> (backwards-compatible)
  −
* removed unused entries
   
* fixed typos
 
* fixed typos
 
| ✘ will remove changes
 
| ✘ will remove changes
 
| ✓ mostly unaffected
 
| ✓ mostly unaffected
 
|-
 
|-
| <samp>Data/Monsters</samp>
+
| <samp>Data/weapons</samp>
 
| &#32;
 
| &#32;
* changed ''Dust Spirit'' display name to ''Dust Sprite''
+
* [[#Custom melee weapons|completely overhauled]]
| ✘ will remove changes
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Data/Movies</samp>
  −
| &#32;
  −
* [[#Custom movies|significantly overhauled]]
  −
| '''✘ broken'''
  −
| '''✘ broken'''
  −
|-
  −
| <samp>Data/MoviesReactions</samp>
  −
| &#32;
  −
* replaced translations with [[Modding:Tokenizable strings|tokenizable strings]]
  −
* standardized <samp>ID</samp>→<samp>Id</samp> naming
  −
* fixed typo
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Data/NPCDispositions</samp>
  −
| &#32;
  −
* asset replaced by [[#Custom NPCs|<samp>Data/Characters</samp>]]
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected<br /><small>(covered by runtime migration)</small>
  −
|-
  −
| <samp>Data/NPCGiftTastes</samp>
  −
| &#32;
  −
* removed invalid item IDs
  −
| ✘ will remove changes
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Data/ObjectContextTags</samp>
  −
| &#32;
  −
* asset removed (replaced by <samp>ContextTags</samp> field in [[#Custom big craftables|<samp>Data/BigCraftables</samp>]] and [[#Custom objects|<samp>Data/Objects</samp>]])
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected<br /><small>(covered by runtime migration,<br />except context tags defined<br />before their objects and context<br />tags for bigcraftables.)
  −
</small>
  −
|-
  −
| <samp>Data/ObjectInformation</samp>
  −
| &#32;
  −
* asset replaced by [[#Custom objects|<samp>Data/Objects</samp>]]:
  −
** migrated to data model format
  −
** added new features
  −
** added new entries
  −
** adjusted [[#Other item changes|litter items]]
  −
** fixed typos
   
| '''✘ broken'''
 
| '''✘ broken'''
 
| ✓ mostly unaffected<br /><small>(covered by runtime migration)</small>
 
| ✓ mostly unaffected<br /><small>(covered by runtime migration)</small>
|-
  −
| <samp>Data/PaintData</samp>
  −
| &#32;
  −
* fixed trailing slash in <samp>Deluxe Barn</samp> entry
  −
|
  −
|
  −
|-
  −
| <samp>Data/Quests</samp>
  −
| &#32;
  −
* changed key type to string
  −
* migrated to use item IDs (backwards-compatible)
  −
* fixed typo
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Data/RandomBundles</samp>
  −
| &#32;
  −
* add optional <samp>Id</samp> field
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Data/SecretNotes</samp>
  −
| &#32;
  −
* updated <samp>%revealtaste</samp> format (backwards-compatible)
  −
| ✘ will remove changes
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Data/SpecialOrders</samp>
  −
| &#32;
  −
* changed type of <samp>Repeatable</samp> and <samp>Duration</samp> fields
  −
* added optional <samp>CustomFields</samp> and <samp>Conditions</samp> fields
  −
| '''✘ broken'''
  −
|
  −
|-
  −
| <samp>Data/SpousePatios</samp><br /><samp>Data/SpouseRooms</samp>
  −
| &#32;
  −
* removed asset (merged into [[#Custom NPCs|<samp>Data/Characters</samp>]])
  −
| '''✘ broken'''
  −
| '''✘ broken'''
  −
|-
  −
| <samp>Data/TailoringRecipes</samp>
  −
| &#32;
  −
* changed to [[#Custom items|string item IDs]] (backwards-compatible)
  −
* added optional <samp>Id</samp> and <samp>CraftedItemIdFeminine</samp> fields
  −
* removed <samp>CraftedItemColor</samp> field
  −
* adjusted recipes for gender-variant shirts
  −
* standardized <samp>ID</samp>→<samp>Id</samp> naming
  −
| '''✘ broken'''
  −
| ✓ mostly unaffected<br /><small>(<samp>MoveEntries</samp> may break, but fallback entries<br />are now checked last automatically)</small>
  −
|-
  −
| <samp>Data/TV/CookingChannel</samp><br /><samp>Data/TV/TipChannel</samp>
  −
| &#32;
  −
* fixed typos
  −
| ✘ will remove changes
  −
| ✓ mostly unaffected
  −
|-
  −
| <samp>Data/weapons</samp>
  −
| &#32;
  −
* [[#Custom melee weapons|completely overhauled]]
  −
| '''✘ broken'''
  −
| '''✘ broken'''
   
|-
 
|-
 
| <samp>LooseSprites/Cursors</samp>
 
| <samp>LooseSprites/Cursors</samp>
Line 10,543: Line 7,891:     
==Vanilla release notes==
 
==Vanilla release notes==
{{note box|'''These are unofficial release notes for the 1.6 mod author alpha.'''<br />The [https://twitter.com/ConcernedApe new content announced by ConcernedApe] hasn't been revealed yet and isn't listed below.|type=warning}}
+
''Moved to [[Version History#1.6]].''
 
  −
This is a draft for the [[Version History]] section when 1.6 is released. Feel free to edit or suggest anything that was missed.
  −
 
  −
<blockquote>
  −
<big>'''1.6.0'''</big><br />
  −
Stardew Valley 1.6.0 was released to the Steam beta branch on XX XX 20XX, and released on XX XXXX 20XX.
  −
 
  −
; New content & features
  −
:* Added a world map for [[Ginger Island]], visible when visiting the island.
  −
:* The world map now shows your actual position within the world in real-time (instead of showing you at a fixed point for each location). In multiplayer, you'll see other players' position in real-time too.
  −
:* The farmhouse and pet bowl can now be moved through Robin's menu.
  −
:* The [[Farm Computer|farm computer]] can now be used anywhere to see a summary of that location, instead of only the farm.
  −
:* The [[Mini-Jukebox|mini-jukebox]] can now be used on the [[Ginger Island]] farm.
  −
:* Home renovations now have a purchase price, which is refunded if you undo the renovation. (The game knows whether you bought it though, so refunding a pre-1.6 renovation won't give you free money.)
  −
 
  −
; Balance changes
  −
:* You can no longer lose the Golden Scythe, Infinity weapons, or tools when dying.
  −
:* Added [[wikipedia:Coyote time|grace jumps]] in Junimo Kart: when you run off the track, you can still jump for a short time to recover.
  −
:* Increased the [[Forge#Enchantments|shaving enchantment]]'s effect on [[Crops#Giant Crops|giant crops]].<br /><small>Each giant crop now has a 60% chance of dropping an extra six crops while the shaving enchantment is equipped, spread across the number of hits needed to break it. For example, a base axe which breaks the giant crop in three hits gets three 20% chances of dropping 2 crops.</small>
  −
:* The [[The Cave|mushroom cave]] now provides mushrooms every second day. It was unintentionally changed to daily in Stardew Valley 1.5.
  −
:* Randomization no longer produces simple repeating patterns in many cases (e.g. clay farming, mushroom level prediction, crab pot fish offset, etc).<br /><small>You can enable "Use Legacy Randomization" in the [[Options|advanced save options]] to use the old randomization, though some specific patterns may still change due to the underlying changes. That option is mainly intended for speedrunners; most players should keep it disabled for the intended experience.</small>
  −
:* Rebalanced the [[Random Events#The Crop Fairy|crop fairy]] event: the chance no longer depends on the number of planted crops, it can no longer happen on the last day of the season (to avoid growing crops that might die overnight), and it can no longer choose dead crops to grow.
  −
:* Spreading [[weeds]] can no longer destroy [[Artifact Spot|artifact spots]].
  −
 
  −
; Quality of life changes
  −
:* NPCs now shove chests out of their way instead of destroying them.
  −
:* Redrew the world map to better match the in-game locations and be more detailed.
  −
:* Shops now have a slight delay before you can buy/sell items, to help avoid double-clicks doing it accidentally.
  −
:* Planting [[Cactus Seeds|cactus seeds]] on the farm now fails with a message, instead of the seeds dying overnight.
  −
:* [[Marnie's Ranch|Marnie's animal menu]] now shows prices in the tooltip, in case the tooltip covers the price display.
  −
:* Holding a [[Tea Sapling|tea sapling]] or [[Crops|seed]] over a [[Garden Pot|garden pot]] now shows the green/red placement tile.
  −
:* The museum reward menu now prevents picking up a reward that won't fit in your inventory.
  −
:* The museum reward menu now lets you exit while holding a reward. It'll be added to your inventory if possible, otherwise it'll drop at your feet.
  −
:* If an item menu exits while you're holding an item, the item is now always retrieved. (Previously only some item menus like chests would do it.)
  −
:* If a default farm building (like the greenhouse) is somehow removed, it'll now be rebuilt next time you load the save.
  −
:* You can no longer pick up rugs if there's something on it.
  −
:* You can now refill slingshot ammo by right-clicking it with the same ammo. Previously that would just swap the item stacks.
  −
:* Positional sounds now fade with distance when off-screen, instead of cutting off abruptly.
  −
:* Made more sounds positional (mainly player and tool sounds).
  −
:* Deleting a save on PC is now much faster.
  −
:* Significantly reduced save loading time when there are many custom locations.
  −
:* Performance improvements.
  −
:* You can now move full chests by hitting them with an axe, hoe, or pickaxe. The chests will shift one space at a time. (Previously this could only be achieved via collision and if the farmer's hands were empty.)
  −
 
  −
; Other changes
  −
:* Raised multiplayer limit to 8 players (on desktop only).
  −
:* Gender-specific clothing variants can now be worn by any gender.
  −
:* After reaching six hearts with some NPCs, they won't visit their rival love interest anymore. This affects [[Alex]] visiting [[Haley]], [[Elliott]] visiting [[Leah]], and Haley visiting Alex.
  −
:* The about page now shows the build number.
  −
:* The about page no longer hides the version if a tip message is shown.
  −
:* The [[Ginger Island#Gem Birds|Ginger Island shrine]] item pedestals are now normal items. Modded players can spawn them to display items decoratively (though they're not obtainable in vanilla currently).
  −
:* Fixed some NPC schedules not being applied:
  −
:** [[Lewis]] visiting the library on winter Sundays;
  −
:** [[Maru]] and [[Penny]] hanging out on summer Sundays;
  −
:** and [[Maru]] tinkering on summer Mondays.
  −
:* Removed 'lighting quality' option. The game now uses high-quality lighting by default.
  −
 
  −
; Fixes for gameplay
  −
:* Fixed issues with buffs:
  −
:** Fixed a range of bugs like attribute drift and double-debuff.
  −
:** Fixed food/drink buffs discarded if they have a balanced total of effects (e.g. +2 attack and -2 speed).
  −
:** Fixed negative custom buffs shown with a double-negative (e.g. "--2 speed").
  −
:** Fixed Squid Ink Ravioli buff not remaining active if another food buff is added later (although the buff icon was still shown).
  −
:** Fixed Squid Ink Ravioli not resetting the buff duration when you eat another one, unlike other food buffs.
  −
:** Fixed Squid Ink Ravioli description having an extra blank line.
  −
:** Fixed Burnt not showing the -3 Attack effect.
  −
:* Fixed unable to leave the [[Festival of Ice]] until it ends.
  −
:* Fixed player stuck in swimsuit if they collapse from damage while wearing it.
  −
:* Fixed gates popping off when opening or closing them while the player overlaps the tile.
  −
:* Fixed broken event if the player is defeated in the mines and their name contains a slash.
  −
:* Fixed fishing crash if a treasure chest appears while the player has a large number of stacked fishing buffs.
  −
:* Fixed issue where breaking a [[Bee House|bee house]] containing honey would drop a generic "Honey" item, instead of the flavored honey it would produce when harvested.
  −
:* Fixed issue where using the [[Rain Totem|rain totem]] during a storm would make the next day stormy too, instead of rainy.
  −
:* Fixed issue where you could clear a forest-themed [[The Mines|mine level]] without finding a ladder.
  −
:* Fixed issue where clicking an item attached to a letter could exit the letter if your inventory was full.
  −
:* Fixed random seeds on [[Ginger Island]] being based on the valley's season.
  −
:* Fixed items from dialogue being lost if your inventory was full. You'll now see a menu to collect them when the dialogue closes.
  −
:* Fixed dropped tools not recovered if they're inside a constructed building.
  −
:* Fixed potted [[Tea Bush|tea bushes]] planted in town not being harvestable.
  −
:* Fixed [[Farm Computer|farm computer]] counting [[Fiber Seeds|fiber crops]] as unwatered.
  −
:* Fixed [[Magic Bait|magic bait]] disabling some fish area checks (e.g. so you could catch river fish in the forest pond).
  −
:* Fixed [[Heavy Tapper|heavy tappers]] not tracked correctly. That caused issues like heavy-tapped trees not ignored when creating [[Mushroom Tree|mushroom trees]] in fall.
  −
:* Fixed [[Secret Notes|Secret Note #2]] not revealing [[Kent]]'s gift taste if he hasn't returned yet.
  −
:* Fixed [[Wedding Ring|wedding rings]] being giftable to NPCs.
  −
:* Fixed [[Watering Cans|watering can]]'s water left and capacity resetting on right-click into chest.
  −
:* Fixed [[Wilted Bouquet|wilted bouquet]] not cancelling the wedding if it hasn't happened yet.
  −
:* Fixed exploit where you could keep temporary items like Qi Fruit by selling them to Pierre and buying them back later.
  −
:* Fixed fruit trees being plantable on stone tiles outside the greenhouse.
  −
:* Fixed artifacts found while fishing not counting for the collections tab, and many other cases where item-received logic wasn't always applied.
  −
:* Fixed tilled dirt on the island farm able to decay under seasonal seed crops.
  −
:* Fixed riding an orphaned horse (e.g. spawned using [[Modding:Debug commands|debug commands]]) preventing you from owning or riding other horses.
  −
:* Fixed some mail not sent on the intended day if you don't leave the farmhouse that day.
  −
:* Fixed NPC spouse chores sometimes not applied on the intended day (e.g. saying they filled the pet water bowl but it's not filled).
  −
:* Fixed NPC spouses watering crops that don't need it (e.g. fiber seeds or already watered), and almost never showing the crops-were-already-watered dialogue.
  −
:* Fixed NPCs sometimes not reacting to dumpster diving if the horse is nearby.
  −
:* Fixed Penny losing items when redecorating if they were placed on a [[Stone Slab|stone slab]] (or a custom table without ''Table'' in the name).
  −
 
  −
; Fixes for NPC dialogue
  −
:* Enabled some dialogues that were accidentally never shown. That includes:
  −
:** Emily and Shane's [[Flower Dance]] custom accept-dance dialogues when married to the player.
  −
:** Shane's dialogue when browsing the Saloon vending machine.
  −
:** Lewis congratulating female farmers after their wedding.
  −
:** A line in Maru's 14-heart event.
  −
:** Three dialogues from Sam related to Kent<!--Thu6_1, Thu6_2, summer_Thu6_1-->.
  −
:** Two randomized dialogues when an NPC buys an item you sold to a shop.
  −
:** Two speech bubbles from Marnie and Robin when you enter their shop building.
  −
:** A fortune teller dialogue for your potential spouse.
  −
:* Fixed NPCs not having custom dialogue when accepting a movie invite for non-English players.
  −
:* Fixed Abigail showing both default and custom item delivery dialogue.
  −
:* Fixed Lewis skipping his final dialogue at the [[Festival of Ice]] on subsequent player wins.
  −
:* Fixed the [[Stardew Valley Fair|fortune teller]] nearly always showing the text for your combat skill, instead of your highest skill.
  −
:* Fixed issue where an NPC who bought an iridium-quality item you sold to a shop could show a low-item-quality dialogue for it.
  −
:* Fixed issue where NPC dialogue could reveal gift tastes for an invalid item.
  −
:* Fixed [[Abigail#Fourteen Hearts|monster grave text]] only shown in English.
  −
:* Fixed wrong message shown when placing indoors-only furniture outside.
  −
 
  −
; Fixes for visual or cosmetic issues
  −
:* The submerged [[fishing]] bobber is now recolored automatically to match the water.
  −
:* The perfection tracker now paginates better to fit the current screen size.
  −
:* Removed phantom action cursor over island farmhouse drawer.
  −
:* Removed phantom action cursor over backwoods gravestone if the current player hasn't seen [[Abigail#Fourteen Hearts|the related event]] yet.
  −
:* Fixed cursor over NPCs sometimes showing a gift icon when they won't accept or react to the held item.
  −
:* Fixed [[Quality Fertilizer|quality fertilizer]] showing a green tile on sprouted crops, even though it can't be placed there.
  −
:* Fixed the <code>!</code> fish bite icon not shown when fishing in the [[Stardew Valley Fair]] and [[Festival of Ice]].
  −
:* Fixed some in-game error messages not having an error icon.
  −
:* Fixed inventory & crafting menus misaligned if you resize the window while they're open.
  −
:* Fixed perfection tracker not skipping the typing effect when it's paginated.
  −
:* Fixed fruit tree leaves not rustling in winter even if they're in a non-seasonal location like the [[greenhouse]].
  −
:* Fixed weeds being less varied than intended in summer.
  −
:* Fixed weeds able to grow on top of buildings on spring 1.
  −
:* Fixed intro cutscene position not adjusted when the farmhouse is moved by a mod.
  −
:* Fixed cosmetic issues with the title & shipping screens for higher-resolution displays.
  −
:* Fixed calendar tooltip when a modded festival and birthday occur on the same day.
  −
:* Fixed beds or chests that were hidden for an event not reappearing afterwards.
  −
:* Fixed pre-built cabins sometimes placed on top of a bush or log.
  −
:* Fixed furniture drawn over sitting players if it has no front texture.
  −
:* Fixed the [[forge]] preview always showing soul level one for a [[Galaxy Soul|galaxy soul]] forge.
  −
:* Fixed many things on [[Ginger Island]] applying the valley's season or weather (including [[Fiber Seeds|fiber seeds]], [[Seasonal Decor|seasonal decor]], [[Seasonal Plant|seasonal plants]], [[Tea Bush|tea bushes]], and [[Tub o' Flowers|tubs o' flowers]]).
  −
:* Fixed [[Options|advanced save option]] tooltips being able to extend off-screen, and not shown for some field labels.
  −
:* Fixed Elliott appearing twice during the [[Egg Festival|egg hunt]].
  −
:* Fixed Lewis' saloon drinking animation having an incorrect frame.
  −
:* Fixed bombs being invisible when placed on [[The Summit|the summit]].
  −
:* Fixed bombs able to remove [[Stick Bug|stick bugs]]' stick.
  −
:* Fixed clothing/tools sometimes showing the item-received notification on unequip.
  −
:* Fixed speech bubbles sometimes shown over invisible NPCs.
  −
:* Fixed HUD messages sometimes overlapping.
  −
:* Fixed fonts sometimes having a 'thin' look.
  −
:* Fixed world map tooltip for JojaMart disappearing when the movie theater is built.
  −
:* Fixed world map tooltip for Pierre's shop still showing "closed on Wednesdays" after he extends his business hours.
  −
:* Fixed [[Movie Theater#Crane Game|crane minigame]]'s music sometimes continuing a few seconds after the minigame ends.
  −
:* Fixed 'you received X' message & animation showing wrong item if you switch held item right as it's triggered.
  −
 
  −
; Fixes for display text and localization
  −
:* Spanish prices are now formatted like ''15o'' instead of ''15g'' to match the translated term (''oro'' instead of ''gold'').
  −
:* Fixed ''many'' issues in dialogue, events, and other display text (including typos, broken tokens, translations that don't match the original, etc).
  −
:* Fixed NPC name translations applied to horses/pets that share a name with that NPC.
  −
:* Fixed unlocalized text shown for...
  −
:** the building paint menu's region names (like "Roof" or "Trim");
  −
:** NPC names in some movie theater dialogue;
  −
:** Professor Snail's name after his first event;
  −
:** Leo's name in his introductory event for some languages;
  −
:** fish names for some languages in certain cases;
  −
:** the 'Miss' text when an attack misses.
  −
:* Fixed random name generator able to produce words similar to certain slurs.
  −
:* Fixed [[Dust Sprite|dust sprites]] called ''dust spirits'' in Clint's special order and the summit cutscene.
  −
:* Fixed Lewis' letter for Feast of the Winter Star saying it starts at 10am instead of 9am.
  −
:* Fixed some recipe names not matching the items they produce.
  −
:* Fixed the hats added in 1.5 translating their internal name instead of setting the display name in some languages.
  −
:* Fixed museum item descriptions not having an intended newline.
  −
:* Fixed Chinese date/time format.
  −
:* Fixed French formatting times past midnight like "26h" instead of "02h" (e.g. on the fishing TV channel).
  −
:* Fixed French and Turkish showing broken dialogues about another NPC's gift tastes.
  −
:* Fixed French-only display text bugs related to the <samp>^</samp> dialogue token.
  −
:* Fixed German truncating Professor Snail's name in his intro event.
  −
:* Fixed Japanese and Korean formatting buff effects inconsistently.
  −
:* Fixed Korean credit line missing in other languages.
  −
:* Fixed Russian event for Professor Snail's intro freezing.
  −
 
  −
; Fixes for multiplayer
  −
:* Possibly fixed frequent disconnections for some players.
  −
:* Possibly fixed issue where an old Steam account name could be shown to other players instead of your current display name.
  −
:* Accepting a Qi challenge that increases mine difficulty now only kicks other players out of the affected mine type, not all mines.
  −
:* You now need the same build number (in addition to version) to join multiplayer.
  −
:* Fixed global chat info messages (like "''Abigail caught PlayerName digging through the trash''") sometimes showing text in the sender's language instead of yours.
  −
:* Fixed [[Egg Festival|egg festival]] requiring 12 eggs to win if there are 5+ players. It now applies the four-player requirement to any player count beyond that.
  −
:* Fixed farmhands sometimes able to walk out of bounds at festivals.
  −
:* Fixed farmhands who disconnected while fishing sometimes stuck frozen on reconnect.
  −
:* Fixed farmhands who disconnected while playing a minigame (like Journey of the Prairie King) still hearing the music on the title screen.
  −
:* Fixed farmhands who disconnected while in the building placement view being invisible on rejoin.
  −
:* Fixed farmhands seeing spouse's outdoor area in the wrong spot on the beach farm.
  −
:* Fixed farmhands experiencing latency able to click a horse, walk to a different location, then get teleported out of bounds.
  −
:* Fixed farmhands' local effects sometimes based on host data (e.g. the host's equipped rings).
  −
:* Fixed farmhand crash while fishing in rare cases.
  −
:* Fixed farmhand crash when they warp just as certain things happen (e.g. pet sounds).
  −
:* Fixed crash when displaying a player status list which is missing a connected player.
  −
:* Fixed dialogue being interrupted if another player starts a broadcast event; the event will now start for you when you finish the current dialogue instead.
  −
:* Fixed enemy projectiles targeted at farmhands able to hit the host player in a different location.
  −
:* Fixed various cases where values weren't correctly synced between players.
  −
:* Fixed watered dirt edges not updated for farmhands when they change overnight.
  −
:* Fixed 'caught snooping' chat message not triggered when Marnie sees the player searching her trash bin.
  −
:* Fixed cleared-landslide mail only sent to the main player.
  −
:* Fixed [[Watering Cans|watering can]]'s water left and capacity not synced in multiplayer.
  −
:* Fixed the local player's step/fishing stats being incremented by other players walking or fishing.
  −
:* Fixed players sometimes seeing slightly different daily quests or [[Random Events#The Crop Fairy|crop fairy event]].
  −
:* Fixed issue where a farmhand donating the 60th museum artifact wouldn't grant the [[Rusty Key|rusty key]].
  −
 
  −
; Fixes for gamepads
  −
:* Fixed issue which could make Junimo Kart unplayable with a controller if you had rebound buttons to certain values.
  −
:* Improved controller navigation on the Junimo bundle page and world map.
  −
:* Fixed issue where viewing a letter with multiple pages and positioning the cursor directly above the skip button could cause the next viewed event to be skipped when the <samp>A</samp> button is pressed to progress text.
  −
 
  −
; Fixes for modded players
  −
:* Festivals now only set sunny weather in their location context. (For example, a custom festival in the desert no longer changes weather in the valley.)
  −
:* Monsters no longer [[Options#Advanced Game Options|spawn at night]] by default on custom farm types.
  −
:* Non-binary NPCs can now pathfind through any gendered route (e.g. men's or women's locker room), instead of defaulting to female routes.
  −
:* Fixed crashes when...
  −
:** loading a save with unknown locations, an invalid farm type, NPCs with no sprite texture, or null world objects.
  −
:** the farm map has no grass spawn tile and you walk through crops or grass.
  −
:** the data for an item, animal, tree, etc no longer exists.
  −
:** [[Carpenter's Shop#Painting|painting a building]] if its sprite changed to a smaller one since it was last painted.
  −
:** playing audio which doesn't exist (it now logs an error and plays a default 'quiet click' sound instead).
  −
:** a farmhand warps to a location which doesn't exist locally yet.
  −
:** an NPC can't parse its dialogue (it now logs the error and defaults to "..." instead).
  −
:** a [[Mini-Jukebox|mini-jukebox]] has an invalid track selected (it now turns off instead).
  −
:** a [[Mini-Shipping Bin|mini-shipping bin]] has null items.
  −
:** a [[Statue Of Endless Fortune|statue of endless fortune]] tries to produce a gift for an NPC whose first loved gift is a category or context tag (it now now chooses the first valid gift taste, and falls back to a non-birthday gift if none was found);
  −
:** a farm animal warps home in rare cases;
  −
:** the player's NPC spouse no longer exists (e.g. the mod which added it was removed).
  −
:* Fixed calendar support for multiple events on the same day (including multiple weddings, multiple birthdays, birthdays on a festival day, etc).
  −
:* Fixed horses in indoor locations or [[The Mines|mine]]/[[Volcano Dungeon|volcano]] levels unable to return home.
  −
:* Fixed event setup not allowing more than 9 players.
  −
:* Fixed events not exiting correctly if they crash before the first script command.
  −
:* Fixed event errors not logged to the console.
  −
:* Fixed potential event crash if a custom NPC name contains 'farmer'.
  −
:* Fixed save loading very slowly if it has a broken outdoors location in some cases.
  −
:* Fixed some items being unremovable when spawned by players. This affects [[Incubator|incubators]], [[The Cave#Mushrooms|mushroom boxes]], [[Slime Ball|slime balls]], and three unused items (locked doors and alternate [[Wicked Statue|wicked statue]]).
  −
:* Fixed issue when warping to [[Sandy]] early using mods where she could give daily quests as soon as you met her, but didn't accept items until you fixed the bus.
  −
:* Fixed issue where sleeping in a location where an event starts the next day would skip overnight events and soft-lock the game.
  −
:* Fixed invalid game state when the day of month increases past 28 due to a mod issue. Any day past 28 is now treated as the last day of the season.
  −
 
  −
; Other bug fixes
  −
:* Fixed crash when taking a screenshot on macOS if the <samp>~/.local</samp> folder doesn't exist.
  −
:* Fixed window resize on character creation resetting profit margins & starting cabins, and desyncing the 'skip intro' checkbox.
  −
:* Fixed able to equip a [[staircase]] as pants to obtain [[Trimmed Lucky Purple Shorts|trimmed lucky purple shorts]].
  −
:* Fixed being able to place a [[Yellow Couch|yellow couch]] in a [[loom]].
  −
:* Fixed wilderness farm spawning a stone in water.
  −
:* Fixed hilltop farm spawning grass inside of stumps.
  −
:* Fixed [[Trash Bear]] treated as a villager (e.g. it could theoretically be picked for quests).
  −
:* Fixed save folder collision if you set the save's name & seed to the same value as an existing save.
  −
:* Fixed selecting small buildings in the construction menu's farm view. This fixes the gap above the shipping bin where it can't be selected, and fixes small buildings selectable by hovering three tiles above them.
  −
:* Fixed the build number not set on Linux/macOS.
  −
:* Fixed copy & paste for invite codes on some Linux/macOS platforms.
  −
 
  −
; Other changes
  −
:* See [[Modding:Migrate to Stardew Valley 1.6|changes for mod authors]].
  −
</blockquote>
      
==See also==
 
==See also==