Modding:Blueprint data

From Stardew Valley Wiki
Revision as of 03:44, 26 August 2024 by Selph (talk | contribs) (part 6: add info from Modding:Migrate to Stardew Valley 1.6 (main author Pathoschild, with formatting fixes by Margotbean and other fixes by Atravita)
Jump to navigation Jump to search

Index

This page explains how the define custom buildings. This is an advanced guide for mod developers.

Raw data

Blueprint data is stored in Content\Data\Blueprints.xnb, which can be unpacked for editing. Here's the raw data as of 1.5.1 for reference:

Data 
{
  "Silo": "390 100 330 10 334 5/3/3/-1/-1/-2/-1/null/Silo/Allows you to cut and store grass for feed./Buildings/none/48/128/-1/null/Farm/100/false",
  "Mill": "388 150 390 50 428 4/4/2/-1/-1/-2/-1/null/Mill/Allows you to mill wheat, beets and rice./Buildings/none/64/128/-1/null/Farm/2500/false",
  "Earth Obelisk": "337 10 86 10/3/2/-1/-1/-2/-1/null/Earth Obelisk/Warps you to the mountains./Buildings/none/48/128/-1/null/Farm/500000/true",
  "Water Obelisk": "337 5 372 10 393 10/3/2/-1/-1/-2/-1/null/Water Obelisk/Warps you to the beach./Buildings/none/48/128/-1/null/Farm/500000/true",
  "Desert Obelisk": "337 20 88 10 90 10/3/2/-1/-1/-2/-1/null/Desert Obelisk/Warps you to the desert./Buildings/none/48/128/-1/null/Farm/1000000/true",
  "Island Obelisk": "337 10 852 10 91 10/3/2/-1/-1/-2/-1/null/Island Obelisk/Warps you to Ginger Island./Buildings/none/48/128/-1/null/Farm/1000000/true",
  "Junimo Hut": "390 200 268 9 771 100/3/2/-1/-1/-2/-1/null/Junimo Hut/Junimos will harvest crops around the hut for you./Buildings/none/48/64/-1/null/Farm/20000/true",
  "Gold Clock": "/3/2/-1/-1/-2/-1/null/Gold Clock/Prevents debris from appearing on your farm. Keeps fences from decaying./Buildings/none/48/80/-1/null/Farm/10000000/true",
  "Stable": "709 100 335 5/4/2/-1/-1/-2/-1/null/Stable/Allows you to keep and ride a horse. Horse included./Buildings/none/64/96/-1/null/Farm/10000/false",
  "Well": "390 75/3/3/-1/-1/-1/-1/null/Well/Provides a place for you to refill your watering can./Buildings/none/32/32/-1/null/Farm/1000/false",
  "Shipping Bin": "388 150/2/1/-1/-1/-1/-1/null/Shipping Bin/Throw items inside to sell them overnight./Buildings/none/48/80/-1/null/Farm/250/false/0",
  "Coop": "388 300 390 100/6/3/1/2/2/2/Coop/Coop/Houses 4 coop-dwelling animals./Buildings/none/64/96/4/null/Farm/4000/false",
  "Big Coop": "388 400 390 150/6/3/1/2/2/2/Coop2/Big Coop/Houses 8 coop-dwelling animals. Comes with an incubator. Unlocks ducks./Upgrades/Coop/64/96/8/null/Farm/10000/false",
  "Deluxe Coop": "388 500 390 200/6/3/1/2/2/2/Coop3/Deluxe Coop/Houses 12 coop-dwelling animals. Comes with an auto-feed system. Unlocks rabbits./Upgrades/Big Coop/64/96/12/null/Farm/20000/false",
  "Barn": "388 350 390 150/7/4/1/3/3/3/Barn/Barn/Houses 4 barn-dwelling animals./Buildings/none/96/96/4/null/Farm/6000/false",
  "Big Barn": "388 450 390 200/7/4/1/3/4/3/Barn2/Big Barn/Houses 8 barn-dwelling animals. Allows animals to give birth. Unlocks goats./Upgrades/Barn/96/96/8/null/Farm/12000/false",
  "Deluxe Barn": "388 550 390 300/7/4/1/3/4/3/Barn3/Deluxe Barn/Houses 12 barn-dwelling animals. Comes with an auto-feed system. Unlocks sheep and pigs./Upgrades/Big Barn/96/96/12/null/Farm/25000/false",
  "Slime Hutch": "390 500 338 10 337 1/11/6/5/5/-1/-1/SlimeHutch/Slime Hutch/Raise up to 20 slimes. Fill water troughs and slimes will create slime balls./Buildings/none/96/96/20/null/Farm/10000/false",
  "Shed": "388 300/7/3/3/2/-1/-1/Shed/Shed/An empty building. Fill it with whatever you like! The interior can be decorated./Buildings/none/96/96/20/null/Farm/15000/false",
  "Big Shed": "388 550 390 300/7/3/3/2/-1/-1/Shed2/Big Shed/Doubles the size of the shed. The interior can be decorated./Upgrades/Shed/96/96/20/null/Farm/20000/false",
  "Stone Cabin": "390 10/5/3/2/1/-1/-1/Cabin/Cabin/A home for a friend! Subsidized by the town agricultural fund./Buildings/none/96/96/20/null/Farm/100/false/0",
  "Plank Cabin": "388 5 771 10/5/3/2/1/-1/-1/Cabin/Cabin/A home for a friend! Subsidized by the town agricultural fund./Buildings/none/96/96/20/null/Farm/100/false/0",
  "Log Cabin": "388 10/5/3/2/1/-1/-1/Cabin/Cabin/A home for a friend! Subsidized by the town agricultural fund./Buildings/none/96/96/20/null/Farm/100/false/0",
  "Greenhouse": "/7/6/3/5/-1/-1/null/Greenhouse/A place to grow crops from any season, year round!/Buildings/none/64/96/-1/null/Farm/-1/false/0/2 6 3 6 4 6 2 7 3 7 4 7",
  "Mine Elevator": "388 30 390 15 334 5/4/2/1/1/-1/-1/null/Mine Elevator/Quickly travel between any mine elevators you construct. You can only build one per mine level./Buildings/none/64/64/-1/MineElevator/UndergroundMine",
  "Fish Pond": "390 200 152 5 153 5/5/5/-1/-1/-2/-1/null/Fish Pond/Raise fish and harvest their produce. Fish multiply over time./Buildings/none/76/78/10/null/Farm/5000/false/2",
  "Chicken": "animal/500/64/64/Chicken/Lays delicious eggs. Comes in two colors./null/Farm",
  "Duck": "animal/1000/64/64/Duck/Lays eggs and occasionally drops feathers./null/Farm",
  "Rabbit": "animal/1500/64/64/Rabbit/These are wooly rabbits!/null/Farm",
  "Cow": "animal/1000/64/96/Cow/Produces rich, creamy milk./null/Farm",
  "Sheep": "animal/1500/64/96/Sheep/Can be sheared for valuable wool./null/Farm",
  "Goat": "animal/1500/64/96/Goat/Produces tasty goat's milk!/null/Farm",
  "Pig": "animal/2000/64/96/Pig/These are specially trained to find truffles./null/Farm"
}

Format

The Data/Buildings asset consists of a string → model lookup, where...

  • The key is a unique string ID for the building type.
  • The value is a model with the fields listed below.

Required fields

field effect
Name
Description
A tokenizable string for the display name and description (e.g. shown in the construction menu).
Texture The asset name for the texture under the game's Content folder.

Construction

field effect
Builder (Optional) The NPC from whom you can request construction. The vanilla values are Robin and Wizard, but you can specify a different name if a C# mod opens a construction menu for them. Defaults to Robin. If set to null, it won't appear in any menu.
BuildCost (Optional) The gold cost to construct the building. Defaults to data-sort-value="0">Gold.png0g.
BuildMaterials (Optional) The materials you must provide to start construction, as a list of models with these fields:
field effect
Id (Optional) The unique string ID for this entry within the current list. Defaults to the ItemId if not specified.
ItemId The required item ID (qualified or unqualified).
Amount The number of the item required.
BuildDays (Optional) The number of days needed to complete construction (e.g. 1 for a building completed the next day). If set to 0, construction finishes instantly. Defaults to 0.
BuildCondition (Optional) A game state query which indicates whether the building should be available in the construction menu. Defaults to always available.
BuildMenuDrawOffset (Optional) A pixel offset to apply to the building sprite when drawn in the construction menu. Default none.
AdditionalPlacementTiles (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:
field effect
TileArea The tile area relative to the top-left corner of the building, specified as an object with X, Y, Width, and Height fields.
OnlyNeedsToBePassable (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.
IndoorItems (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:
field effect
Id The unique string ID for this entry within the current list.
ItemId The qualified item ID for the item to place.
Tile The tile position at which to place the item, specified as an object with X and Y fields.
Indestructible (Optional) Whether to prevent the player from destroying, picking up, or moving the item. Default false.
MagicalConstruction (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.
AddMailOnBuild (Optional) A list of letter IDs to send to all players when the building is constructed for the first time.

Upgrades

field effect
BuildingToUpgrade (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 Big Coop sets this to "Coop". Any numbers of buildings can be an upgrade for the same building, in which case the player can choose one upgrade path.
IndoorItemMoves (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:
field effect
Id The unique string ID for this entry within the current list.
Source The tile position on which any item will be moved.
Destination The tile position to which to move the item.
Size (Optional) The tile size of the area to move, specified as a model with X and Y fields. Defaults to a 1×1 area. If this is multiple tiles, the Source and Destination specify the top-left coordinate of the area.
UpgradeSignTile (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 "<x>, <y>". Defaults to approximately "5, 1" if the building interior type is Shed, else "0, 0".
UpgradeSignHeight (Optional) The pixel height of the upgrade sign when Robin is building an upgrade. Defaults to 0.


Exterior behavior

field effect
Size (Optional) The building's width and height when constructed, measured in tiles. Defaults to a 1 x 1 area.
CollisionMap (Optional) An ASCII text block which indicates which of the building's tiles the players can walk onto, where each character can be X (blocked) or O (passable). Defaults to all tiles blocked.

For example, a stable covers a 2x4 tile area with the front two tiles passable:

XXXX
XOOX

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:

// single line with \n line breaks
"CollisionMap": "XXXX\nXOOX"

// multi-line with optional indentation
"CollisionMap": "
    XXXX
    XOOX
"
HumanDoor (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.
AnimalDoor (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 X, Y, Width, and Height fields. This is measured in tiles relative to the top-left corner tile. Defaults to disabled.
AnimalDoorOpenDuration
AnimalDoorCloseDuration
(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.
AnimalDoorOpenSound
AnimalDoorCloseSound
(Optional) The sound which is played once each time the animal door is opened/closed. Disabled by default.

Exterior appearance

field effect
SourceRect (Optional) The building's pixel area within the Texture, specified as an object with X, Y, Width, and Height fields. Defaults to the entire texture.
Skins (Optional) The appearances which can be selected from Robin's menu (like stone/plank/log cabins), in addition to the default appearance based on Texture. This consists of a list of models with these fields:
field effect
Id The unique string ID for the skin.
Name
Description
Tokenizable strings for the skin's display name and description.
Texture The asset name for the texture under the game's Content folder.
Condition (Optional) A 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.
BuildDays
BuildCost
BuildMaterials
(Optional) If set, overrides the equivalent field in the building data.
ShowAsSeparateConstructionEntry (Optional) Whether this skin should be shown as a separate building option in the construction menu (like cabins). Default false.
Metadata (Optional) Equivalent to the Metadata 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.
FadeWhenBehind (Optional) Whether the building should become semi-transparent when the player is behind it. Default true.
DrawOffset (Optional) A pixel offset applied to the building sprite's placement in the world. Default 0.
SeasonOffset (Optional) A pixel offset to apply each season. This is applied to the SourceRect 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.
SortTileOffset (Optional) A Y tile offset applied when figuring out render layering. For example, a value of 2.5 will treat the building as if it was 2.5 tiles further up the screen for the purposes of layering. Default 0.
DrawLayers (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:
field effect
Id The unique string ID for this entry within the current list.
SourceRect The pixel area within the texture to draw, formatted like "<x> <y> <width> <height>". If the overlay is animated via FrameCount, this is the area of the first frame.
DrawPosition The tile position at which to draw the top-left corner of the texture, relative to the building's top-left corner tile.
Texture (Optional) The asset name of the texture to draw. Defaults to the building's default Texture field.
DrawInBackground (Optional) Whether to draw the texture behind the building sprite (i.e. underlay) instead of over it.
SortTileOffset (Optional) A Y tile offset applied when figuring out render layering. For example, a value of 2.5 will treat the texture as if it was 2.5 tiles further up the screen for the purposes of layering. Default 0.
OnlyDrawIfChestHasContents (Optional) The ID of a chest defined in the Chests field which must contain items. If it's empty, this overlay won't be rendered. Default none.