Package net.minecraft.item
Class FoodComponent.Builder
java.lang.Object
net.minecraft.item.FoodComponent.Builder
- Enclosing class:
FoodComponent
- Mappings:
Namespace Name official bqm$a
intermediary net/minecraft/class_4174$class_4175
named net/minecraft/item/FoodComponent$Builder
-
Field Summary
Modifier and TypeFieldDescriptionprivate boolean
private int
private boolean
private float
private boolean
private final List<com.mojang.datafixers.util.Pair<StatusEffectInstance,
Float>> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionSpecifies that a food item can be eaten when the current hunger bar is full.build()
hunger
(int hunger) Specifies the amount of hunger a food item will fill.meat()
Specifies that a food item can be fed to dogs.saturationModifier
(float saturationModifier) Specifies the saturation modifier of a food item.snack()
Specifies that a food item is snack-like and is eaten quickly.statusEffect
(StatusEffectInstance effect, float chance) Specifies a status effect to apply to an entity when a food item is consumed.
-
Field Details
-
hunger
private int hunger- Mappings:
Namespace Name Mixin selector official a
Lbqm$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
Lbqm$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
Lbqm$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
Lbqm$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
Lbqm$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
- Mappings:
Namespace Name Mixin selector official f
Lbqm$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
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
Lbqm$a;a(I)Lbqm$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
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
Lbqm$a;a(F)Lbqm$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
Specifies that a food item can be fed to dogs.- Mappings:
Namespace Name Mixin selector official a
Lbqm$a;a()Lbqm$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
Specifies that a food item can be eaten when the current hunger bar is full.- Mappings:
Namespace Name Mixin selector official b
Lbqm$a;b()Lbqm$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
Specifies that a food item is snack-like and is eaten quickly.- Mappings:
Namespace Name Mixin selector official c
Lbqm$a;c()Lbqm$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
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 applychance
- the chance the status effect is applied, on a scale of0.0F
to1.0F
- Mappings:
Namespace Name Mixin selector official a
Lbqm$a;a(Laxe;F)Lbqm$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
- Mappings:
Namespace Name Mixin selector official d
Lbqm$a;d()Lbqm;
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;
-