Interface FoodProperties.Builder
- All Superinterfaces:
DataComponentBuilder<FoodProperties>
- Enclosing interface:
FoodProperties
@Experimental
@NonExtendable
public static interface FoodProperties.Builder
extends DataComponentBuilder<FoodProperties>
Builder for
FoodProperties
.-
Method Summary
Modifier and TypeMethodDescriptioncanAlwaysEat
(boolean canAlwaysEat) Set if this food can always be eaten, even if the player is not hungry.nutrition
(@org.checkerframework.checker.index.qual.NonNegative int nutrition) Sets the nutrition of the food.saturation
(float saturation) Sets the saturation of the food.Methods inherited from interface io.papermc.paper.datacomponent.DataComponentBuilder
build
-
Method Details
-
canAlwaysEat
@Contract(value="_ -> this", mutates="this") FoodProperties.Builder canAlwaysEat(boolean canAlwaysEat) Set if this food can always be eaten, even if the player is not hungry.- Parameters:
canAlwaysEat
- true to allow always eating- Returns:
- the builder for chaining
- See Also:
-
saturation
Sets the saturation of the food.- Parameters:
saturation
- the saturation- Returns:
- the builder for chaining
- See Also:
-
nutrition
@Contract(value="_ -> this", mutates="this") FoodProperties.Builder nutrition(@org.checkerframework.checker.index.qual.NonNegative int nutrition) Sets the nutrition of the food.- Parameters:
nutrition
- the nutrition, must be non-negative- Returns:
- the builder for chaining
- See Also:
-