Package net.minecraft.component.type
Class FoodComponent.Builder
java.lang.Object
net.minecraft.component.type.FoodComponent.Builder
- Enclosing class:
FoodComponent
- Mappings:
Namespace Name named net/minecraft/component/type/FoodComponent$Builder
intermediary net/minecraft/class_4174$class_4175
official cpf$a
-
Field Summary
Modifier and TypeFieldDescriptionprivate boolean
private float
private final ImmutableList.Builder
<FoodComponent.StatusEffectEntry> private int
private float
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionSpecifies that a food item can be eaten when the current hunger bar is full.build()
nutrition
(int nutrition) Specifies the amount of hunger a food item will fill.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
-
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
Lcpf$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
Lcpf$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
Lcpf$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
Lcpf$a;d:F
-
usingConvertsTo
- Mappings:
Namespace Name Mixin selector named usingConvertsTo
Lnet/minecraft/component/type/FoodComponent$Builder;usingConvertsTo:Ljava/util/Optional;
intermediary field_51895
Lnet/minecraft/class_4174$class_4175;field_51895:Ljava/util/Optional;
official e
Lcpf$a;e:Ljava/util/Optional;
-
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 f
Lcpf$a;f:Lcom/google/common/collect/ImmutableList$Builder;
-
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
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
Lcpf$a;a(I)Lcpf$a;
-
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
Lcpf$a;a(F)Lcpf$a;
-
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
Lcpf$a;a()Lcpf$a;
-
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
Lcpf$a;b()Lcpf$a;
-
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 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
Lcpf$a;a(Lbrp;F)Lcpf$a;
-
usingConvertsTo
- Mappings:
Namespace Name Mixin selector named usingConvertsTo
Lnet/minecraft/component/type/FoodComponent$Builder;usingConvertsTo(Lnet/minecraft/item/ItemConvertible;)Lnet/minecraft/component/type/FoodComponent$Builder;
intermediary method_60500
Lnet/minecraft/class_4174$class_4175;method_60500(Lnet/minecraft/class_1935;)Lnet/minecraft/class_4174$class_4175;
official a
Lcpf$a;a(Ldcf;)Lcpf$a;
-
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
Lcpf$a;c()Lcpf;
-