Class FoodComponent.Builder

java.lang.Object
net.minecraft.item.FoodComponent.Builder
Enclosing class:
FoodComponent

public static class FoodComponent.Builder extends Object
Mappings:
Namespace Name
official cbc$a
intermediary net/minecraft/class_4174$class_4175
named net/minecraft/item/FoodComponent$Builder
  • Field Details

    • hunger

      private int hunger
      Mappings:
      Namespace Name Mixin selector
      official a Lcbc$a;a:I
      intermediary field_18620 Lnet/minecraft/class_4174$class_4175;field_18620:I
      named hunger Lnet/minecraft/item/FoodComponent$Builder;hunger:I
    • saturationModifier

      private float saturationModifier
      Mappings:
      Namespace Name Mixin selector
      official b Lcbc$a;b:F
      intermediary field_18621 Lnet/minecraft/class_4174$class_4175;field_18621:F
      named saturationModifier Lnet/minecraft/item/FoodComponent$Builder;saturationModifier:F
    • meat

      private boolean meat
      Mappings:
      Namespace Name Mixin selector
      official c Lcbc$a;c:Z
      intermediary field_18622 Lnet/minecraft/class_4174$class_4175;field_18622:Z
      named meat Lnet/minecraft/item/FoodComponent$Builder;meat:Z
    • alwaysEdible

      private boolean alwaysEdible
      Mappings:
      Namespace Name Mixin selector
      official d Lcbc$a;d:Z
      intermediary field_18623 Lnet/minecraft/class_4174$class_4175;field_18623:Z
      named alwaysEdible Lnet/minecraft/item/FoodComponent$Builder;alwaysEdible:Z
    • snack

      private boolean snack
      Mappings:
      Namespace Name Mixin selector
      official e Lcbc$a;e:Z
      intermediary field_18624 Lnet/minecraft/class_4174$class_4175;field_18624:Z
      named snack Lnet/minecraft/item/FoodComponent$Builder;snack:Z
    • statusEffects

      private final List<com.mojang.datafixers.util.Pair<StatusEffectInstance,Float>> statusEffects
      Mappings:
      Namespace Name Mixin selector
      official f Lcbc$a;f:Ljava/util/List;
      intermediary field_18625 Lnet/minecraft/class_4174$class_4175;field_18625:Ljava/util/List;
      named statusEffects Lnet/minecraft/item/FoodComponent$Builder;statusEffects:Ljava/util/List;
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • hunger

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

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

      Parameters:
      hunger - the amount of hunger
      Mappings:
      Namespace Name Mixin selector
      official a Lcbc$a;a(I)Lcbc$a;
      intermediary method_19238 Lnet/minecraft/class_4174$class_4175;method_19238(I)Lnet/minecraft/class_4174$class_4175;
      named hunger Lnet/minecraft/item/FoodComponent$Builder;hunger(I)Lnet/minecraft/item/FoodComponent$Builder;
    • 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
      official a Lcbc$a;a(F)Lcbc$a;
      intermediary method_19237 Lnet/minecraft/class_4174$class_4175;method_19237(F)Lnet/minecraft/class_4174$class_4175;
      named saturationModifier Lnet/minecraft/item/FoodComponent$Builder;saturationModifier(F)Lnet/minecraft/item/FoodComponent$Builder;
    • meat

      public FoodComponent.Builder meat()
      Specifies that a food item can be fed to dogs.
      Mappings:
      Namespace Name Mixin selector
      official a Lcbc$a;a()Lcbc$a;
      intermediary method_19236 Lnet/minecraft/class_4174$class_4175;method_19236()Lnet/minecraft/class_4174$class_4175;
      named meat Lnet/minecraft/item/FoodComponent$Builder;meat()Lnet/minecraft/item/FoodComponent$Builder;
    • 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
      official b Lcbc$a;b()Lcbc$a;
      intermediary method_19240 Lnet/minecraft/class_4174$class_4175;method_19240()Lnet/minecraft/class_4174$class_4175;
      named alwaysEdible Lnet/minecraft/item/FoodComponent$Builder;alwaysEdible()Lnet/minecraft/item/FoodComponent$Builder;
    • snack

      public FoodComponent.Builder snack()
      Specifies that a food item is snack-like and is eaten quickly.
      Mappings:
      Namespace Name Mixin selector
      official c Lcbc$a;c()Lcbc$a;
      intermediary method_19241 Lnet/minecraft/class_4174$class_4175;method_19241()Lnet/minecraft/class_4174$class_4175;
      named snack Lnet/minecraft/item/FoodComponent$Builder;snack()Lnet/minecraft/item/FoodComponent$Builder;
    • 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
      official a Lcbc$a;a(Lbfa;F)Lcbc$a;
      intermediary method_19239 Lnet/minecraft/class_4174$class_4175;method_19239(Lnet/minecraft/class_1293;F)Lnet/minecraft/class_4174$class_4175;
      named statusEffect Lnet/minecraft/item/FoodComponent$Builder;statusEffect(Lnet/minecraft/entity/effect/StatusEffectInstance;F)Lnet/minecraft/item/FoodComponent$Builder;
    • build

      public FoodComponent build()
      Mappings:
      Namespace Name Mixin selector
      official d Lcbc$a;d()Lcbc;
      intermediary method_19242 Lnet/minecraft/class_4174$class_4175;method_19242()Lnet/minecraft/class_4174;
      named build Lnet/minecraft/item/FoodComponent$Builder;build()Lnet/minecraft/item/FoodComponent;