Interface JavaFoodProperties
public interface JavaFoodProperties
The food properties component can be used to define properties
for consumable items. This includes setting the nutrition and
saturation values, and whether the item can always be eaten.
- Since:
- 2.9.3
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceBuilder for the food properties component. -
Method Summary
Modifier and TypeMethodDescriptionstatic JavaFoodProperties.Builderbuilder()Creates a builder for the food properties component.booleanWhether this item can always be eaten, even when not hungry.@org.checkerframework.checker.index.qual.NonNegative intThe nutrition of the item.static JavaFoodPropertiesof(int nutrition, float saturation, boolean canAlwaysEat) Creates a food properties component.@org.checkerframework.checker.index.qual.NonNegative floatThe saturation of the item.
-
Method Details
-
nutrition
@org.checkerframework.checker.index.qual.NonNegative int nutrition()The nutrition of the item. Defaults to0.- Returns:
- the nutrition
- Since:
- 2.9.3
-
saturation
@org.checkerframework.checker.index.qual.NonNegative float saturation()The saturation of the item. Defaults to0.0.- Returns:
- the saturation
- Since:
- 2.9.3
-
canAlwaysEat
boolean canAlwaysEat()Whether this item can always be eaten, even when not hungry. In vanilla, this would include items such as golden apples. Defaults tofalse.- Returns:
- whether the item can always be eaten
- Since:
- 2.9.3
-
builder
Creates a builder for the food properties component.- Returns:
- a new builder
- Since:
- 2.9.3
-
of
Creates a food properties component.- Parameters:
nutrition- the nutrition of the itemsaturation- the saturation of the itemcanAlwaysEat- whether the item can always be eaten- Returns:
- the food properties component
- Since:
- 2.9.3
-