Class FoodComponent.Builder

java.lang.Object
net.minecraft.component.type.FoodComponent.Builder
Enclosing class:
FoodComponent

public static class FoodComponent.Builder extends Object
Mappings:
Namespace Name
named net/minecraft/component/type/FoodComponent$Builder
intermediary net/minecraft/class_4174$class_4175
official csa$a
  • Field Details Link icon

    • nutrition Link icon

      private int nutrition
      Mappings:
      Namespace Name Mixin selector
      named nutrition Lnet/minecraft/component/type/FoodComponent$Builder;nutrition:I
      intermediary field_18620 Lnet/minecraft/class_4174$class_4175;field_18620:I
      official a Lcsa$a;a:I
    • saturationModifier Link icon

      private float saturationModifier
      Mappings:
      Namespace Name Mixin selector
      named saturationModifier Lnet/minecraft/component/type/FoodComponent$Builder;saturationModifier:F
      intermediary field_18621 Lnet/minecraft/class_4174$class_4175;field_18621:F
      official b Lcsa$a;b:F
    • canAlwaysEat Link icon

      private boolean canAlwaysEat
      Mappings:
      Namespace Name Mixin selector
      named canAlwaysEat Lnet/minecraft/component/type/FoodComponent$Builder;canAlwaysEat:Z
      intermediary field_18623 Lnet/minecraft/class_4174$class_4175;field_18623:Z
      official c Lcsa$a;c:Z
  • Constructor Details Link icon

    • Builder Link icon

      public Builder()
  • Method Details Link icon

    • nutrition Link icon

      public FoodComponent.Builder nutrition(int nutrition)
      Specifies the amount of hunger a food item will fill.

      One hunger is equivalent to half of a hunger bar icon.

      Parameters:
      nutrition - the amount of hunger
      Mappings:
      Namespace Name Mixin selector
      named nutrition Lnet/minecraft/component/type/FoodComponent$Builder;nutrition(I)Lnet/minecraft/component/type/FoodComponent$Builder;
      intermediary method_19238 Lnet/minecraft/class_4174$class_4175;method_19238(I)Lnet/minecraft/class_4174$class_4175;
      official a Lcsa$a;a(I)Lcsa$a;
    • saturationModifier Link icon

      public FoodComponent.Builder saturationModifier(float saturationModifier)
      Specifies the saturation modifier of a food item.

      This value is typically used to determine how long a player can sustain the current hunger value before the hunger is used.

      Parameters:
      saturationModifier - the saturation modifier
      Mappings:
      Namespace Name Mixin selector
      named saturationModifier Lnet/minecraft/component/type/FoodComponent$Builder;saturationModifier(F)Lnet/minecraft/component/type/FoodComponent$Builder;
      intermediary method_19237 Lnet/minecraft/class_4174$class_4175;method_19237(F)Lnet/minecraft/class_4174$class_4175;
      official a Lcsa$a;a(F)Lcsa$a;
    • alwaysEdible Link icon

      public FoodComponent.Builder alwaysEdible()
      Specifies that a food item can be eaten when the current hunger bar is full.
      Mappings:
      Namespace Name Mixin selector
      named alwaysEdible Lnet/minecraft/component/type/FoodComponent$Builder;alwaysEdible()Lnet/minecraft/component/type/FoodComponent$Builder;
      intermediary method_19240 Lnet/minecraft/class_4174$class_4175;method_19240()Lnet/minecraft/class_4174$class_4175;
      official a Lcsa$a;a()Lcsa$a;
    • build Link icon

      public FoodComponent build()
      Mappings:
      Namespace Name Mixin selector
      named build Lnet/minecraft/component/type/FoodComponent$Builder;build()Lnet/minecraft/component/type/FoodComponent;
      intermediary method_19242 Lnet/minecraft/class_4174$class_4175;method_19242()Lnet/minecraft/class_4174;
      official b Lcsa$a;b()Lcsa;