Class GridRecipe
- Namespace
- Vintagestory.API.Common
- Assembly
- VintagestoryAPI.dll
Represents a crafting recipe to be made on the crafting grid. Open in GitHub
[DocumentAsJson]
public class GridRecipe : RecipeBase
- Inheritance
-
GridRecipe
- Inherited Members
Examples
{
"ingredientPattern": "GS,S_",
"ingredients": {
"G": {
"type": "item",
"code": "drygrass"
},
"S": {
"type": "item",
"code": "stick"
}
},
"width": 2,
"height": 2,
"output": {
"type": "item",
"code": "firestarter"
}
}
Fields
IngredientPattern (Required)
The pattern of the ingredient. Order for a 3x3 recipe:
1 2 3
4 5 6
7 8 9
Order for a 2x2 recipe:
1 2
3 4
Commas separate each horizontal row, and an underscore ( _ ) marks a space as empty.
Note: from game version 1.20.4, this becomes null on server-side after completion of recipe resolving during server start-up phase
[DocumentAsJson("Required", "", false)]
public string? IngredientPattern { get; set; }
Field Value
Ingredients (Required)
The recipes ingredients in any order, including the code used in the ingredient pattern.
Note: from game version 1.20.4, this becomes null on server-side after completion of recipe resolving during server start-up phase
[DocumentAsJson("Required", "", false)]
public Dictionary<string, CraftingRecipeIngredient>? Ingredients { get; set; }
Field Value
Output (Required)
The resulting stack when the recipe is created.
[DocumentAsJson("Required", "", false)]
public CraftingRecipeIngredient? Output { get; set; }
Field Value
Height (Recommended) (Default: 3)
Required grid height for crafting this recipe
[DocumentAsJson("Recommended", "3", false)]
public int Height { get; set; }
Field Value
Width (Recommended) (Default: 3)
Required grid width for crafting this recipe
[DocumentAsJson("Recommended", "3", false)]
public int Width { get; set; }
Field Value
RecipeGroup (Optional) (Default: 0)
Info used by the handbook. By default, all recipes for an object will appear in a single preview. This allows you to split grid recipe previews into multiple.
[DocumentAsJson("Optional", "0", false)]
public int RecipeGroup { get; set; }
Field Value
Shapeless (Optional) (Default: False)
Whether the order of input items should be respected
[DocumentAsJson("Optional", "False", false)]
public bool Shapeless { get; set; }