Class CraftingRecipeIngredient
- Namespace
- Vintagestory.API.Common
- Assembly
- VintagestoryAPI.dll
A crafting recipe ingredient
[DocumentAsJson]
public class CraftingRecipeIngredient
- Inheritance
-
CraftingRecipeIngredient
- Derived
Fields
Code (Required)
The code of the item or block
[DocumentAsJson]
public AssetLocation Code { get; set; }
Field Value
Name (Required)
Attaches a name to a wildcard in an ingredient. This is used to substitute the value into the output. Only required if using a wildcard.
[DocumentAsJson]
public string Name { get; set; }
Field Value
Quantity (Recommended) (Default: 1)
The quantity of the itemstack required for the recipe.
[DocumentAsJson]
public int Quantity
Field Value
Type (Recommended) (Default: Block)
Is the itemstack an item or a block?
[DocumentAsJson]
public EnumItemClass Type
Field Value
AllowedVariants (Optional) (Default: Allow All)
When using a wildcard in the item/block code, setting this field will limit the allowed variants
[DocumentAsJson]
public string[] AllowedVariants
Field Value
- string[]
Attributes (Optional) (Default: None)
What attributes this itemstack must have to be a valid ingredient
[JsonProperty]
[JsonConverter(typeof(JsonAttributesConverter))]
public JsonObject Attributes
Field Value
IsTool (Optional) (Default: False)
Whether this crafting recipe ingredient should be regarded as a tool required to build this item. If true, the recipe will not consume the item but reduce its durability.
[DocumentAsJson]
public bool IsTool
Field Value
RecipeAttributes (Optional) (Default: None)
Optional attribute data that you can attach any data to. Used for some specific instances in code mods.
[JsonProperty]
[JsonConverter(typeof(JsonAttributesConverter))]
public JsonObject RecipeAttributes
Field Value
ReturnedStack (Optional) (Default: None)
If set, the crafting recipe will give back the consumed stack to be player upon crafting. Can also be used to produce multiple outputs for a recipe.
[DocumentAsJson]
public JsonItemStack ReturnedStack
Field Value
SkipVariants (Optional) (Default: Skip None)
When using a wildcard in the item/block code, setting this field will skip these variants
[DocumentAsJson]
public string[] SkipVariants
Field Value
- string[]
ToolDurabilityCost (Optional) (Default: 1)
If IsTool is set, this is the durability cost when the recipe is created.
[DocumentAsJson]
public int ToolDurabilityCost