Difference between revisions of "Modding:Items"

From Stardew Valley Wiki
Jump to navigation Jump to search
(merge Modding:Context tags into page as-is (main content author: Lumisteria, raw data and copyediting by Pathoschild))
(→‎Context tags: expand info, replace raw data with example, rewrite to fit unified page)
Line 220: Line 220:
 
}}
 
}}
  
=Context tags=
+
===Context tags===
This page explains how the game stores and uses item context tags. This is an advanced guide for mod developers.  
+
A ''context tag'' is an arbitrary label attached to items, which can produce various effects in-game.
  
==Raw data==
+
Every item has built-in tags for metadata like the item name, quality, and category. Further context tags are defined in <samp>Data/ObjectContextTags</samp>, which consists of a string→string dictionary (where the key is the item's internal name, and the value is a comma-delimited list of tags to add):
Context tags are stored in <samp>Content\Data\ObjectContextTags.xnb</samp>, which can be [[Modding:Editing XNB files#unpacking|unpacked for editing]]. Here's the raw data as of {{version|1.5.1}}:
+
<syntaxhighlight lang="json">
{{collapse|Data|content=<syntaxhighlight lang="json">
 
{
 
  "Wild Horseradish": "color_brown, forage_item, season_spring",
 
  "Stone": "color_gray",
 
  "Daffodil": "color_yellow, forage_item, season_spring",
 
  "Leek": "color_white, forage_item, season_spring",
 
  "Dandelion": "color_yellow, forage_item, season_spring",
 
  "Parsnip": "color_yellow, season_spring, dye_medium",
 
  "Lumber": "color_brown, wood_item",
 
  "Emerald": "color_green",
 
  "Aquamarine": "color_aquamarine",
 
  "Ruby": "color_red",
 
  "Amethyst": "color_purple",
 
  "Topaz": "color_gold",
 
  "Jade": "color_jade",
 
  "Diamond": "color_white",
 
  "Prismatic Shard": "color_prismatic",
 
  "Cave Carrot": "color_brown, season_all, forage_item, forage_item_mines",
 
  "Quartz": "color_white",
 
  "Fire Quartz": "color_red",
 
  "Frozen Tear": "color_cyan",
 
  "Earth Crystal": "color_copper",
 
  "Coconut": "color_dark_brown, forage_item_desert, forage_item, season_all",
 
  "Cactus Fruit": "color_green, forage_item, forage_item_desert",
 
  "Sap": "color_yellow",
 
  "Torch": "light_source, color_yellow",
 
  "Spirit Torch": "light_source, color_light_cyan",
 
  "Dwarf Scroll I": "scroll_item, color_red, dye_strong",
 
  "Dwarf Scroll II": "scroll_item, color_green, dye_strong",
 
  "Dwarf Scroll III": "scroll_item, color_blue, dye_strong",
 
  "Dwarf Scroll IV": "scroll_item, color_yellow, dye_strong",
 
  "Chipped Amphora": "ceramic_item, ancient_item, color_brown, dye_strong",
 
  "Arrowhead": "hunting_item, color_gray, dye_strong",
 
  "Lost Book": "book_item",
 
  "Ancient Doll": "toy_item, color_blue, dye_strong",
 
  "Elvish Jewelry": "elvish_item, color_yellow, dye_strong",
 
  "Chewing Stick": "ancient_item, color_brown, dye_strong",
 
  "Ornamental Fan": "noble_item, color_white, dye_strong",
 
  "Dinosaur Egg": "dinosaur_item, egg_item, color_green, dye_strong",
 
  "Rare Disc": "color_dark_gray, dye_strong",
 
  "Ancient Sword": "ancient_item, color_gray, dye_strong",
 
  "Rusty Spoon": "cooking_item, color_gray, dye_strong",
 
  "Rusty Spur": "cowboy_item, color_brown, dye_strong",
 
  "Rusty Cog": "machine_item, color_brown, dye_strong",
 
  "id_o_113": "chicken_item, statue_item, color_sand, dye_strong",
 
  "Ancient Seed": "",
 
  "Prehistoric Tool": "prehistoric_item, color_gray, dye_strong",
 
  "Dried Starfish": "marine_item, color_yellow, dye_strong",
 
  "Anchor": "marine_item, color_gray, dye_strong",
 
  "Glass Shards": "color_cyan, dye_strong",
 
  "Bone Flute": "bone_item, prehistoric_item, instrument_item, color_sand, dye_strong",
 
  "Prehistoric Handaxe": "prehistoric_item, color_gray, dye_strong",
 
  "Dwarvish Helm": "dwarvish_item, color_brown, dye_strong",
 
  "Dwarf Gadget": "dwarvish_item, machine_item, color_gray, dye_strong",
 
  "Ancient Drum": "ancient_item, instrument_item, color_purple, dye_strong",
 
  "Golden Mask": "golden_relic_item, color_gold, dye_strong",
 
  "Golden Relic": "golden_relic_item, color_gold, dye_strong",
 
  "id_o_126": "doll_item, color_green, dye_strong, strange_doll_1",
 
  "id_o_127": "doll_item, color_yellow, dye_strong, strange_doll_2",
 
  "Pufferfish": "color_yellow, fish_ocean, season_summer, fish_upright",
 
  "Anchovy": "color_blue, fish_ocean, season_spring, season_fall, fish_talk_demanding",
 
  "Tuna": "color_blue, fish_ocean, season_summer, season_winter",
 
  "Sardine": "color_blue, fish_ocean, season_spring, season_fall, season_winter, fish_talk_demanding",
 
  "Bream": "color_blue, fish_river, season_all",
 
  "Largemouth Bass": "color_green, fish_lake, season_all",
 
  "Smallmouth Bass": "color_brown, fish_river, fish_pond, season_spring, season_fall",
 
  "Rainbow Trout": "color_orange, fish_river, season_summer",
 
  "Salmon": "color_salmon, fish_river, season_fall",
 
  "Walleye": "color_yellow, fish_river, fish_pond, fish_lake, season_fall, season_winter",
 
  "Perch": "color_yellow, fish_river, fish_pond, fish_lake, season_winter",
 
  "Carp": "color_yellow, fish_lake, fish_secret_pond, fish_sewers, season_spring, season_fall, season_winter, season_winter",
 
  "Midnight Carp": "color_iridium, fish_lake, season_fall, season_winter",
 
  "Flounder": "color_brown, fish_ocean, season_spring, season_summer",
 
  "Seafoam Pudding": "color_blue, food_seafood",
 
  "Catfish": "color_gray, fish_river, fish_secret_pond, fish_swamp, season_spring, season_summer, season_fall",
 
  "Pike": "color_yellow, fish_river, fish_pond, season_summer, season_winter, fish_carnivorous",
 
  "Sunfish": "color_orange, fish_river, season_spring, season_summer",
 
  "Red Mullet": "color_red, fish_ocean, season_summer, season_winter",
 
  "Herring": "color_blue, fish_ocean, season_spring, season_winter, fish_talk_demanding",
 
  "Eel": "color_copper, fish_ocean, season_spring, season_fall, fish_upright, fish_talk_rude",
 
  "Octopus": "color_orange, fish_ocean, season_summer, fish_upright",
 
  "Red Snapper": "color_red, fish_ocean, season_summer, season_fall, season_winter",
 
  "Squid": "color_white, fish_ocean, season_winter, fish_upright",
 
  "Seaweed": "color_green, fish_nonfish",
 
  "Green Algae": "color_dark_green, fish_nonfish, algae_item",
 
  "Sea Cucumber": "color_yellow, fish_ocean, season_fall, season_winter, fish_upright",
 
  "Super Cucumber": "color_purple, fish_ocean, season_summer, season_fall, fish_upright",
 
  "Ghostfish": "color_white, fish_mines, season_all",
 
  "White Algae": "color_white, fish_nonfish, algae_item",
 
  "Stonefish": "color_brown, fish_mines, fish_semi_rare, season_all, fish_upright",
 
  "Crimsonfish": "color_red, fish_legendary",
 
  "Angler": "color_yellow, fish_legendary, fish_upright",
 
  "Ice Pip": "color_blue, fish_mines, fish_semi_rare, season_all, fish_talk_demanding",
 
  "Lava Eel": "color_red, fish_mines, fish_semi_rare, season_all, fish_upright",
 
  "Legend": "color_green, fish_legendary",
 
  "Sandfish": "color_yellow, fish_desert, season_all",
 
  "Scorpion Carp": "color_brown, fish_desert, fish_semi_rare, season_all",
 
  "Treasure Chest": "color_yellow",
 
  "Joja Cola": "color_blue, drink_item",
 
  "Trash": "color_black, trash_item",
 
  "Driftwood": "color_brown, wood_item, trash_item",
 
  "Broken Glasses": "color_cyan, trash_item",
 
  "Broken CD": "color_cyan, trash_item",
 
  "Soggy Newspaper": "color_gray, trash_item",
 
  "Egg": "color_white, egg_item",
 
  "Large Egg": "color_white, egg_item, large_egg_item",
 
  "Hay": "color_yellow",
 
  "Milk": "color_white, drink_item, milk_item, cow_milk_item",
 
  "Large Milk": "color_white, drink_item, milk_item, large_milk_item, cow_milk_item",
 
  "Green Bean": "color_green, season_spring, dye_medium",
 
  "Fiddlehead Risotto": "color_green, food_pasta",
 
  "Cauliflower": "color_white, season_spring, dye_medium",
 
  "Potato": "color_brown, season_spring, dye_medium",
 
  "Fried Egg": "color_white, food_breakfast",
 
  "Omelet": "color_white, food_breakfast",
 
  "Salad": "color_green, food_salad",
 
  "Cheese Cauliflower": "color_white",
 
  "Baked Fish": "color_yellow",
 
  "Parsnip Soup": "color_yellow",
 
  "Vegetable Medley": "color_green",
 
  "Complete Breakfast": "color_yellow, food_breakfast",
 
  "Fried Calamari": "color_yellow",
 
  "Strange Bun": "color_pink",
 
  "Lucky Lunch": "color_yellow",
 
  "Fried Mushroom": "color_brown",
 
  "Pizza": "color_red, food_party",
 
  "Bean Hotpot": "color_green",
 
  "Glazed Yams": "color_brown",
 
  "Carp Surprise": "color_brown, food_seafood",
 
  "Hashbrowns": "color_brown, food_breakfast",
 
  "Pancakes": "color_brown, food_breakfast",
 
  "Salmon Dinner": "color_pink, food_seafood",
 
  "Fish Taco": "color_yellow, food_seafood, food_party",
 
  "Pepper Poppers": "color_brown, food_spicy",
 
  "Crispy Bass": "color_brown, food_seafood",
 
  "Bread": "color_brown, food_bakery",
 
  "Tom Kha Soup": "color_white, food_soup",
 
  "Trout Soup": "color_brown, food_seafood, food_soup",
 
  "Chocolate Cake": "color_brown, food_bakery, food_cake, food_sweet",
 
  "Pink Cake": "color_pink, food_bakery, food_sweet",
 
  "Rhubarb Pie": "color_red, food_bakery, food_sweet",
 
  "Cookie": "color_brown, food_bakery, food_sweet",
 
  "Spaghetti": "color_red, dye_medium, food_pasta",
 
  "Fried Eel": "color_yellow, food_seafood",
 
  "Spicy Eel": "color_red, food_seafood, food_spicy",
 
  "Sashimi": "color_pink, food_seafood, food_sushi",
 
  "Maki Roll": "color_black, food_seafood, food_sushi",
 
  "Tortilla": "color_brown",
 
  "Red Plate": "color_red",
 
  "Eggplant Parmesan": "color_red, dye_medium, food_pasta",
 
  "Rice Pudding": "color_white, food_sweet",
 
  "Ice Cream": "color_white, food_sweet",
 
  "Blueberry Tart": "color_blue, food_bakery, food_sweet",
 
  "Autumn's Bounty": "color_brown",
 
  "Pumpkin Soup": "color_orange, food_soup",
 
  "Super Meal": "color_green",
 
  "Cranberry Sauce": "color_red, dye_strong, food_sauce",
 
  "Stuffing": "color_brown, food_sauce",
 
  "Farmer's Lunch": "color_brown",
 
  "Survival Burger": "color_brown, food_party",
 
  "Dish O' The Sea": "color_yellow, food_seafood",
 
  "Miner's Treat": "color_red, food_sweet",
 
  "Roots Platter": "color_brown",
 
  "Sugar": "color_white, food_sweet",
 
  "Wheat Flour": "color_white",
 
  "Oil": "color_yellow",
 
  "Garlic": "color_white, season_spring, crop_year_2, dye_medium",
 
  "Kale": "color_green, season_spring, dye_strong",
 
  "Rhubarb": "color_red, season_spring, dye_medium",
 
  "Melon": "color_pink, dye_medium, season_summer",
 
  "Tomato": "color_red, dye_medium, season_summer",
 
  "Morel": "color_brown, forage_item, forage_item_secret, forage_item_cave, season_spring",
 
  "Blueberry": "color_blue, dye_strong, season_summer",
 
  "Fiddlehead Fern": "color_green, dye_strong, forage_item, forage_item_secret, season_summer",
 
  "Hot Pepper": "color_red, season_summer, dye_medium",
 
  "Wheat": "color_yellow",
 
  "Radish": "color_red, season_summer, dye_medium",
 
  "Red Cabbage": "color_purple, dye_medium, crop_year_2, season_summer",
 
  "Starfruit": "color_yellow",
 
  "Corn": "color_yellow, dye_medium, season_summer, season_fall",
 
  "Eggplant": "color_purple, dye_medium, season_fall",
 
  "Artichoke": "color_green, dye_medium, season_fall, crop_year_2",
 
  "Pumpkin": "color_orange, dye_medium, season_fall",
 
  "Bok Choy": "color_green, dye_medium, season_fall",
 
  "Yam": "color_brown, dye_medium, season_fall",
 
 
   "Chanterelle": "color_brown, forage_item, forage_item_cave, forage_item_secret, season_fall",
 
   "Chanterelle": "color_brown, forage_item, forage_item_cave, forage_item_secret, season_fall",
  "Cranberries": "color_red, dye_strong, season_fall",
+
</syntaxhighlight>
  "Holly": "color_red, forage_item, season_winter",
 
  "Beet": "color_dark_purple, dye_strong, season_fall",
 
  "Cherry Bomb": "color_red, bomb_item",
 
  "Bomb": "color_black, bomb_item",
 
  "Mega Bomb": "color_red, bomb_item",
 
  "Twig": "",
 
  "Salmonberry": "color_red",
 
  "Grass Starter": "",
 
  "Hardwood Fence": "",
 
  "Amaranth Seeds": "",
 
  "Amaranth": "color_pale_violet_red, dye_medium, season_fall",
 
  "Grape Starter": "",
 
  "Hops Starter": "",
 
  "Pale Ale": "color_gold, alcohol_item",
 
  "Hops": "color_green",
 
  "Void Egg": "color_black, egg_item",
 
  "Mayonnaise": "color_white",
 
  "Duck Mayonnaise": "color_white, mayo_item",
 
  "Dinosaur Mayonnaise": "dinosaur_item, color_white, mayo_item",
 
  "Void Mayonnaise": "color_red, mayo_item",
 
  "Acorn": "color_brown, tree_seed_item",
 
  "Maple Seed": "color_brown, tree_seed_item",
 
  "Pine Cone": "color_brown, tree_seed_item",
 
  "Wood Fence": "",
 
  "Stone Fence": "",
 
  "Iron Fence": "",
 
  "Gate": "",
 
  "Dwarvish Translation Guide": "",
 
  "Wood Floor": "",
 
  "Stone Floor": "",
 
  "Clay": "color_brown",
 
  "Weathered Floor": "",
 
  "Crystal Floor": "",
 
  "Copper Bar": "color_copper, furnace_item",
 
  "Iron Bar": "color_iron, furnace_item",
 
  "Gold Bar": "color_gold, furnace_item",
 
  "Iridium Bar": "color_iridium, furnace_item",
 
  "Refined Quartz": "color_iridium, furnace_item",
 
  "id_o_340": "color_yellow, honey_item",
 
  "Tea Set": "",
 
  "id_o_342": "color_green, pickle_item",
 
  "id_o_344": "color_dark_red, jelly_item",
 
  "Beer": "color_yellow, alcohol_item",
 
  "Rare Seed": "",
 
  "id_o_348": "color_dark_purple, drink_item, alcohol_item",
 
  "Energy Tonic": "color_red, medicine_item",
 
  "id_o_350": "color_green, drink_item, juice_item",
 
  "Muscle Remedy": "color_dark_yellow, medicine_item",
 
  "Tree Fertilizer": "color_brown, fertilizer_item",
 
  "Basic Fertilizer": "color_brown, fertilizer_item",
 
  "Quality Fertilizer": "color_brown, quality_fertilizer_item",
 
  "Basic Retaining Soil": "color_brown, fertilizer_item",
 
  "Quality Retaining Soil": "color_brown, quality_fertilizer_item",
 
  "Clam": "color_light_cyan, beach_item, fish_crab_pot, fish_ocean, forage_item, forage_item_beach, fish_upright",
 
  "Golden Pumpkin": "color_gold",
 
  "Copper Ore": "color_copper, ore_item",
 
  "Iron Ore": "color_iron, ore_item",
 
  "Coal": "color_black",
 
  "Gold Ore": "color_gold, ore_item",
 
  "Iridium Ore": "color_iridium, ore_item",
 
  "Wood": "color_brown, wood_item",
 
  "Nautilus Shell": "color_orange, marine_item, season_winter, forage_item, forage_item_beach",
 
  "Coral": "color_pale_violet_red, forage_item, forage_item_beach",
 
  "Rainbow Shell": "color_prismatic, forage_item, forage_item_beach, season_summer",
 
  "Coffee": "color_dark_brown",
 
  "Spice Berry": "color_orange, forage_item, season_summer",
 
  "Sea Urchin": "color_purple, forage_item, forage_item_beach",
 
  "Grape": "color_purple, forage_item, season_summer",
 
  "Spring Onion": "color_white, season_spring, forage_item",
 
  "Strawberry": "color_red, season_spring, dye_medium",
 
  "Straw Floor": "",
 
  "Sweet Pea": "color_purple, forage_item, season_summer, flower_item, dye_medium",
 
  "Field Snack": "color_brown",
 
  "Common Mushroom": "color_dark_brown, forage_item, season_spring, season_fall",
 
  "Wood Path": "",
 
  "Wild Plum": "color_dark_purple, season_fall, forage_item",
 
  "Gravel Path": "",
 
  "Hazelnut": "color_brown, forage_item, season_fall",
 
  "Crystal Path": "",
 
  "Blackberry": "color_dark_blue, season_fall, forage_item",
 
  "Cobblestone Path": "",
 
  "Winter Root": "color_orange, season_winter, forage_item, forage_item_mines",
 
  "Blue Slime Egg": "color_blue, slime_item, slime_egg_item",
 
  "Crystal Fruit": "color_blue, season_winter, forage_item",
 
  "Stepping Stone Path": "",
 
  "Snow Yam": "color_white",
 
  "Sweet Gem Berry": "color_red",
 
  "Crocus": "color_purple, season_winter, forage_item, flower_item, dye_medium",
 
  "Vinegar": "color_white",
 
  "Red Mushroom": "color_red, forage_item, season_summer, season_fall, forage_item_mines, forage_item_secret",
 
  "Sunflower": "color_yellow, flower_item, season_summer, season_fall, dye_medium",
 
  "Purple Mushroom": "color_purple, forage_item, forage_item_mines",
 
  "Rice Shoot": "",
 
  "Unmilled Rice": "color_brown, crop_year_2, season_spring",
 
  "Rice": "color_white",
 
  "Cheese": "color_yellow",
 
  "Goat Cheese": "color_yellow",
 
  "Cloth": "color_white",
 
  "Truffle": "color_brown",
 
  "Truffle Oil": "color_yellow",
 
  "Coffee Bean": "color_brown",
 
  "Stardrop": "",
 
  "Goat Milk": "color_white, milk_item, goat_milk_item",
 
  "Red Slime Egg": "color_red, slime_item, slime_egg_item",
 
  "L. Goat Milk": "color_white, milk_item, large_milk_item, goat_milk_item",
 
  "Purple Slime Egg": "color_purple, slime_item, slime_egg_item",
 
  "Wool": "color_white",
 
  "Explosive Ammo": "color_red",
 
  "Duck Egg": "color_white, egg_item",
 
  "Duck Feather": "color_green",
 
  "Rabbit's Foot": "color_yellow",
 
  "Stone Base": "",
 
  "Ancient Fruit": "color_cyan",
 
  "Algae Soup": "color_dark_green",
 
  "Pale Broth": "color_white",
 
  "Bouquet": "color_pink",
 
  "Mead": "color_gold, alcohol_item",
 
  "Mermaid's Pendant": "",
 
  "Decorative Pot": "",
 
  "Drum Block": "",
 
  "Flute Block": "",
 
  "Speed-Gro": "color_brown, fertilizer_item",
 
  "Deluxe Speed-Gro": "color_brown, quality_fertilizer_item",
 
  "Parsnip Seeds": "",
 
  "Bean Starter": "",
 
  "Cauliflower Seeds": "",
 
  "Potato Seeds": "",
 
  "Garlic Seeds": "",
 
  "Kale Seeds": "",
 
  "Rhubarb Seeds": "",
 
  "Melon Seeds": "",
 
  "Tomato Seeds": "",
 
  "Blueberry Seeds": "",
 
  "Pepper Seeds": "",
 
  "Wheat Seeds": "",
 
  "Radish Seeds": "",
 
  "Red Cabbage Seeds": "",
 
  "Starfruit Seeds": "",
 
  "Corn Seeds": "",
 
  "Eggplant Seeds": "",
 
  "Artichoke Seeds": "",
 
  "Pumpkin Seeds": "",
 
  "Bok Choy Seeds": "",
 
  "Yam Seeds": "",
 
  "Cranberry Seeds": "",
 
  "Beet Seeds": "",
 
  "Spring Seeds": "",
 
  "Summer Seeds": "",
 
  "Fall Seeds": "",
 
  "Winter Seeds": "",
 
  "Ancient Seeds": "",
 
  "Tulip Bulb": "",
 
  "Jazz Seeds": "",
 
  "Poppy Seeds": "",
 
  "Spangle Seeds": "",
 
  "Sunflower Seeds": "",
 
  "Fairy Seeds": "",
 
  "Small Glow Ring": "color_yellow",
 
  "Glow Ring": "color_yellow",
 
  "Small Magnet Ring": "color_gray",
 
  "Magnet Ring": "color_gray",
 
  "Slime Charmer Ring": "color_green",
 
  "Warrior Ring": "color_sand",
 
  "Vampire Ring": "color_red",
 
  "Savage Ring": "color_sand",
 
  "Ring of Yoba": "color_gold",
 
  "Sturdy Ring": "color_cyan",
 
  "Burglar's Ring": "color_jade",
 
  "Iridium Band": "color_iridium",
 
  "Wedding Ring": "color_iridium",
 
  "Jukebox Ring": "color_black",
 
  "Amethyst Ring": "color_purple",
 
  "Topaz Ring": "color_orange",
 
  "Aquamarine Ring": "color_cyan",
 
  "Jade Ring": "color_jade",
 
  "Emerald Ring": "color_green",
 
  "Ruby Ring": "color_red",
 
  "Geode": "color_brown",
 
  "Frozen Geode": "color_cyan",
 
  "Magma Geode": "color_red",
 
  "Alamite": "color_gray",
 
  "Bixite": "color_black",
 
  "Baryte": "color_red",
 
  "Aerinite": "color_cyan",
 
  "Calcite": "color_yellow",
 
  "Dolomite": "color_pink",
 
  "Esperite": "color_green",
 
  "Fluorapatite": "color_purple",
 
  "Geminite": "color_gray",
 
  "Helvite": "color_red",
 
  "Jamborite": "color_lime",
 
  "Jagoite": "color_gold",
 
  "Kyanite": "color_dark_blue",
 
  "Lunarite": "color_white, dye_strong",
 
  "Malachite": "color_green",
 
  "Neptunite": "color_black",
 
  "Lemon Stone": "color_orange",
 
  "Nekoite": "color_pink",
 
  "Orpiment": "color_orange",
 
  "Petrified Slime": "color_green, slime_item",
 
  "Thunder Egg": "color_dark_purple",
 
  "Pyrite": "color_gold",
 
  "Ocean Stone": "color_green",
 
  "Ghost Crystal": "color_gray",
 
  "Tigerseye": "color_orange",
 
  "Jasper": "color_red",
 
  "Opal": "color_light_cyan",
 
  "Fire Opal": "color_dark_purple",
 
  "Celestine": "color_iron",
 
  "Marble": "color_gray",
 
  "Sandstone": "color_sand",
 
  "Granite": "color_gray",
 
  "Basalt": "color_gray",
 
  "Limestone": "color_gray",
 
  "Soapstone": "color_white",
 
  "Hematite": "color_copper",
 
  "Mudstone": "color_brown",
 
  "Obsidian": "color_black",
 
  "Slate": "color_gray",
 
  "Fairy Stone": "color_purple",
 
  "Star Shards": "color_pink",
 
  "Prehistoric Scapula": "bone_item, color_white, prehistoric_item",
 
  "Prehistoric Tibia": "bone_item, color_white, prehistoric_item",
 
  "Prehistoric Skull": "bone_item, color_white, prehistoric_item",
 
  "Skeletal Hand": "bone_item, color_white, prehistoric_item",
 
  "Prehistoric Rib": "bone_item, color_white, prehistoric_item",
 
  "Prehistoric Vertebra": "bone_item, color_white, prehistoric_item",
 
  "Skeletal Tail": "bone_item, color_white, prehistoric_item",
 
  "Nautilus Fossil": "bone_item, color_white, prehistoric_item, marine_item, fossil_item",
 
  "Amphibian Fossil": "bone_item, color_white, prehistoric_item, marine_item, fossil_item",
 
  "Palm Fossil": "bone_item, color_white, fossil_item",
 
  "Trilobite": "bone_item, color_white, fossil_item",
 
  "Artifact Spot": "",
 
  "Tulip": "color_red, flower_item, season_spring, dye_medium",
 
  "Summer Spangle": "color_yellow, flower_item, season_summer, dye_medium",
 
  "Fairy Rose": "color_pink, flower_item, season_fall, dye_medium",
 
  "Blue Jazz": "color_blue, flower_item, season_spring, dye_medium",
 
  "Sprinkler": "",
 
  "Poppy": "color_orange, flower_item, season_summer, dye_medium",
 
  "Plum Pudding": "color_brown, food_sweet",
 
  "Artichoke Dip": "color_white",
 
  "Stir Fry": "color_brown",
 
  "Roasted Hazelnuts": "color_dark_brown",
 
  "Pumpkin Pie": "color_orange, food_bakery, food_sweet",
 
  "Radish Salad": "color_red, food_salad",
 
  "Fruit Salad": "color_yellow, food_salad",
 
  "Blackberry Cobbler": "color_dark_blue, food_sweet, food_bakery",
 
  "Cranberry Candy": "color_red, dye_strong, food_sweet",
 
  "Apple": "color_red, fruit_item, fruit_tree_item",
 
  "Bruschetta": "color_red, food_pasta",
 
  "Quality Sprinkler": "",
 
  "Iridium Sprinkler": "",
 
  "Coleslaw": "color_green",
 
  "Poppyseed Muffin": "color_poppyseed, food_sweet, food_bakery",
 
  "Cherry Sapling": "",
 
  "Apricot Sapling": "",
 
  "Orange Sapling": "",
 
  "Peach Sapling": "",
 
  "Pomegranate Sapling": "",
 
  "Apple Sapling": "",
 
  "Apricot": "color_orange, fruit_item, fruit_tree_item, season_spring",
 
  "Orange": "color_orange, fruit_item, fruit_tree_item, season_summer",
 
  "Peach": "color_pink, fruit_item, fruit_tree_item, season_summer",
 
  "Pomegranate": "color_dark_pink, fruit_item, fruit_tree_item, season_fall",
 
  "Cherry": "color_red, fruit_item, fruit_tree_item, season_spring",
 
  "Green Slime Egg": "color_green, slime_item, slime_egg_item",
 
  "Rain Totem": "color_brown, totem_item",
 
  "Mutant Carp": "color_green, fish_legendary",
 
  "Spook Fish": "color_blue, fish_semi_rare, fish_night_market",
 
  "Midnight Squid": "color_blue, fish_night_market, fish_semi_rare, fish_upright, fish_talk_stiff",
 
  "Blobfish": "color_sand, fish_night_market, fish_upright",
 
  "Bug Meat": "color_dark_pink",
 
  "Bait": "color_pink",
 
  "Spinner": "",
 
  "Dressed Spinner": "",
 
  "Warp Totem: Farm": "color_brown, totem_item",
 
  "Warp Totem: Mountains": "color_brown, totem_item",
 
  "Warp Totem: Beach": "color_brown, totem_item",
 
  "Warp Totem: Desert": "color_brown, totem_item",
 
  "Barbed Hook": "",
 
  "Lead Bobber": "",
 
  "Treasure Hunter": "",
 
  "Trap Bobber": "",
 
  "Cork Bobber": "",
 
  "Sturgeon": "color_cyan, fish_lake, season_summer, season_winter",
 
  "Tiger Trout": "color_brown, fish_river, season_fall, season_winter",
 
  "Bullhead": "color_brown, fish_lake, season_all",
 
  "Tilapia": "color_gray, fish_ocean, season_summer, season_fall",
 
  "Chub": "color_gray, fish_river, fish_lake, season_all",
 
  "Magnet": "",
 
  "Dorado": "color_orange, fish_river, season_summer, fish_carnivorous",
 
  "Albacore": "color_blue, fish_ocean, season_fall, season_winter",
 
  "Shad": "color_green, fish_river, season_spring, season_summer, season_fall",
 
  "Lingcod": "color_brown, fish_river, fish_lake, season_winter, fish_carnivorous",
 
  "Halibut": "color_dark_gray, fish_ocean, season_spring, season_summer, season_winter",
 
  "Hardwood": "color_brown, wood_item",
 
  "Crab Pot": "color_brown",
 
  "Lobster": "color_red, fish_crab_pot, fish_ocean",
 
  "Crayfish": "color_dark_gray, fish_crab_pot, fish_freshwater",
 
  "Crab": "color_red, fish_crab_pot, fish_ocean, fish_upright",
 
  "Cockle": "color_dark_gray, fish_crab_pot, fish_ocean, forage_item, forage_item_beach",
 
  "Mussel": "color_gray, fish_crab_pot, fish_ocean, forage_item, forage_item_beach",
 
  "Shrimp": "color_pink, fish_crab_pot, fish_ocean, fish_upright",
 
  "Snail": "color_yellow, fish_crab_pot, fish_freshwater, fish_upright",
 
  "Periwinkle": "color_cyan, fish_crab_pot, fish_freshwater, fish_upright",
 
  "Oyster": "color_gray, fish_crab_pot, fish_ocean, forage_item, forage_item_beach, fish_upright",
 
  "Maple Syrup": "color_brown, syrup_item",
 
  "Oak Resin": "color_green, syrup_item",
 
  "Pine Tar": "color_brown, syrup_item",
 
  "Chowder": "color_white, food_soup",
 
  "Lobster Bisque": "color_white, food_soup, food_seafood",
 
  "Fish Stew": "color_gray, food_seafood, food_soup",
 
  "Escargot": "color_gray",
 
  "Maple Bar": "color_brown, food_sweet, food_bakery",
 
  "Crab Cakes": "color_brown, food_seafood",
 
  "Shrimp Cocktail": "color_pink, food_seafood",
 
  "Woodskip": "color_orange, fish_secret_pond, fish_pond, season_all",
 
  "Strawberry Seeds": "",
 
  "Jack-O-Lantern": "color_orange",
 
  "Rotten Plant": "color_copper",
 
  "Omni Geode": "color_gray",
 
  "Slime": "color_gray, slime_item",
 
  "Bat Wing": "color_black",
 
  "Solar Essence": "color_yellow",
 
  "Void Essence": "color_purple",
 
  "Mixed Seeds": "",
 
  "Fiber": "color_green",
 
  "Oil of Garlic": "color_yellow_green, potion_item",
 
  "Life Elixir": "color_dark_pink, potion_item",
 
  "Wild Bait": "",
 
  "Glacierfish": "color_blue, fish_legendary, fish_upright",
 
  "Battery Pack": "color_cyan",
 
  "Lost Axe": "",
 
  "Pearl": "color_white",
 
  "Iridium Milk": "color_iridium",
 
  "Lucky Purple Shorts": "",
 
  "Berry Basket": "",
 
  "Void Salmon": "color_dark_purple, fish_semi_rare, fish_swamp, season_all, fish_talk_stiff",
 
  "Slimejack": "color_green, fish_semi_rare, fish_bug_lair, season_all",
 
  "Caviar": "color_black",
 
  "Squid Ink": "color_black",
 
  "Triple Shot Espresso": "color_dark_brown, dye_strong",
 
  "Green Tea": "color_green",
 
  "Tea Leaves": "color_green",
 
  "id_o_812": "color_orange",
 
  "id_o_447": "color_orange",
 
  "Bone Fragment": "bone_item, prehistoric_item, color_sand",
 
  "Fossilized Skull": "bone_item, prehistoric_item, color_sand",
 
  "Fossilized Spine": "bone_item, prehistoric_item, color_sand",
 
  "Fossilized Tail": "bone_item, prehistoric_item, color_sand",
 
  "Fossilized Leg": "bone_item, prehistoric_item, color_sand",
 
  "Fossilized Ribs": "bone_item, prehistoric_item, color_sand",
 
  "Snake Skull": "bone_item, prehistoric_item, color_sand",
 
  "Snake Vertebrae": "bone_item, prehistoric_item, color_sand",
 
  "Mummified Bat": "bone_item, prehistoric_item, color_sand",
 
  "Mummified Frog": "bone_item, prehistoric_item, color_sand",
 
  "Ginger": "forage_item, color_yellow, ginger_item",
 
  "Taro Root": "color_brown",
 
  "Taro Tuber": "",
 
  "Pineapple": "color_yellow, fruit_item",
 
  "Mango": "color_yellow, fruit_item, fruit_tree_item",
 
  "Banana": "color_yellow, fruit_item, fruit_tree_item",
 
  "Mango Sapling": "",
 
  "Banana Sapling": "",
 
  "Mahogany Seed": "color_brown, tree_seed_item",
 
  "Golden Coconut": "color_yellow",
 
  "Ostrich Egg": "color_white, egg_item, large_egg_item",
 
  "Stingray": "color_brown, fish_ocean, season_all, fish_talk_stiff",
 
  "Lionfish": "color_orange, fish_ocean, season_all, fish_talk_demanding",
 
  "Blue Discus": "color_cyan, fish_ocean, season_all",
 
  "Cinder Shard": "color_orange",
 
  "Magma Cap": "color_orange",
 
  "Dragon Tooth": "color_orange",
 
  "Tiger Slime Egg": "color_orange, slime_item, slime_egg_item",
 
  "Piña Colada": "color_white, alcohol_item",
 
  "Warp Totem: Island": "color_brown, totem_item",
 
  "Curiosity Lure": "",
 
  "Thorns Ring": "color_sand",
 
  "Glowstone Ring": "color_gold",
 
  "Crabshell Ring": "color_brown",
 
  "Napalm Ring": "color_orange",
 
  "Lucky Ring": "color_gold",
 
  "Hot Java Ring": "color_sand",
 
  "Protection Ring": "color_gray",
 
  "Immunity Band": "color_iridium",
 
  "Soul Sapper Ring": "color_yellow_green",
 
  "Phoenix Ring": "color_gold",
 
  "War Memento": "",
 
  "Gourmet Tomato Salt": "",
 
  "Stardew Valley Rose": "",
 
  "Advanced TV Remote": "",
 
  "Arctic Shard": "",
 
  "Wriggling Worm": "",
 
  "Pirate's Locket": "",
 
  "Fairy Dust": "",
 
  "Bug Steak": "color_pink",
 
  "Ectoplasm": "",
 
  "Prismatic Jelly": "",
 
  "Quality Bobber": "",
 
  "Monster Musk": "color_purple, potion_item",
 
  "Fiber Seeds": "",
 
  "Qi Fruit": "color_blue",
 
  "Qi Bean": "color_blue",
 
  "Mushroom Tree Seed": "color_red",
 
  "Warp Totem: Qi's Arena": "",
 
  "Fireworks (Red)": "color_red",
 
  "Fireworks (Purple)": "color_purple",
 
  "Fireworks (Green)": "color_green",
 
  "Galaxy Soul": "",
 
  "Pierre's Missing Stocklist": "",
 
  "Son of Crimsonfish": "color_red, fish_legendary",
 
  "Ms. Angler": "color_pink, fish_legendary, fish_upright",
 
  "Legend II": "color_green, fish_legendary",
 
  "Radioactive Carp": "color_green, fish_legendary",
 
  "Glacierfish Jr.": "color_blue, fish_legendary",
 
  "Ginger Ale": "color_green, food_sweet, ginger_item",
 
  "Banana Pudding": "color_yellow, food_sweet",
 
  "Mango Sticky Rice": "color_yellow, food_sweet",
 
  "Poi": "color_pink",
 
  "Tropical Curry": "color_orange",
 
  "Magic Bait": "",
 
  "Radioactive Ore": "color_lime, ore_item",
 
  "Radioactive Bar": "color_lime, furnace_item",
 
  "Horse Flute": ""
 
}
 
</syntaxhighlight>}}
 
  
Each item also has automatic context tags which aren't listed in the data file. That includes context tags for the item name, quality, and category. The <samp>listtags</samp> [[Modding:Console commands|debug command]] lists all the tags of the item being held.
+
Context tags have a variety of effects in-game:
 +
{| class="wikitable"
 +
|-
 +
! feature
 +
! effects
 +
|-
 +
| [[Fish Pond|fish ponds]]
 +
| Context tags determine what the fish will produce and other elements. See [[Modding:Fish Pond data#RequiredTags|Fish pond tags]] for more info.
 +
|-
 +
| [[Special Orders|special orders]]
 +
| Contexts tags are used in special orders to determine what are the valid items for the quest objective(s).
 +
|}
  
==Uses==
+
The <samp>debug listtags</samp> [[Modding:Console commands|console command]] lists all the tags of the item being held.
===Fish ponds===
 
Context tags are used in the fish pond to determine what the fish will produce and other elements. See [[Modding:Fish Pond data#RequiredTags|Fish pond tags]] for more info.
 
 
 
===Special orders===
 
Contexts tags are used in special orders to determine what are the valid items for the quest objective(s).
 
  
 
==Objects==
 
==Objects==

Revision as of 04:21, 28 January 2022

Index

This page explains how the game stores and parses item data. This is an advanced guide for mod developers.

Introduction

Overview

Items are divided into several types:

item type data asset texture name summary
Object Data/ObjectInformation Maps/springobjects The default type for items in inventories or placed in the world.
Object (big craftable) Data/BigCraftablesInformation TileSheets/Craftables Craftable items which can be placed in the world and are two tiles tall (instead of one like objects).
Boots Data/Boots item sprite: Maps/springobjects
shoe color: Characters/Farmer/shoeColors
Equippable boots.
Clothing Data/ClothingInformation Characters/Farmer/pants
Characters/Farmer/shirts
Equippable pants and shirts.
Furniture Data/Furniture TileSheets/furniture Decorative furniture items, including chairs which the player can sit on.
Hat Data/Hats Characters/Farmer/hats Equippable hat items.
Tool TileSheets/Tools Tools that can be used by the player.
MeleeWeapon Data/Weapons TileSheets/weapons Weapons that can be used by the player to damage monsters.

The game has two files in its Content folder (which can be unpacked for editing) for each item type:

  • a data asset for the text data for its items (names, descriptions, prices, etc);
  • and a spritesheet for the in-game item icons.

Each item has a ParentSheetIndex field which is its position in the item type's spritesheet, starting at 0 in the top-left and incrementing by one as you move across and then down. For example, hat #0 is the first sprite in Characters/Farmer/hats. The ParentSheetIndex is also used to identify the item itself; since spritesheet indexes aren't unique (e.g. there's both a hat #10 and object #10), code needs to check the type too like item is Weapon weapon && weapon.ParentSheetIndex == 4.

See the sections below for details on each item type.

Get a list of items

With SMAPI installed, you can run the list_items console command in-game to view/search items and their IDs.

Define a custom item

Every item must be assigned a unique ParentSheetIndex within its type, and that index must fit within the item type's spritesheet.

Adding custom items to the data assets and spritesheets directly is not recommended, since it's very easy to conflict with other mods or cause game errors. Instead you should create a content pack for Json Assets, which coordinates dynamic item ID assignment so multiple custom item mods can work together.

Common data

Categories

Each item also has a category (represented by a negative integer). In code, you can get an item's category value from item.Category, and its translated name from item.getCategoryName(). Here are the valid categories:

value internal constant English translation
-2 Object.GemCategory Mineral
-4 Object.FishCategory Fish
-5 Object.EggCategory Animal Product
-6 Object.MilkCategory Animal Product
-7 Object.CookingCategory Cooking
-8 Object.CraftingCategory Crafting
-9 Object.BigCraftableCategory
-12 Object.mineralsCategory Mineral
-14 Object.meatCategory Animal Product
-15 Object.metalResources Resource
-16 Object.buildingResources Resource
-17 Object.sellAtPierres
-18 Object.sellAtPierresAndMarnies Animal Product
-19 Object.fertilizerCategory Fertilizer
-20 Object.junkCategory Trash
-21 Object.baitCategory Bait
-22 Object.tackleCategory Fishing Tackle
-23 sellAtFishShopCategory
-24 Object.furnitureCategory Decor
-25 Object.ingredientsCategory Cooking
-26 Object.artisanGoodsCategory Artisan Goods
-27 Object.syrupCategory Artisan Goods
-28 Object.monsterLootCategory Monster Loot
-29 Object.equipmentCategory
-74 Object.SeedsCategory Seed
-75 Object.VegetableCategory Vegetable
-79 Object.FruitsCategory Fruit
-80 Object.flowersCategory Flower
-81 Object.GreensCategory Forage
-95 Object.hatCategory
-96 Object.ringCategory
-98 Object.weaponCategory
-99 Object.toolCategory
Console commands 
With the Console Code mod installed, you can run this command in the SMAPI console to see a list of objects by category:
cs return string.Join(`\n`, Game1.objectInformation.Keys.Select(key => new StardewValley.Object(key, 1)).GroupBy(item => item.Category, item => item.Name).OrderByDescending(p => p.Key).Select(p => $`{p.Key}: {string.Join(`, `, p.OrderBy(name => name))}`));

Context tags

A context tag is an arbitrary label attached to items, which can produce various effects in-game.

Every item has built-in tags for metadata like the item name, quality, and category. Further context tags are defined in Data/ObjectContextTags, which consists of a string→string dictionary (where the key is the item's internal name, and the value is a comma-delimited list of tags to add):

  "Chanterelle": "color_brown, forage_item, forage_item_cave, forage_item_secret, season_fall",

Context tags have a variety of effects in-game:

feature effects
fish ponds Context tags determine what the fish will produce and other elements. See Fish pond tags for more info.
special orders Contexts tags are used in special orders to determine what are the valid items for the quest objective(s).

The debug listtags console command lists all the tags of the item being held.

Objects

Objects are the default type for items in inventories or placed in the world.

They have their data in Data/ObjectInformation, 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/ObjectInformation consists of an integer→string dictionary with entries like this:

  "18": "Daffodil/30/0/Basic -81/Daffodil/A traditional spring flower that makes a nice gift."

For each entry in the data asset, the key is the item's ParentSheetIndex and the value is a slash-delimited string with the fields listed below. Fields 0–5 are used by rings and most other objects; fields 6–11 are only used for food buffs. The objects with keys 516–534 (Ring.ringLowerIndexRange through Ring.ringUpperIndexRange) and 801 (wedding ring) are hardcoded as rings.

index field effect
all objects
0 name The internal item name (and display name in English).
1 price The gold price of the item when sold by the player.
2 edibility A numeric value that determines how much health (edibility × 2.5) and energy (edibility × 1.125) is restored. An item with an edibility of -300 can't be eaten.

This is ignored for rings.

3 type and category
  • For a ring: the value Ring. Rings have a hardcoded category of -96 (Object.ringCategory).
  • For other objects: the item's type (string) and category (negative integer), separated by a space like Fish -4.
4 display name The translated item name.
5 description The translated item description.
food & drink only
6 miscellaneous
  • For a food or drink item, set this to food or drink respectively. This enables the remaining fields, and changes which animation/sound is played when the player consumes the item. Any other value is ignored.
  • For a geode item (535, 536, 537, or 749) is broken, a space-delimited list of object IDs. There's a roughly 50% chance that the geode item will drop one of these items (the other drops are hardcoded).
7 buffs The bonuses to apply to the player's attribute when the item is consumed. This consists of a space-delimited list of these numbers:
index buff
0 farming
1 fishing
2 mining
3 unused
4 luck
5 foraging
6 unused
7 max energy
8 magnetism
9 speed
10 defense
11 attack
8 buff duration How long the buffs provided by the previous field last. This is converted into in-game minutes using the formula (duration × 0.7) / 60. The buff duration number shown in-game will always be one second less than the calculated value.

Notes

  • Items that have a number in the "Crafting" field show buggy information in-game (e.g., Bean Hotpot prior to version 1.4). Items that have a number in the "Attack" field display the Attack icon and a number, but no description. It's unclear how these buffs work (if at all).
  • 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.

Objects (big craftables)

Big craftables are objects which can be placed in the world and are two tiles tall (instead of one like objects).

They have their data in Data/BigCraftableInformation, their in-game sprites in TileSheets/Craftables, and their code in StardewValley.Object (with the bigCraftable.Value = true flag).

Data format

The big craftables data in Data/BigCraftableInformation consists of an integer→string dictionary with entries like this:

  "19": "Oil Maker/50/-300/Crafting -9/Makes gourmet truffle oil./true/true/0/Oil Maker"

For each entry in the data asset, the key is the item's ParentSheetIndex and the value is a slash-delimited string with these fields:

index field effect
0 name The internal item name (and display name in English).
1 price The gold price when sold by the player.
2 edibility See edibility for object data. Always set to -300 (inedible) for vanilla items.
3 type and category See type and category for object data. Always set to Crafting -9 for vanilla items.
4 description The translated item description shown in-game.
5 outdoors Whether the item can be placed outdoors (true or false).
6 indoors Whether the item can be placed indoors (true or false).
7 fragility How the item is removed by tools. Possible values:
fragility effect
0 Pick up with any tool.
1 Destroyed if hit with an axe, hoe, or pickaxe. Any other tool will pick it up.
2 Indestructible. The item can't be removed once placed.
8 is lamp Whether the item is a lamp and produces light when it's dark. This can be true (mark as lamp) or any other value (ignored).
9 display name The translated display name (in non-English assets only).

Notes

  • Many of the items in the data asset aren't implemented in-game. They may be completely absent from the game, or they may be unused as craftables and instead appear in object data or furniture data.

Furniture

Furniture are decorative items which can be placed in the world, including chairs which the player can sit on.

They have their data in Data/Furniture, their in-game sprites in TileSheets/furniture, and their code in StardewValley.Objects.Furniture.

Data format

The furniture data in Data/Furniture consists of an integer→string dictionary with entries like this:

  "18": "Country Chair/chair/-1/-1/4/750"

For each entry in the data asset, the key is the item's ParentSheetIndex and the value is a slash-delimited string with these fields:

index field effect
0 name The internal item name (and display name in English).
1 type The furniture type. Possible values:
type meaning
0 chair
1 bench
2 couch
3 armchair
4 dresser
5 long table
6 painting
7 lamp
8 decor
9 other
10 bookcase
11 table
12 rug
13 window
14 fireplace
15 bed
16 torch
17 sconce
2 tilesheet size The furniture sprite size on the tilesheet, measured in tiles. This can be <width> <height> (e.g. 1 2), or -1 to use the default size for the type.
3 bounding box size The size of the hitbox when the furniture is placed in-game, measured in tiles. The bounding box will be anchored to the bottom-left corner and extend upwards and rightwards. This can be <width> <height> (e.g. 1 2), or -1 to use the default size for the type.
4 rotations The number of rotations possible (1, 2, or 4).
5 price The price when purchased from a shop.
6 display name The translated furniture name (in non-English data assets only).

Hats

Hats are items that can be equipped in the player's hat slot.

They have their data in Data/Hats, their in-game sprites in Characters/Farmer/hats, and their code in StardewValley.Objects.Hat.

Data format

The hat data in Data/Hats consists of an integer→string dictionary with entries like this:

  "5": "Official Cap/Looks like it belonged to a postman or policeman. Either way, it's still very soft and smells okay./false/true"

For each entry in the data asset, the key is the item's ParentSheetIndex and the value is a slash-delimited string with these fields:

index field effect
0 name The internal item name (and display name in English).
1 description The translated item description shown in-game.
2 show real hair Whether to show the player's hairstyle as-is when the hat is worn (true), or change the hairstyle to fit the hat (false).
3 skip hairstyle offset Whether to ignore the current style when positioning the hat (one of true or false). For example, the eye patch sets true since its position isn't affected by the hair, but the butterfly bow sets false to adjust its position on top of your hair.
4 display name The translated item name shown in-game (for non-English assets only).

Hats have a hard-coded category of -95 (Hats.cs::Load)

Weapons

Weapons are tools that can be used by the player to damage monsters.

They have their data in Data/Weapons, their in-game sprites in TileSheets/weapons, and their code in StardewValley.Tools.MeleeWeapon and StardewValley.Tools.Slingshot.

Data format

The weapon data in Data/Weapons consists of an integer→string dictionary with entries like this:

  "12": "Wooden Blade/Not bad for a piece of carved wood./3/7/1/0/0/0/0/3/-1/0/.02/3"

For each entry in the data asset, the key is the item's ParentSheetIndex and the value is a slash-delimited string with these fields:

Melee weapons
index field effect
0 name The internal weapon name (and display name in English).
1 description The translated item description shown in-game.
2
3
min damage
max damage
The minimum and maximum damage caused when hitting a monster with this weapon.
4 knockback How far the target is pushed when hit, as a multiplayer relative to a base weapon like the Rusty Sword (e.g. 1.5 for 150% of Rusty Sword's weight).
5 speed 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 player's weapon speed.
6 added precision Reduces the chance that a strike will miss.
7 added defence Reduces damage received by the player.
8 type The weapon type. One of 0 (stabbing sword), 1 (dagger), 2 (club or hammer), or 3 (slashing sword).
9
10
base mine level
min mine level
The base and minimum mine level, which affect mine container drops.
11 added area of effect Slightly increases the area of effect.
12 critical chance The chance of a critical hit, as a decimal value between 0 and 1.
13 critical damage A multiplier applied to the damage for critical hit.
14 display name The translated item name (in non-English assets only).
Slingshots
index field effect
0 name The internal weapon name (and display name in English).
1 description The translated item description shown in-game (for non-English assets only).
2–8 unused
9
10
base mine level
min mine level
The base and minimum mine level, which affect mine container drops.
11–13 unused
14 display name The translated item description shown in-game (for non-English assets only).

Weapons have a hardcoded category of -98 (Object.weaponCategory).

Slingshot notes

  • The base slingshot has ParentSheetIndex 32 in the weapon data, which increases by one for each upgrade level (up to 34 in the weapon data, though only 32 and 33 are obtainable without mods).
  • Slingshot damage is calculated dynamically regardless of the weapon data.

Mine container drops

When the player breaks a container in the mines, there's a chance it will drop a weapon. Here's how the weapon to drop is chosen[1]:

  1. Match weapons whose minimum mine level (field 10) is less than the current mine level.
  2. From that list, match weapons with a probability check based on the gap between the base mine level (field 9) and current mine level. The probability is a bell curve centered on the base mine level:
    level difference probability
    0 100%
    5 92%
    10 71%
    15 46%
    20 25%
    25 4%
    The difference applies in both directions; for example, two weapons whose base levels are 5 below and 5 above the current level both have a 92% chance. (The probability is calculated with a Gaussian function e-(current mine level - base mine level)2 / (2 * 122).)
  3. Find the weapon with the smallest gap between the current and base mine levels, and add it to the list. (If the item was also selected in step 2, it has two chances to drop.)
  4. From the remaining list of weapons, randomly choose one to drop.

See also

References

  1. See Utility.getUncommonItemForThisMineLevel in the game code.