Crops
Add a plant players can farm: the seed item is made for you, and the grown crop gives whatever you choose.
The crops table lets players grow something new on a farm plot. You say what the crop is called, what it gives when harvested, how many, how long it takes to grow, and its colours at three stages. The seed becomes an item automatically, with the id <crop id>_seed.
In the editor#
Open the Crops tab under Food & gathering in the left column. Press Add to start a new crop, or Copy from game to start from a base game crop.
| Field | What it does |
|---|---|
| Crop name | The name shown in fields and the codex (Other languages underneath). |
| Seed name | The seed name in the bag. Leave it empty to use the crop name. |
| Harvest item | What you get when you harvest. Pick a base game item or one from this mod. |
| Harvest amount | How many you get in one harvest. Left is the minimum, right is the maximum. |
| Ripening time | How many in-game hours it takes to ripen after planting. |
| Crop colors | Three swatches in order: leaves, seed, ripe fruit. |
| Plant height | Higher numbers make the plant grow taller. |
This tab has no preview. The top-bar Test reloads the game with your mod and drops you in a flat test field, which is a quick way to confirm it loads without problems. The test field has no villages, water or farm plots, so to see this in action, turn the mod on under My Mods and play in a world. The seed item is made for you.
Advanced: writing the JSON by hand#
Below is the same content as it looks in the file. The editor saves exactly this format. You can also press Open folder at the top of the editor and edit the file in an outside text editor; when you save, the editor picks up the change. Fields the form does not show are kept as they are. Where the file goes and how it is listed: Mod folder and mod.json.
The table is one JSON file; put its path under content.crops in mod.json.
Smallest working example#
A frost berry bush that grows in 36 game hours and gives 2 to 4 base game Healing Herb per harvest:
[
{
"id": "frost_berry_bush",
"name": "Frost berry bush",
"names": { "zh-TW": "霜莓叢" },
"seedName": "Frost berry seeds",
"seedNames": { "zh-TW": "霜莓種子" },
"product": "healing_herb",
"yield": [2, 4],
"growHours": 36,
"colors": ["#7bc043", "#5fa83c", "#9fd6e8"],
"height": 0.6
}
]Fields#
| Field | Required? | What it means | Allowed values |
|---|---|---|---|
id | Yes | The crop’s name inside your mod. The seed id becomes <id>_seed | Starts with a lowercase letter or digit; only lowercase letters, digits and underscores; up to 48 characters |
name, names | At least one | Crop name | Up to 32 characters each |
seedName, seedNames | No | Name of the seed item; the crop name is used if missing | Up to 32 characters each |
product | Yes | The item you get when harvesting | An item id: base game, your own (item, fish or dish) or @modid/name |
yield | Yes | How many per harvest, [fewest, most] | Two whole numbers, each 1 to 12; the second cannot be smaller than the first |
growHours | No | Game hours needed to grow | 12 to 168. Default 24 |
colors | Yes | Three colours: sprout, growing, ripe | Exactly three "#rrggbb" values |
height | No | How tall it grows | 0.2 to 1.5. Default 0.6 |
How it points at other things#
productcan be a base game item (healing_herb), a local id from your items table, your own fish or dish, or@modid/namefrom another mod.- The seed is an item made for you, named by your
seedName. To let enemies drop seeds, write"item": "frost_berry_bush_seed"in Loot. - To use your own seed or crop as a material in a recipe you need two mods, because recipes load before crops within one mod.
Common mistakes#
- Forgetting
product,yieldorcolors. colorsthat is not exactly three colours.- Writing
yieldas one number. It has to look like[2, 4]. growHoursbelow 12 or above 168.- A misspelled
product. The game says there is no item called "something".
Related pages#
- Items: the harvest is often an item of your own.
- Dishes: cook with what you harvest.
- Loot: let enemies drop seeds.
- The mod editor: build this kind of content with forms and test it in the game.