Modding:Objects
← Items
This page explains how the game stores and parses object-type item data. For items in general, see Modding:Items.
Overview
Objects are the default type for items in inventories or in the world. Depending on their data, they can be placed, picked up, eaten, sold to shops, etc.
They have item type (O)
(or ItemRegistry.type_object
in C# code), their data in Data/Objects, their icon sprites in Maps/springobjects or TileSheets/Objects_2 by default, and their code in StardewValley.Object. See a table of sprites and their corresponding indexes.
Data format
The object data in Data/Objects consists of a string → model lookup, where...
- The key is the unqualified item ID.
- The value is a model with the fields listed below.
Basic info
field | purpose |
---|---|
Name | The internal item name. |
DisplayName Description |
A tokenizable string for the item's in-game display name and description. |
Type | The item's general type, like Arch (artifact) or Minerals. The vanilla types are: Basic, Arch (artifact), Litter (e.g. debris), Minerals, Quest, Crafting, Fish, Cooking, Seeds, Ring, interactive, and some placeholder values like asdf.
Caution: adding custom items with the Arch type is inadvisable as it often leads to artifact spots becoming broken and not giving any items. |
Category | The item category. |
Price | (Optional) The price when sold by the player. This is not the price when bought from a shop. Default 0. |
Appearance
field | purpose |
---|---|
Texture | The asset name for the texture containing the item's sprite. Defaults to Maps/springobjects. |
SpriteIndex | The sprite's index within the Texture, where 0 is the top-left sprite. |
ColorOverlayFromNextIndex | (Optional) When drawn as a colored object, whether to apply the color to the next sprite in the spritesheet and draw that over the main sprite. If false, the color is applied to the main sprite instead. Default false. |
Edibility
field | purpose | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Edibility | (Optional) A numeric value that determines how much energy (edibility × 2.5) and health (edibility × 1.125) is restored when this item is eaten. An item with an edibility of -300 can't be eaten, values from -299 to -1 reduce health and energy, and zero can be eaten but doesn't change health/energy. Default -300. | ||||||||||||||||||||||||||||||||||
IsDrink | (Optional) Whether to drink the item instead of eating it. Default false. | ||||||||||||||||||||||||||||||||||
Buffs | (Optional) The buffs to apply to the player when this item is eaten, if any. Default none.
This consists of a list of models with these fields:
|
Geodes & artifact spots
field | purpose | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
GeodeDrops GeodeDropsDefaultItems |
(Optional) The items that can be dropped when breaking open this item as a geode. Specifying either or both fields automatically enables geode behavior for this item.
You can specify one or both fields:
If both fields are specified, each geode will choose between them with an equal 50% chance. If GeodeDrops is specified but no entries match, the geode will use the GeodeDropsDefaultItems regardless of whether it's true. | ||||||||||
ArtifactSpotChances | (Optional) If this is an artifact (i.e. the Type field is Arch), the chance that it can be found by digging artifact spots in each location.
This consists of a string → model lookup, where:
|
Context tags & exclusions
field | purpose |
---|---|
ContextTags | (Optional) The custom context tags to add for this item (in addition to the tags added automatically based on the other object data). This is formatted as a list; for example:
"ContextTags": [ "color_yellow", "fish_ocean", "fish_upright", "season_summer" ]
|
CanBeGivenAsGift | (Optional) Whether this item can be gifted to NPCs. Default true. |
CanBeTrashed | (Optional) Whether this item can be trashed from the player's inventory. Default true. |
ExcludeFromRandomSale | (Optional) Whether to exclude this item from shops when selecting random items to sell. Default false. |
ExcludeFromFishingCollection ExcludeFromShippingCollection |
(Optional) Whether to exclude this item from the fishing/shipping collection and their respective effect on the perfection score. Default false, in which case the normal requirements apply (e.g. artifacts are always excluded from the shipping collection). |
Advanced
field | purpose |
---|---|
CustomFields | (Optional) The custom fields for this entry. |
Unobtainable items
The spritesheet and data have items that can't normally be found in the player inventory (like twigs and lumber), and some sprites have no corresponding item data. There are also multiple entries for weeds and stone corresponding to different sprites, but the player can only normally obtain one stone item (index 390) and no weeds items.
For C# mods
Object-type items are represented by the StardewValley.Object type.
This provides many methods to simplify common logic. Some notable examples:
method | effect |
---|---|
object.IsBar() | Whether the item is a copper bar, iron bar, gold bar, iridium bar, or radioactive bar. |
object.IsBreakableStone() | Whether the item is a stone debris item which can be broken by a pickaxe. |
object.IsFence() | Whether the item is a fence. |
object.IsFruitTreeSapling() | Whether the item is a fruit tree sapling. This checks the Data\fruitTrees keys, so it works with custom fruit trees too. |
object.IsHeldOverHead() | Whether the player is shown holding up the item when it's selected in their toolbar. Default true (except for furniture). |
object.IsIncubator() | Whether the item can incubate farm animal eggs when placed in a building. |
object.IsTapper() | Whether the item is a tapper or heavy tapper. |
object.IsTeaSapling() | Whether the item is a tea sapling. |
object.IsTwig() | Whether the item is a twig debris item. |
object.IsWeeds() | Whether the item is a weed debris item. |
See also
- Modding:Items for item data in general