Class FoodNutritionProperties
- Namespace
- Vintagestory.API.Common
- Assembly
- VintagestoryAPI.dll
Allows you to make collectibles edible, and adds data about their nutrition.
public class FoodNutritionProperties
- Inheritance
-
FoodNutritionProperties
Examples
"nutritionPropsByType": {
"*-flyagaric-*": {
"saturation": 80,
"health": -6.5,
"foodcategory": "Vegetable"
},
"*-earthball-*": {
"saturation": 80,
"health": -8,
"foodcategory": "Vegetable"
},
...
Fields
FoodCategory (Recommended) (Default: Fruit)
The category of the food.
public EnumFoodCategory FoodCategory
Field Value
Satiety (Recommended) (Default: 0)
The saturation restored by the food.
public float Satiety
Field Value
EatenStack (Optional) (Default: None)
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.)
public JsonItemStack EatenStack
Field Value
Health (Optional) (Default: 0)
The health restored by the food. Usually actually used to hurt the player with negative values.
public float Health
Field Value
SaturationLossDelay (Optional) (Default: 10)
The delay before that extra saturation starts to go away.
public float SaturationLossDelay
Field Value
Properties
Intoxication (Optional) (Default: 0)
How much eating this will affect the player's intoxication.
public float Intoxication { get; set; }
Property Value
Saturation (Obsolete)
Obsolete - Please use Satiety instead.
[Obsolete("Use Satiety instead.")]
public float Saturation { get; set; }