Class FoodNutritionProperties
- Namespace
- Vintagestory.API.Common
- Assembly
- VintagestoryAPI.dll
Allows you to make collectibles edible, and adds data about their nutrition. Open in GitHub
[DocumentAsJson]
public class FoodNutritionProperties
- Inheritance
-
FoodNutritionProperties
- Inherited Members
- Extension Methods
Examples
"nutritionPropsByType": {
"*-flyagaric-*": {
"saturation": 80,
"health": -6.5,
"foodcategory": "Vegetable"
},
"*-earthball-*": {
"saturation": 80,
"health": -8,
"foodcategory": "Vegetable"
},
...
Fields
EatenStack
When an instance of this collectible is eaten, what item stack should be returned to the player? Possible example: Eating a 'meat on a stick' item would return a single stick. (Note: Bowl meals/liquids are specially designed to do this through their attributes and class.)
[DocumentAsJson]
public JsonItemStack EatenStack
Field Value
FoodCategory
The category of the food.
[DocumentAsJson]
public EnumFoodCategory FoodCategory
Field Value
Health
The health restored by the food. Usually actually used to hurt the player with negative values.
[DocumentAsJson]
public float Health
Field Value
Satiety
The saturation restored by the food.
[DocumentAsJson]
public float Satiety
Field Value
SaturationLossDelay
The delay before that extra saturation starts to go away.
[DocumentAsJson]
public float SaturationLossDelay
Field Value
Properties
Intoxication
How much eating this will affect the player's intoxication.
[DocumentAsJson]
public float Intoxication { get; set; }
Property Value
Saturation
Obsolete - Please use Satiety instead.
[DocumentAsJson]
[Obsolete("Use Satiety instead.")]
public float Saturation { get; set; }
Property Value
Methods
Clone()
Duplicates the nutrition properties, which includes cloning the stack that was eaten.
public FoodNutritionProperties Clone()