Modding:Objects
← Items
This page explains how the game stores and parses item data. This is an advanced guide for mod developers.
Objects
Objects are the default type for items in inventories or placed in the world.
They have their data in Data/Objects (Data/ObjectInformation prior to 1.6), their icon sprites in Maps/springobjects, and their code in StardewValley.Object. See a table of sprites and their corresponding indexes.
Data format
The object data in Data/Objects consists of a string → 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: Litter, Basic, Minerals, Quest, asdf, Crafting, Arch, fish, Cooking, Seeds, Ring, interactive |
| Category | The item category. |
| Price | (Optional) The price when sold by the player. This is not the price when bought from a shop. Default 0. |
Appearance
| field | purpose |
|---|---|
| Texture | The asset name for the texture containing the item's sprite. Defaults to Maps/springobjects. |
| SpriteIndex | The sprite's index within the Texture, where 0 is the top-left sprite. |
Edibility
| field | purpose | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Edibility | (Optional) A numeric value that determines how much energy (edibility × 2.5) and health (edibility × 1.125) is restored when this item is eaten. An item with an edibility of -300 can't be eaten, values from -299 to -1 reduce health and energy, and zero can be eaten but doesn't change health/energy. Default -300. | ||||||||||||||||||||||||||||||||||
| IsDrink | (Optional) Whether to drink the item instead of eating it. Default false. | ||||||||||||||||||||||||||||||||||
| Buffs | (Optional) The buffs to apply to the player when this item is eaten, if any. Default none.
This consists of a list of models with these fields:
|
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. |
Notes
- Prior to 1.6, items that have a number in index 6 (the "Crafting" field) showed buggy information in-game (e.g., Bean Hotpot prior to version 1.4). Items that had a number in the "Attack" field displayed the Attack icon and a number, but no description. It's unclear how these buffs work (if at all).
- Adding custom items with the Arch type is inadvisable as it often leads to Artifact Spots becoming broken and not giving any items.
- Named buffs (like Oil of Garlic, Life Elixir, or Tipsy) are implemented in code and can't be set in the food buff fields.
- The spritesheet and data have items that can't normally be found in the player inventory (like twigs and lumber), and some sprites have no corresponding item data. There are also multiple entries for weeds and stone corresponding to different sprites, but the player can only normally obtain one stone item (index 390) and no weeds items.
See also
- Modding:Index for related content like crops, fish, gift tastes, and recipes
History
- 1.6: Objects are now stored in Data/Objects rather than Data/ObjectInformation and have a new format.
- 1.6: Field 4 of hats is now used for tags, rather than displayName.
- 1.6: Display name field is now used for all languages.
- 1.6: Added Texture & texture index fields to all object data.
- 1.6: All types of items now use string IDs.