Recipes
Decide what an item is crafted from, what level you need, and which classes can craft it.
The recipes table lets players craft things. You say what comes out, what goes in and what level is needed. You can make recipes for items you added, or give a base game item a new way to be made.
In the editor#
Open the Recipes tab under Gear & items in the left column and press Add. Each recipe in the list is named after what it makes.
| Field | What it does |
|---|---|
| Makes | What comes out. Pick one of this mod's items or a base game item from the searchable list. |
| Amount made | How many one craft gives. |
| Ingredients | Up to 8, at least one. Each row has an Item and a Needed amount. |
| Level needed | The player level needed to craft it. |
| Where | Campfire or Stove. Leave it empty to craft anywhere. |
| Classes | Pick classes to limit who can craft it. Leave it empty for every class. |
There is no preview on this tab, but the Items tab lists every recipe that makes the item you are looking at. To test, press the top-bar Test, then craft the item in the test arena (put the ingredients in your bag first).
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 that starts with [ ]; each { } is one recipe. Put its path under content.recipes in mod.json.
Smallest working example#
Craft a base game Iron Sword from 4 iron ore and 1 wood at level 3 or higher, only for Warriors and Ninjas:
[
{
"id": "iron_sword_cheap",
"output": "iron_sword",
"count": 1,
"level": 3,
"classes": ["WARRIOR", "NINJA"],
"ingredients": [
{ "item": "iron_ore", "count": 4 },
{ "item": "wood", "count": 1 }
]
}
]Fields#
| Field | Required? | What it means | Allowed values |
|---|---|---|---|
id | Yes | The recipe’s name inside your mod | Starts with a lowercase letter or digit; only lowercase letters, digits and underscores; up to 48 characters. No repeats in one file |
output | Yes | What comes out | An item id: your own, a base game one, or @modid/name |
count | No | How many come out per craft | Whole number, 1 to 99. Default 1 |
ingredients | Yes | The list of materials | 1 to 8 entries, each { "item": item, "count": number } |
ingredients[].item | Yes | Which material | An item id, written the same way as output |
ingredients[].count | No | How many are needed | Whole number, 1 to 999. Default 1 |
level | No | Player level needed to craft it | Whole number, 1 to 200. Default 1 |
classes | No | Limit crafting to some classes. Left out means every class | WARRIOR MAGE RANGER NINJA GUNNER NECROMANCER DRAGOON |
station | No | Where it must be crafted. Left out means anywhere | campfire (at a campfire) or stove (a stove recipe; a campfire can make these too) |
How it points at other things#
output and every ingredient’s item can be written three ways:
[
{
"id": "frost_blade",
"output": "frost_blade",
"ingredients": [
{ "item": "iron_ore", "count": 4 },
{ "item": "@icepack/frost_shard", "count": 2 }
]
}
]frost_blade: a local id. The game first checks your own items table for it, and if it is not there, treats it as a base game id.iron_ore: a base game item id.@icepack/frost_shard: an item from another mod,icepack. That mod must be listed in yourdependsOnor the entry is rejected.
Common mistakes#
- Writing the material field as
itemId. It isitem. - Writing the output as
outputItemId. It isoutput. - Writing the level as
requiredLevel. It islevel. (Changing the level of a base game recipe is a different thing, see Patches.) - Fewer than 1 or more than 8 ingredients. You will see: "ingredients" needs at least 1 entry, or can have at most 8.
- Class names in lowercase or in another language. Use the all-caps names like
WARRIOR. - There is no item called "something": the id is misspelled, or it is your own dish, fish or seed (see the warning above), or it comes from another mod that is not in
dependsOn.
Related pages#
- Items: you need an item before it can be an output or a material.
- Dishes: dishes come with their own campfire recipe.
- Patches: change the level, output count or materials of a base game recipe.
- The mod editor: build this kind of content with forms and test it in the game.