Difference between revisions of "Modding:Animal data"

From Stardew Valley Wiki
Jump to navigation Jump to search
m (Replace deprecated <source> tags with <syntaxhighlight> tags)
m (Text replacement - "tt>" to "samp>")
Line 2: Line 2:
  
 
==Raw data==
 
==Raw data==
Animal data is stored in <tt>Content\Data\FarmAnimals.xnb</tt>, which can be [[Modding:Editing XNB files#unpacking|unpacked for editing]]. Here's the raw data as of {{version|1.5.1}} for reference:
+
Animal data is stored in <samp>Content\Data\FarmAnimals.xnb</samp>, which can be [[Modding:Editing XNB files#unpacking|unpacked for editing]]. Here's the raw data as of {{version|1.5.1}} for reference:
  
 
{{collapse|Data|content=<syntaxhighlight lang="json">
 
{{collapse|Data|content=<syntaxhighlight lang="json">
Line 28: Line 28:
  
 
===Key===
 
===Key===
An animal's <tt>type</tt> must be a key that exists in the data. Each key in the data must be unique.
+
An animal's <samp>type</samp> must be a key that exists in the data. Each key in the data must be unique.
  
 
===Value===
 
===Value===
Line 49: Line 49:
 
| 2
 
| 2
 
| {{t|default produce index}}
 
| {{t|default produce index}}
| The [[Modding:Object data|item ID]] for the [[Animals#Produce|default produce item]] (e.g. <tt>184</tt> is [[Milk]]).
+
| The [[Modding:Object data|item ID]] for the [[Animals#Produce|default produce item]] (e.g. <samp>184</samp> is [[Milk]]).
 
|-
 
|-
 
| 3
 
| 3
 
| {{t|deluxe produce index}}
 
| {{t|deluxe produce index}}
| The [[Modding:Object data|item ID]] for the [[Animals#Deluxe and Large Products|deluxe produce item]] (e.g. <tt>186</tt> is [[Large Milk]]).
+
| The [[Modding:Object data|item ID]] for the [[Animals#Deluxe and Large Products|deluxe produce item]] (e.g. <samp>186</samp> is [[Large Milk]]).
 
|-
 
|-
 
| 4
 
| 4
Line 61: Line 61:
 
| 5-12
 
| 5-12
 
| {{t|bounding boxes}}
 
| {{t|bounding boxes}}
| Unused data. The front & back (5-8) and sideways (9-12) bounding boxes, in the form of <tt>x/y/width/height</tt>. Can be all zeroes.
+
| Unused data. The front & back (5-8) and sideways (9-12) bounding boxes, in the form of <samp>x/y/width/height</samp>. Can be all zeroes.
 
|-
 
|-
 
| 13
 
| 13
 
| {{t|harvest type}}
 
| {{t|harvest type}}
| How the animal produces items. The possible values are <tt>0</tt> (lay like [[Chickens]]), <tt>1</tt> (grab with a [[tool]]), and <tt>2</tt> (unused - seen only on the Hog and sets name to "It"). [[Pigs]] have a {{t|harvest type}} of <tt>1</tt> and a {{t|harvest tool}} of <tt>null</tt>, but their [[Truffle]] finding capability is limited to animals that have a <tt>type</tt> that contains "Pig".
+
| How the animal produces items. The possible values are <samp>0</samp> (lay like [[Chickens]]), <samp>1</samp> (grab with a [[tool]]), and <samp>2</samp> (unused - seen only on the Hog and sets name to "It"). [[Pigs]] have a {{t|harvest type}} of <samp>1</samp> and a {{t|harvest tool}} of <samp>null</samp>, but their [[Truffle]] finding capability is limited to animals that have a <samp>type</samp> that contains "Pig".
 
|-
 
|-
 
| 14
 
| 14
 
| {{t|change texture when item ready}}
 
| {{t|change texture when item ready}}
| Whether the animal should use a secondary texture when you can harvest an item. Can be <tt>true</tt> or <tt>false</tt>. Must have a <tt>Sheared</tt> texture loaded such as <tt>Animals/ShearedSheep.xnb</tt>.
+
| Whether the animal should use a secondary texture when you can harvest an item. Can be <samp>true</samp> or <samp>false</samp>. Must have a <samp>Sheared</samp> texture loaded such as <samp>Animals/ShearedSheep.xnb</samp>.
 
|-
 
|-
 
| 15
 
| 15
 
| {{t|building type}}
 
| {{t|building type}}
| The [[Animals#Housing|building]] in which the animal can live. This must be a [[Modding:Blueprint data|blueprint type]], like <tt>Coop</tt> or <tt>Barn</tt>.
+
| The [[Animals#Housing|building]] in which the animal can live. This must be a [[Modding:Blueprint data|blueprint type]], like <samp>Coop</samp> or <samp>Barn</samp>.
 
|-
 
|-
 
| 16-19
 
| 16-19
 
| {{t|sprite size}}
 
| {{t|sprite size}}
| The front & back sprite (16-17) and sideways (18-19) sprite width/height in pixels. [[Coop]] animals such as [[Chickens]] are <tt>16/16</tt> and [[Barn]] animals such as [[Cows]] are <tt>32/32</tt>.
+
| The front & back sprite (16-17) and sideways (18-19) sprite width/height in pixels. [[Coop]] animals such as [[Chickens]] are <samp>16/16</samp> and [[Barn]] animals such as [[Cows]] are <samp>32/32</samp>.
 
|-
 
|-
 
| 20
 
| 20
Line 89: Line 89:
 
| 22
 
| 22
 
| {{t|harvest tool}}
 
| {{t|harvest tool}}
| Which [[tool]] is needed to harvest [[Animals#Produce|produce]] from animal with a {{t|harvest type}} of <tt>1</tt>. This can be <tt>null</tt> (no tool) or any [[tool]] such as <tt>Milk Pail</tt> or <tt>Shears</tt>.
+
| Which [[tool]] is needed to harvest [[Animals#Produce|produce]] from animal with a {{t|harvest type}} of <samp>1</samp>. This can be <samp>null</samp> (no tool) or any [[tool]] such as <samp>Milk Pail</samp> or <samp>Shears</samp>.
 
|-
 
|-
 
| 23
 
| 23

Revision as of 18:48, 4 November 2021

Index

Raw data

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

Data 
{
  "White Chicken": "1/3/176/174/cluck/8/32/48/32/8/32/48/32/0/false/Coop/16/16/16/16/4/7/null/641/800/White Chicken/Coop",
  "Brown Chicken": "1/3/180/182/cluck/8/32/48/32/8/32/48/32/0/false/Coop/16/16/16/16/7/4/null/641/800/Brown Chicken/Coop",
  "Blue Chicken": "1/3/176/174/cluck/8/32/48/32/8/32/48/32/0/false/Coop/16/16/16/16/7/4/null/641/800/Blue Chicken/Coop",
  "Void Chicken": "1/3/305/305/cluck/8/32/48/32/8/32/48/32/0/false/Coop/16/16/16/16/4/4/null/641/800/Void Chicken/Coop",
  "Golden Chicken": "1/3/928/928/cluck/8/32/48/32/8/32/48/32/0/false/Coop/16/16/16/16/7/4/null/641/800/Golden Chicken/Coop",
  "Duck": "2/5/442/444/Duck/8/32/48/32/8/32/48/32/0/false/Coop/16/16/16/16/3/8/null/642/4000/Duck/Coop",
  "Rabbit": "4/6/440/446/rabbit/8/32/48/32/8/32/48/32/0/false/Coop/16/16/16/16/10/5/null/643/8000/Rabbit/Coop",
  "Dinosaur": "7/0/107/-1/none/8/32/48/32/8/32/48/32/0/false/Coop/16/16/16/16/1/8/null/644/1000/Dinosaur/Coop",
  "White Cow": "1/5/184/186/cow/36/64/64/64/36/64/64/64/1/false/Barn/32/32/32/32/15/5/Milk Pail/639/1500/White Cow/Barn",
  "Brown Cow": "1/5/184/186/cow/36/64/64/64/36/64/64/64/1/false/Barn/32/32/32/32/15/5/Milk Pail/639/1500/Brown Cow/Barn",
  "Goat": "2/5/436/438/goat/24/64/84/64/24/64/84/64/1/false/Barn/32/32/32/32/10/5/Milk Pail/644/4000/Goat/Barn",
  "Pig": "1/10/430/-1/pig/24/64/84/64/24/64/84/64/1/false/Barn/32/32/32/32/20/5/null/640/16000/Pig/Barn",
  "Hog": "1/5/640/-1/pig/24/64/84/64/24/64/84/64/2/false/Barn/32/32/32/32/20/5/null/640/1500/Hog/Barn",
  "Sheep": "3/4/440/-1/sheep/24/64/84/64/24/64/84/64/1/true/Barn/32/32/32/32/15/5/Shears/644/8000/Sheep/Barn",
  "Ostrich": "7/7/289/-1/Ostrich/24/64/84/64/24/64/84/64/0/false/Barn/32/32/32/32/15/5/null/644/16000/Ostrich/Barn"
}

Format

Each entry in the data contains a key and a value, and each value contains many fields.

Key

An animal's type must be a key that exists in the data. Each key in the data must be unique.

Value

All entries share the same value format, which cannot be re-ordered. Each field is explained below.

index syntax description
0 <days to produce> Number of days for the animal to produce. This is affected by friendship and happiness, and Sheep are affected by the Shepherd profession.
1 <age when mature> Number of days until mature.
2 <default produce index> The item ID for the default produce item (e.g. 184 is Milk).
3 <deluxe produce index> The item ID for the deluxe produce item (e.g. 186 is Large Milk).
4 <sound> The sound clip the animal uses (see soundbank IDs).
5-12 <bounding boxes> Unused data. The front & back (5-8) and sideways (9-12) bounding boxes, in the form of x/y/width/height. Can be all zeroes.
13 <harvest type> How the animal produces items. The possible values are 0 (lay like Chickens), 1 (grab with a tool), and 2 (unused - seen only on the Hog and sets name to "It"). Pigs have a <harvest type> of 1 and a <harvest tool> of null, but their Truffle finding capability is limited to animals that have a type that contains "Pig".
14 <change texture when item ready> Whether the animal should use a secondary texture when you can harvest an item. Can be true or false. Must have a Sheared texture loaded such as Animals/ShearedSheep.xnb.
15 <building type> The building in which the animal can live. This must be a blueprint type, like Coop or Barn.
16-19 <sprite size> The front & back sprite (16-17) and sideways (18-19) sprite width/height in pixels. Coop animals such as Chickens are 16/16 and Barn animals such as Cows are 32/32.
20 <fullness drain> The daily reduction in the animal's fullness value.
21 <happiness drain> The daily reduction in the animal's happiness value.
22 <harvest tool> Which tool is needed to harvest produce from animal with a <harvest type> of 1. This can be null (no tool) or any tool such as Milk Pail or Shears.
23 <meat index> Unused data. The item ID for the meat item when butchered. May be used by mods like Animal Husbandry.
24 <sell price> Affects the price when you sell an animal. This has no effect on the price of animals in Marnie's Ranch, which is set in the game code.
25 <display type> The translated animal name. Only used when not playing in English; English players will see the <type> value.
26 <display building> The translated building name. Only used when not playing in English; English players will see the <building type> value.