Skip to content

Recipes

Overview

Crafting recipes define the transformation of input items or resources into output items. Every recipe specifies what materials are consumed, what is produced, which bench (if any) must be present, and how long the craft takes. Recipes live under Assets/Server/Item/Recipes/ and are loaded by the item system at runtime.

How Crafting Works

flowchart TD;
A["Player Opens<br>Crafting Bench"] --> B[Show Available Recipes];
B --> C["Has Required<br>Materials?"];
C -->|"No"| D[Recipe Greyed Out];
C -->|"Yes"| E[Player Clicks Craft];
E --> F["Bench Matches<br>Recipe Requirement?"];
F -->|"No"| D;
F -->|"Yes"| G[Consume Inputs];
G --> H["ProcessingTime > 0?"];
H -->|"Yes"| I["Wait Timer<br>e.g. 5 seconds"];
H -->|"No"| J[Instant Craft];
I --> K[Produce Output Items];
J --> K;
K --> L["Add to Inventory<br>or Drop"];
style A fill:darkgreen,color:white;
style D fill:darkred,color:white;
style K fill:rebeccapurple,color:white;

Recipe Resolution with Groups

flowchart LR;
A["Recipe Input:<br>Group 'AnyWood' x4"] --> B{Player Has?};
B -->|"Oak Wood x4"| C[Valid];
B -->|"Birch Wood x2<br>+ Pine Wood x2"| D["Valid<br>Mixed group items"];
B -->|"Stone x4"| E["Invalid<br>Not in group"];
style C fill:darkgreen,color:white;
style D fill:darkgreen,color:white;
style E fill:darkred,color:white;

File Location

Assets/Server/Item/Recipes/

Salvage recipes are in the sub-directory:

Assets/Server/Item/Recipes/Salvage/

Some items embed their own recipe directly in their item definition file under Assets/Server/Item/Items/ using the same schema.

Schema

Top-level fields

FieldTypeRequiredDefaultDescription
InputInputEntry[]YesList of items or resource types consumed by the recipe.
OutputOutputEntry[]NoFull list of all items produced. When omitted the item carrying the recipe is the sole output.
PrimaryOutputOutputEntryNoThe “headline” output shown in crafting UI when multiple outputs exist.
BenchRequirementBenchRequirement[]No[]Benches (or fieldcraft) required to perform the craft.
TimeSecondsnumberNo0How many real-world seconds the craft takes.

InputEntry

FieldTypeRequiredDefaultDescription
ItemIdstringNo¹Specific item ID to consume. Mutually exclusive with ResourceTypeId.
ResourceTypeIdstringNo¹Resource tag to consume (e.g. "Wood_Trunk", "Rock"). Any item tagged with this resource type satisfies the slot.
QuantitynumberYesNumber of items or resource units consumed.

¹ Exactly one of ItemId or ResourceTypeId must be present per entry.

OutputEntry

FieldTypeRequiredDefaultDescription
ItemIdstringYesID of the item produced.
QuantitynumberNo1Stack size of the produced item.

BenchRequirement

FieldTypeRequiredDefaultDescription
Type"Crafting" | "Processing"YesWhether the bench is a crafting station or a processing station.
IdstringYesThe bench ID (e.g. "Workbench", "Campfire", "Fieldcraft").
Categoriesstring[]NoOptional list of category slots on the bench that must be active for this recipe to appear.

Example

Salvage recipe (Assets/Server/Item/Recipes/Salvage/Salvage_Armor_Adamantite_Chest.json):

{
"Input": [
{
"ItemId": "Armor_Adamantite_Chest",
"Quantity": 1
}
],
"PrimaryOutput": {
"ItemId": "Ore_Adamantite",
"Quantity": 6
},
"Output": [
{
"ItemId": "Ore_Adamantite",
"Quantity": 6
},
{
"ItemId": "Ingredient_Hide_Heavy",
"Quantity": 2
},
{
"ItemId": "Ingredient_Fabric_Scrap_Cindercloth",
"Quantity": 2
}
],
"BenchRequirement": [
{
"Type": "Processing",
"Id": "Salvagebench"
}
],
"TimeSeconds": 4
}

Inline recipe in an item file (from Assets/Server/Item/Items/Bench/Bench_Campfire.json):

{
"Recipe": {
"TimeSeconds": 1,
"Input": [
{ "ItemId": "Ingredient_Stick", "Quantity": 4 },
{ "ResourceTypeId": "Rubble", "Quantity": 2 }
],
"BenchRequirement": [
{ "Type": "Crafting", "Categories": ["Tools"], "Id": "Fieldcraft" },
{ "Id": "Workbench", "Type": "Crafting", "Categories": ["Workbench_Survival"] }
]
}
}