Jump to content

Modding:Furniture: Difference between revisions

From Stardew Valley Wiki
imported>Pathoschild
m Pathoschild moved page Modding:Furniture data to Modding:Furniture: update for newer naming convention & prepare to unsplit page
imported>Pathoschild
Line 1: Line 1:
#REDIRECT [[Modding:Items]]
← [[Modding:Items|Items]]
 
==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 <samp>Data/Furniture</samp>, their in-game sprites in <samp>TileSheets/furniture</samp>, translations in <samp>Strings/Furniture</samp>, and their code in <samp>StardewValley.Objects.Furniture</samp>.
 
===Data format===
The furniture data in <samp>Data/Furniture</samp> consists of an integer→string dictionary with entries like this:
 
<syntaxhighlight lang="json">
  "18": "Country Chair/chair/-1/-1/4/750"
</syntaxhighlight>
 
For each entry in the data asset, the key is the item's <samp>ParentSheetIndex</samp> and the value is a slash-delimited string with these fields:
 
{| class="wikitable"
|-
! index
! field
! effect
|-
| 0
| name
| The internal item name (and display name in English).
|-
| 1
| type
| The furniture type. Possible values:
{| class="wikitable sortable"
|-
! value
|-
| chair
|-
| bench
|-
| couch
|-
| armchair
|-
| dresser
|-
| long table
|-
| painting
|-
| lamp
|-
| decor
|-
| other
|-
| bookcase
|-
| table
|-
| rug
|-
| window
|-
| fireplace
|-
| bed
|-
| bed double
|-
| bed child
|-
| torch
|-
| sconce
|-
| randomized_plant
|-
| fishtank
|}
|-
| 2
| tilesheet size
| The furniture sprite size on the tilesheet, measured in tiles. This can be <samp>{{t|width}} {{t|height}}</samp> (e.g. <samp>1 2</samp>), or <samp>-1</samp> 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 <samp>{{t|width}} {{t|height}}</samp> (e.g. <samp>1 2</samp>), or <samp>-1</samp> 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
| placement restriction
| Where the furniture can be placed.
{| class="wikitable sortable"
|-
! value
! meaning
|-
| -1
| default (uses furniture type)
|-
| 0
| indoors-only
|-
| 1
| outdoors-only
|-
| 2
| indoors or outdoors
|}
|-
| 7
| display name
| The translated furniture name, which allows [[Modding:Tokenizable strings|tokenizable strings]].
|-
| 8
| sprite index
| The sprite index within the spritesheet texture to draw.
|-
| 9
| texture
| ''(Optional)'' The asset name of the texture to draw. Defaults to <samp>TileSheets/furniture</samp>.
|-
| 10
| off limits for random sale
| ''(Optional)'' Whether to prevent this furniture from appearing in randomly generated shop stocks and the furniture catalogue. Default false.
|-
| 11
| context tags
| ''(Optional)'' A space-delimited list of [[Modding:Items#Context tags|context tags]] which apply to this furniture. Default none.
|}
 
[[Category:Modding]]

Revision as of 17:17, 15 December 2024

← Items

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, translations in Strings/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:
value
chair
bench
couch
armchair
dresser
long table
painting
lamp
decor
other
bookcase
table
rug
window
fireplace
bed
bed double
bed child
torch
sconce
randomized_plant
fishtank
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 placement restriction Where the furniture can be placed.
value meaning
-1 default (uses furniture type)
0 indoors-only
1 outdoors-only
2 indoors or outdoors
7 display name The translated furniture name, which allows tokenizable strings.
8 sprite index The sprite index within the spritesheet texture to draw.
9 texture (Optional) The asset name of the texture to draw. Defaults to TileSheets/furniture.
10 off limits for random sale (Optional) Whether to prevent this furniture from appearing in randomly generated shop stocks and the furniture catalogue. Default false.
11 context tags (Optional) A space-delimited list of context tags which apply to this furniture. Default none.