Interface FoodComponent
- All Superinterfaces:
- ConfigurationSerializable
Represents a component which can handle food stats in any item.
 
Note: Items with food stats has no effect unless the item can be consumed, see
Note: Items with food stats has no effect unless the item can be consumed, see
ConsumableComponent.- 
Method SummaryModifier and TypeMethodDescriptionbooleanGets if this item can be eaten even when not hungry.intGets the food restored by this item when eaten.floatGets the saturation restored by this item when eaten.voidsetCanAlwaysEat(boolean canAlwaysEat) Sets if this item can be eaten even when not hungry.voidsetNutrition(int nutrition) Sets the food restored by this item when eaten.voidsetSaturation(float saturation) Sets the saturation restored by this item when eaten.Methods inherited from interface org.bukkit.configuration.serialization.ConfigurationSerializableserialize
- 
Method Details- 
getNutritionint getNutrition()Gets the food restored by this item when eaten.- Returns:
- nutrition value
 
- 
setNutritionvoid setNutrition(int nutrition) Sets the food restored by this item when eaten.- Parameters:
- nutrition- new nutrition value, must be non-negative
 
- 
getSaturationfloat getSaturation()Gets the saturation restored by this item when eaten.- Returns:
- saturation value
 
- 
setSaturationvoid setSaturation(float saturation) Sets the saturation restored by this item when eaten.- Parameters:
- saturation- new saturation value
 
- 
canAlwaysEatboolean canAlwaysEat()Gets if this item can be eaten even when not hungry.- Returns:
- true if always edible
 
- 
setCanAlwaysEatvoid setCanAlwaysEat(boolean canAlwaysEat) Sets if this item can be eaten even when not hungry.- Parameters:
- canAlwaysEat- whether always edible
 
 
-