Interface FoodProperties.Builder

All Superinterfaces:
DataComponentBuilder<FoodProperties>
Enclosing interface:
FoodProperties

@NonExtendable public static interface FoodProperties.Builder extends DataComponentBuilder<FoodProperties>
Builder for FoodProperties.
Since:
1.21.3
  • 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
      Since:
      1.21.3
      See Also:
    • saturation

      @Contract(value="_ -> this", mutates="this") FoodProperties.Builder saturation(float saturation)
      Sets the saturation of the food.
      Parameters:
      saturation - the saturation
      Returns:
      the builder for chaining
      Since:
      1.21.3
      See Also:
    • nutrition

      @Contract(value="_ -> this", mutates="this") FoodProperties.Builder nutrition(@NonNegative int nutrition)
      Sets the nutrition of the food.
      Parameters:
      nutrition - the nutrition, must be non-negative
      Returns:
      the builder for chaining
      Since:
      1.21.3
      See Also: