Modding:Wild trees
← Index
This page documents the in-game data format for wild trees. This is an advanced guide for mod developers.
Data format
You now create/edit wild trees by editing the Data/WildTrees asset.
This consists of a string → model lookup, where...
- The asset key is a unique string ID for the tree type. The vanilla tree IDs are 1 (oak), 2 (maple), 3 (pine), 6 (desert palm), 7 (mushroom), 8 (mahogany), 9 (island palm), 10 (green tree 1), 11 (green tree 2), 12 (giant fiddlehead), and 13 (mystic).
- The asset value is a model with the fields listed below.
field | effect | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Textures | The texture to use as the tree's spritesheet in-game. If multiple textures are listed, the first matching one is used.
This consists of a list of models with these fields:
| ||||||||||||||||
SeedItemId | (Optional) The qualified item ID for the seed item. If omitted, the tree can't be planted and SeedOnShakeChance will be ignored. | ||||||||||||||||
SeedPlantable | (Optional) Whether the seed can be planted by the player. If this is false, it can only be spawned automatically via map properties. Default true. | ||||||||||||||||
GrowthChance | (Optional) The probability each day that the tree will grow to the next stage without tree fertilizer, as a value from 0 (will never grow) to 1 (will grow every day). Defaults to 0.2 (20% chance). | ||||||||||||||||
FertilizedGrowthChance | (Optional) Equivalent to GrowthChance, but with tree fertilizer. Defaults to 1 (100% chance). | ||||||||||||||||
SeedSpreadChance | (Optional) The probability each day that the tree will plant a seed on a nearby tile, as a value from 0 (never) to 1 (always). This only applied in locations where trees plant seeds (e.g. farms in vanilla). Default 0.15 (15% chance). | ||||||||||||||||
SeedOnShakeChance | (Optional) The probability each day that the tree will produce a seed that will drop when the tree is shaken, as a value from 0 (never) to 1 (always). Default 0.05 (5% chance). | ||||||||||||||||
SeedOnChopChance | (Optional) The probability that a seed will drop when the player chops down the tree, as a value from 0 (never) to 1 (always). Default 0.75 (75% chance). | ||||||||||||||||
DropWoodOnChop | (Optional) Whether to drop wood when the player chops down the tree. Default true. | ||||||||||||||||
DropHardwoodOnLumberChop | (Optional) Whether to drop hardwood when the player chops down the tree, if they have the Lumberjack profession. Default true. | ||||||||||||||||
IsLeafy | (Optional) Whether shaking or chopping the tree causes cosmetic leaves to drop from tree and produces a leaf rustle sound. When a leaf drops, the game will use one of the four leaf sprites in the tree's spritesheet in the slot left of the stump sprite. Default true. | ||||||||||||||||
IsLeafyInWinter | (Optional) Whether IsLeafy also applies in winter. Default false. | ||||||||||||||||
GrowsInWinter | (Optional) Whether the tree can grow in winter (subject to GrowthChance or FertilizedGrowthChance). Default false. | ||||||||||||||||
IsStumpDuringWinter | (Optional) Whether the tree is reduced to a stump in winter and regrows in spring, like the vanilla mushroom tree. Default false. | ||||||||||||||||
AllowWoodpeckers | (Optional) Whether woodpeckers can spawn on the tree. Default true. | ||||||||||||||||
UseAlternateSpriteWhenNotShaken UseAlternateSpriteWhenSeedReady |
(Optional) Whether to render a different tree sprite when the player hasn't shaken it on that day (UseAlternateSpriteWhenNotShaken) or it has a seed ready (UseAlternateSpriteWhenSeedReady). If either field is true, the tree spritesheet must be double-width with the alternate textures on the right. If both are true, the same alternate sprites are used for both. Default false. | ||||||||||||||||
DebrisColor | (Optional) The color of the cosmetic wood chips when chopping the tree. This can be...
Defaults to 12 (brown/woody). | ||||||||||||||||
SeedDropItems | (Optional) When a seed is dropped subject to SeedOnShakeChance, the item to drop instead of the item specified by SeedItemId. If this is empty or none match, the SeedItemId will be dropped instead.
This consists of a list of models with these fields:
| ||||||||||||||||
ChopItems | (Optional) The additional items to drop when the tree is chopped down. All matching items are dropped.
This consists of a list of models with these fields:
| ||||||||||||||||
ShakeItems | The items produced by shaking the tree when it's fully grown. This only applies the first time the tree is shaken each day. All matching items are dropped.
This consists of a list of models with these fields:
| ||||||||||||||||
TapItems | The items produced by tapping the tree. If multiple items can be produced, the first available one is selected.
This consists of a list of models with these fields:
| ||||||||||||||||
PlantableLocationRules | (Optional) The rules to decide which locations you can plant the seed in, if applicable. The first matching rule is used. This can override location checks (e.g. crops being limited to the farm), but not built-in requirements like crops needing dirt.
This consists of a list of models with these fields:
| ||||||||||||||||
CustomFields | The custom fields for this entry. | ||||||||||||||||
GrowsMoss | Whether the tree grows moss in warm seasons. If field is true, the tree spritesheet must be triple-width with the mossy textures for the upper tree and stump on the far right. |
Spawning wild trees
Custom trees can be added to the game in two ways:
- Spawn them on map tiles when the location is created, using the new SpawnTree: wild
<tree ID>
[growth stage on location created]
[growth stage on day-update regrowth]
tile property. This must be added on the Paths layer, which must also have tile index 34 from the paths tilesheet. - Or give the player a seed item in the usual ways (e.g. from a shop, mail letter, etc).