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
Examples
"nutritionPropsByType": {
"*-flyagaric-*": {
"satiety": 80,
"health": -6.5,
"foodcategory": "Vegetable"
},
"*-earthball-*": {
"satiety": 80,
"health": -8,
"foodcategory": "Vegetable"
},
...
Fields
FoodCategory (Recommended) (Default: Fruit)
The category of the food.
[DocumentAsJson("Recommended", "Fruit", false)]
public EnumFoodCategory FoodCategory
Field Value
Satiety (Recommended) (Default: 0)
The saturation restored by the food.
[DocumentAsJson("Recommended", "0", false)]
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.)
[DocumentAsJson("Optional", "None", false)]
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.
[DocumentAsJson("Optional", "0", false)]
public float Health
Field Value
HealthDurationSec (Optional) (Default: 0)
If greater than zero, healing will be turned into healing over time and will be fully applied over this time. If HealthTicks is set to 1, it will mean that healing will just be delayed by HealthDurationSec.
[DocumentAsJson("Optional", "0", false)]
public float HealthDurationSec { get; set; }
Field Value
HealthTicks (Optional) (Default: 1)
If HealthDurationSec greater than zero, total healing will be split into this many portions, each applied in HealthDurationSec/HealthTicks time after another.
[DocumentAsJson("Optional", "1", false)]
public int HealthTicks { get; set; }
Field Value
Intoxication (Optional) (Default: 0)
How much eating this will affect the player's intoxication. (0..1)
[DocumentAsJson("Optional", "0", false)]
public float Intoxication { get; set; }
Field Value
Psychedelic (Optional) (Default: 0)
How much eating this will affect the player's psychedelic perception. (0..1)
[DocumentAsJson("Optional", "0", false)]
public float Psychedelic { get; set; }
Field Value
SatietyLossDelay (Optional) (Default: 10)
The delay before that extra saturation starts to go away.
[DocumentAsJson("Optional", "10", false)]
public float SatietyLossDelay
Field Value
Saturation (Obsolete)
Obsolete - Please use Satiety instead.
[DocumentAsJson("Obsolete", "", false)]
[Obsolete("Use Satiety instead.")]
public float Saturation { get; set; }
Field Value
SaturationLossDelay (Obsolete)
Obsolete - Please use SatietyLossDelay instead.
[DocumentAsJson("Obsolete", "", false)]
[Obsolete("Use SatietyLossDelay instead.")]
public float SaturationLossDelay { get; set; }