Interface FoodProperties

All Superinterfaces:
BuildableDataComponent<FoodProperties,FoodProperties.Builder>

Holds the food properties of an item.
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Builder for FoodProperties.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    If true, this food can be eaten even if not hungry.
     
    @org.checkerframework.checker.index.qual.NonNegative int
    Number of food points to restore when eaten.
    float
    Amount of saturation to restore when eaten.

    Methods inherited from interface io.papermc.paper.datacomponent.BuildableDataComponent

    toBuilder
  • Method Details

    • food

      @Contract(value="-> new", pure=true) static FoodProperties.Builder food()
    • nutrition

      @Contract(pure=true) @org.checkerframework.checker.index.qual.NonNegative int nutrition()
      Number of food points to restore when eaten.
      Returns:
      the nutrition
    • saturation

      @Contract(pure=true) float saturation()
      Amount of saturation to restore when eaten.
      Returns:
      the saturation
    • canAlwaysEat

      @Contract(pure=true) boolean canAlwaysEat()
      If true, this food can be eaten even if not hungry.
      Returns:
      can always be eaten