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 cps$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 Lcps$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 Lcps$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 Lcps$a;c:Z
    • eatSeconds

      private float eatSeconds
      Mappings:
      Namespace Name Mixin selector
      named eatSeconds Lnet/minecraft/component/type/FoodComponent$Builder;eatSeconds:F
      intermediary field_49995 Lnet/minecraft/class_4174$class_4175;field_49995:F
      official d Lcps$a;d:F
    • effects

      Mappings:
      Namespace Name Mixin selector
      named effects Lnet/minecraft/component/type/FoodComponent$Builder;effects:Lcom/google/common/collect/ImmutableList$Builder;
      intermediary field_18625 Lnet/minecraft/class_4174$class_4175;field_18625:Lcom/google/common/collect/ImmutableList$Builder;
      official e Lcps$a;e:Lcom/google/common/collect/ImmutableList$Builder;
  • 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 Lcps$a;a(I)Lcps$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 Lcps$a;a(F)Lcps$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 Lcps$a;a()Lcps$a;
    • snack

      public FoodComponent.Builder snack()
      Specifies that a food item is snack-like and is eaten quickly.
      Mappings:
      Namespace Name Mixin selector
      named snack Lnet/minecraft/component/type/FoodComponent$Builder;snack()Lnet/minecraft/component/type/FoodComponent$Builder;
      intermediary method_19241 Lnet/minecraft/class_4174$class_4175;method_19241()Lnet/minecraft/class_4174$class_4175;
      official b Lcps$a;b()Lcps$a;
    • statusEffect

      public FoodComponent.Builder statusEffect(StatusEffectInstance effect, float chance)
      Specifies a status effect to apply to an entity when a food item is consumed. This method may be called multiple times to apply several status effects when food is consumed.
      Parameters:
      effect - the effect instance to apply
      chance - the chance the status effect is applied, on a scale of 0.0F to 1.0F
      Mappings:
      Namespace Name Mixin selector
      named statusEffect Lnet/minecraft/component/type/FoodComponent$Builder;statusEffect(Lnet/minecraft/entity/effect/StatusEffectInstance;F)Lnet/minecraft/component/type/FoodComponent$Builder;
      intermediary method_19239 Lnet/minecraft/class_4174$class_4175;method_19239(Lnet/minecraft/class_1293;F)Lnet/minecraft/class_4174$class_4175;
      official a Lcps$a;a(Lbsd;F)Lcps$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 c Lcps$a;c()Lcps;