Class RecipeBase
- Namespace
- Vintagestory.API.Common
- Assembly
- VintagestoryAPI.dll
Creates a new base recipe type. Almost all recipe types extend from this. Open in GitHub
[DocumentAsJson]
public abstract class RecipeBase
- Inheritance
-
RecipeBase
- Derived
Fields
AllowedVariants (Optional) (Default: None)
If '{code}' is used in ingredient code, allowed variants for this code should be specified in this map
[DocumentAsJson("Optional", "None", false)]
public Dictionary<string, string[]> AllowedVariants { get; set; }
Field Value
- Dictionary<string, string[]>
Attributes (Optional) (Default: None)
Optional attribute data that you can attach any data to. Useful for code mods, but also required when using liquid ingredients.
See dough.json grid recipe file for example.
[JsonConverter(typeof(JsonAttributesConverter))]
[DocumentAsJson("Optional", "None", false)]
public JsonObject? Attributes { get; set; }
Field Value
- JsonObject
AverageDurability (Optional) (Default: True)
If true, the output item will have its durability averaged over the input items
[DocumentAsJson("Optional", "True", false)]
public bool AverageDurability { get; set; }
Field Value
CopyAttributesFrom (Optional) (Default: None)
If set, it will copy over the itemstack attributes from given ingredient code
[DocumentAsJson("Optional", "None", false)]
public string? CopyAttributesFrom { get; set; }
Field Value
Enabled (Optional) (Default: True)
If set to false, the recipe will never be loaded. If loaded, you can use this field to disable recipes during runtime.
[DocumentAsJson("Optional", "True", false)]
public bool Enabled { get; set; }
Field Value
MergeAttributesFrom (Optional) (Default: None)
Attributes from these ingredients will be merged into output itemstack
[DocumentAsJson("Optional", "None", false)]
public string[] MergeAttributesFrom { get; set; }
Field Value
- string[]
Name (Optional) (Default: Asset Path)
Adds a name to this. Used for logging, and determining helve hammer workability for smithing recipes. Recipes for repairing objects must contain 'repair' in the name.
[DocumentAsJson("Optional", "Asset Path", false)]
public AssetLocation? Name { get; set; }
Field Value
RequiresTrait (Optional) (Default: None)
If set, only players with given trait can use this See config/traits.json for a list of traits.
[DocumentAsJson("Optional", "None", false)]
public string? RequiresTrait { get; set; }
Field Value
ShowInCreatedBy (Optional) (Default: True)
Used by the handbook. If false, will not appear in the "Created by" section
[DocumentAsJson("Optional", "True", false)]
public bool ShowInCreatedBy { get; set; }
Field Value
SkipVariants (Optional) (Default: None)
If '{code}' is used in ingredient code, skip variants for this code should be specified in this map
[DocumentAsJson("Optional", "None", false)]
public Dictionary<string, string[]> SkipVariants { get; set; }
Field Value
- Dictionary<string, string[]>