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 csy$a
  • Field Details

    • nutrition

      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 Lcsy$a;a:I
    • saturationModifier

      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 Lcsy$a;b:F
    • canAlwaysEat

      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 Lcsy$a;c:Z
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • nutrition

      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 Lcsy$a;a(I)Lcsy$a;
    • saturationModifier

      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 Lcsy$a;a(F)Lcsy$a;
    • alwaysEdible

      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 Lcsy$a;a()Lcsy$a;
    • build

      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 Lcsy$a;b()Lcsy;