net.minecraft.component.type

public record FoodComponent

implements Consumable

net.minecraft.world.food.FoodProperties
net.minecraft.world.food.FoodProperties
net.minecraft.class_4174
net.minecraft.component.type.FoodComponent

Field summary

Modifier and TypeField
private final int
nutrition
nutrition
comp_2491
nutrition
private final float
saturation
saturation
comp_2492
saturation
private final boolean
canAlwaysEat
canAlwaysEat
comp_2493
canAlwaysEat
public static final com.mojang.serialization.Codec<FoodComponent>
DIRECT_CODEC
DIRECT_CODEC
field_49992
CODEC
public static final PacketCodec<RegistryByteBuf, FoodComponent>
DIRECT_STREAM_CODEC
DIRECT_STREAM_CODEC
field_49993
PACKET_CODEC

Constructor summary

ModifierConstructor
public (int nutrition, float saturation, boolean canAlwaysEat)

Method summary

Modifier and TypeMethod
public void
onConsume(Level level, LivingEntity user, ItemStack stack, Consumable consumable)
onConsume(Level level, LivingEntity user, ItemStack stack, Consumable consumable)
method_62831(class_1937 arg0, class_1309 arg1, class_1799 arg2, class_10124 arg3)
onConsume(World arg0, LivingEntity arg1, ItemStack arg2, ConsumableComponent arg3)
public int
nutrition()
nutrition()
comp_2491()
nutrition()
public float
saturation()
saturation()
comp_2492()
saturation()
public boolean
canAlwaysEat()
canAlwaysEat()
comp_2493()
canAlwaysEat()