Package net.minecraft.component.type
Record Class PotionContentsComponent
java.lang.Object
java.lang.Record
net.minecraft.component.type.PotionContentsComponent
- Record Components:
potion-customColor-customEffects-customName-
- All Implemented Interfaces:
Consumable,TooltipAppender
public record PotionContentsComponent(Optional<RegistryEntry<Potion>> potion, Optional<Integer> customColor, List<StatusEffectInstance> customEffects, Optional<String> customName)
extends Record
implements Consumable, TooltipAppender
- Mappings:
Namespace Name named net/minecraft/component/type/PotionContentsComponentintermediary net/minecraft/class_1844official dcgnamed potionintermediary comp_2378official enamed customColorintermediary comp_2379official fnamed customEffectsintermediary comp_2380official gnamed customNameintermediary comp_3209official h
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final com.mojang.serialization.Codec<PotionContentsComponent> static final com.mojang.serialization.Codec<PotionContentsComponent> The field for thecustomColorrecord component.private final List<StatusEffectInstance> The field for thecustomEffectsrecord component.The field for thecustomNamerecord component.static final PotionContentsComponentstatic final intprivate static final Textstatic final PacketCodec<RegistryByteBuf, PotionContentsComponent> private final Optional<RegistryEntry<Potion>> The field for thepotionrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionPotionContentsComponent(Optional<RegistryEntry<Potion>> optional, Optional<Integer> optional2, List<StatusEffectInstance> list, Optional<String> optional3) PotionContentsComponent(RegistryEntry<Potion> potion) -
Method Summary
Modifier and TypeMethodDescriptionvoidappendTooltip(Item.TooltipContext context, Consumer<Text> textConsumer, TooltipType type, ComponentsAccess components) voidapply(LivingEntity user, float durationMultiplier) static voidbuildTooltip(Iterable<StatusEffectInstance> effects, Consumer<Text> textConsumer, float durationMultiplier, float tickRate) static ItemStackcreateStack(Item item, RegistryEntry<Potion> potion) Returns the value of thecustomColorrecord component.Returns the value of thecustomEffectsrecord component.Returns the value of thecustomNamerecord component.final booleanIndicates whether some other object is "equal to" this one.voidforEachEffect(Consumer<StatusEffectInstance> effectConsumer, float durationMultiplier) intgetColor()intgetColor(int defaultColor) static MutableTextgetEffectText(RegistryEntry<StatusEffect> effect, int amplifier) booleanfinal inthashCode()Returns a hash code value for this object.booleanmatches(RegistryEntry<Potion> potion) static OptionalIntmixColors(Iterable<StatusEffectInstance> effects) voidonConsume(World world, LivingEntity user, ItemStack stack, ConsumableComponent consumable) potion()Returns the value of thepotionrecord component.final StringtoString()Returns a string representation of this record class.with(StatusEffectInstance customEffect) with(RegistryEntry<Potion> potion)
-
Field Details
-
potion
The field for thepotionrecord component. -
customColor
The field for thecustomColorrecord component. -
customEffects
The field for thecustomEffectsrecord component. -
customName
The field for thecustomNamerecord component. -
DEFAULT
- Mappings:
Namespace Name Mixin selector named DEFAULTLnet/minecraft/component/type/PotionContentsComponent;DEFAULT:Lnet/minecraft/component/type/PotionContentsComponent;intermediary field_49274Lnet/minecraft/class_1844;field_49274:Lnet/minecraft/class_1844;official aLdcg;a:Ldcg;
-
NONE_TEXT
- Mappings:
Namespace Name Mixin selector named NONE_TEXTLnet/minecraft/component/type/PotionContentsComponent;NONE_TEXT:Lnet/minecraft/text/Text;intermediary field_25817Lnet/minecraft/class_1844;field_25817:Lnet/minecraft/class_2561;official iLdcg;i:Lxg;
-
EFFECTLESS_COLOR
public static final int EFFECTLESS_COLOR- See Also:
- Mappings:
Namespace Name Mixin selector named EFFECTLESS_COLORLnet/minecraft/component/type/PotionContentsComponent;EFFECTLESS_COLOR:Iintermediary field_49277Lnet/minecraft/class_1844;field_49277:Iofficial bLdcg;b:I
-
BASE_CODEC
- Mappings:
Namespace Name Mixin selector named BASE_CODECLnet/minecraft/component/type/PotionContentsComponent;BASE_CODEC:Lcom/mojang/serialization/Codec;intermediary field_49749Lnet/minecraft/class_1844;field_49749:Lcom/mojang/serialization/Codec;official jLdcg;j:Lcom/mojang/serialization/Codec;
-
CODEC
- Mappings:
Namespace Name Mixin selector named CODECLnet/minecraft/component/type/PotionContentsComponent;CODEC:Lcom/mojang/serialization/Codec;intermediary field_49275Lnet/minecraft/class_1844;field_49275:Lcom/mojang/serialization/Codec;official cLdcg;c:Lcom/mojang/serialization/Codec;
-
PACKET_CODEC
- Mappings:
Namespace Name Mixin selector named PACKET_CODECLnet/minecraft/component/type/PotionContentsComponent;PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;intermediary field_49276Lnet/minecraft/class_1844;field_49276:Lnet/minecraft/class_9139;official dLdcg;d:Lze;
-
-
Constructor Details
-
PotionContentsComponent
- Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/component/type/PotionContentsComponent;<init>(Lnet/minecraft/registry/entry/RegistryEntry;)Vintermediary <init>Lnet/minecraft/class_1844;<init>(Lnet/minecraft/class_6880;)Vofficial <init>Ldcg;<init>(Ljg;)V
-
PotionContentsComponent
public PotionContentsComponent(Optional<RegistryEntry<Potion>> optional, Optional<Integer> optional2, List<StatusEffectInstance> list, Optional<String> optional3)
-
-
Method Details
-
createStack
- Mappings:
Namespace Name Mixin selector named createStackLnet/minecraft/component/type/PotionContentsComponent;createStack(Lnet/minecraft/item/Item;Lnet/minecraft/registry/entry/RegistryEntry;)Lnet/minecraft/item/ItemStack;intermediary method_57400Lnet/minecraft/class_1844;method_57400(Lnet/minecraft/class_1792;Lnet/minecraft/class_6880;)Lnet/minecraft/class_1799;official aLdcg;a(Ldag;Ljg;)Ldak;
-
matches
- Mappings:
Namespace Name Mixin selector named matchesLnet/minecraft/component/type/PotionContentsComponent;matches(Lnet/minecraft/registry/entry/RegistryEntry;)Zintermediary method_57401Lnet/minecraft/class_1844;method_57401(Lnet/minecraft/class_6880;)Zofficial aLdcg;a(Ljg;)Z
-
getEffects
- Mappings:
Namespace Name Mixin selector named getEffectsLnet/minecraft/component/type/PotionContentsComponent;getEffects()Ljava/lang/Iterable;intermediary method_57397Lnet/minecraft/class_1844;method_57397()Ljava/lang/Iterable;official aLdcg;a()Ljava/lang/Iterable;
-
forEachEffect
- Mappings:
Namespace Name Mixin selector named forEachEffectLnet/minecraft/component/type/PotionContentsComponent;forEachEffect(Ljava/util/function/Consumer;F)Vintermediary method_57402Lnet/minecraft/class_1844;method_57402(Ljava/util/function/Consumer;F)Vofficial aLdcg;a(Ljava/util/function/Consumer;F)V
-
with
- Mappings:
Namespace Name Mixin selector named withLnet/minecraft/component/type/PotionContentsComponent;with(Lnet/minecraft/registry/entry/RegistryEntry;)Lnet/minecraft/component/type/PotionContentsComponent;intermediary method_57403Lnet/minecraft/class_1844;method_57403(Lnet/minecraft/class_6880;)Lnet/minecraft/class_1844;official bLdcg;b(Ljg;)Ldcg;
-
with
- Mappings:
Namespace Name Mixin selector named withLnet/minecraft/component/type/PotionContentsComponent;with(Lnet/minecraft/entity/effect/StatusEffectInstance;)Lnet/minecraft/component/type/PotionContentsComponent;intermediary method_57398Lnet/minecraft/class_1844;method_57398(Lnet/minecraft/class_1293;)Lnet/minecraft/class_1844;official aLdcg;a(Lbwi;)Ldcg;
-
getColor
public int getColor()- Mappings:
Namespace Name Mixin selector named getColorLnet/minecraft/component/type/PotionContentsComponent;getColor()Iintermediary method_8064Lnet/minecraft/class_1844;method_8064()Iofficial bLdcg;b()I
-
getColor
public int getColor(int defaultColor) - Mappings:
Namespace Name Mixin selector named getColorLnet/minecraft/component/type/PotionContentsComponent;getColor(I)Iintermediary method_65361Lnet/minecraft/class_1844;method_65361(I)Iofficial aLdcg;a(I)I
-
getName
- Mappings:
Namespace Name Mixin selector named getNameLnet/minecraft/component/type/PotionContentsComponent;getName(Ljava/lang/String;)Lnet/minecraft/text/Text;intermediary method_64195Lnet/minecraft/class_1844;method_64195(Ljava/lang/String;)Lnet/minecraft/class_2561;official aLdcg;a(Ljava/lang/String;)Lxg;
-
mixColors
- Mappings:
Namespace Name Mixin selector named mixColorsLnet/minecraft/component/type/PotionContentsComponent;mixColors(Ljava/lang/Iterable;)Ljava/util/OptionalInt;intermediary method_58111Lnet/minecraft/class_1844;method_58111(Ljava/lang/Iterable;)Ljava/util/OptionalInt;official aLdcg;a(Ljava/lang/Iterable;)Ljava/util/OptionalInt;
-
hasEffects
public boolean hasEffects()- Mappings:
Namespace Name Mixin selector named hasEffectsLnet/minecraft/component/type/PotionContentsComponent;hasEffects()Zintermediary method_57405Lnet/minecraft/class_1844;method_57405()Zofficial cLdcg;c()Z
-
customEffects
Returns the value of thecustomEffectsrecord component.- Returns:
- the value of the
customEffectsrecord component
-
apply
- Mappings:
Namespace Name Mixin selector named applyLnet/minecraft/component/type/PotionContentsComponent;apply(Lnet/minecraft/entity/LivingEntity;F)Vintermediary method_62839Lnet/minecraft/class_1844;method_62839(Lnet/minecraft/class_1309;F)Vofficial aLdcg;a(Lbyf;F)V
-
buildTooltip
public static void buildTooltip(Iterable<StatusEffectInstance> effects, Consumer<Text> textConsumer, float durationMultiplier, float tickRate) - Mappings:
Namespace Name Mixin selector named buildTooltipLnet/minecraft/component/type/PotionContentsComponent;buildTooltip(Ljava/lang/Iterable;Ljava/util/function/Consumer;FF)Vintermediary method_8065Lnet/minecraft/class_1844;method_8065(Ljava/lang/Iterable;Ljava/util/function/Consumer;FF)Vofficial aLdcg;a(Ljava/lang/Iterable;Ljava/util/function/Consumer;FF)V
-
getEffectText
- Mappings:
Namespace Name Mixin selector named getEffectTextLnet/minecraft/component/type/PotionContentsComponent;getEffectText(Lnet/minecraft/registry/entry/RegistryEntry;I)Lnet/minecraft/text/MutableText;intermediary method_66698Lnet/minecraft/class_1844;method_66698(Lnet/minecraft/class_6880;I)Lnet/minecraft/class_5250;official aLdcg;a(Ljg;I)Lxu;
-
onConsume
public void onConsume(World world, LivingEntity user, ItemStack stack, ConsumableComponent consumable) - Specified by:
onConsumein interfaceConsumable- Mappings:
Namespace Name Mixin selector named onConsumeLnet/minecraft/component/type/Consumable;onConsume(Lnet/minecraft/world/World;Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/item/ItemStack;Lnet/minecraft/component/type/ConsumableComponent;)Vintermediary method_62831Lnet/minecraft/class_10127;method_62831(Lnet/minecraft/class_1937;Lnet/minecraft/class_1309;Lnet/minecraft/class_1799;Lnet/minecraft/class_10124;)Vofficial aLdcq;a(Ldkj;Lbyf;Ldak;Ldcp;)V
-
appendTooltip
public void appendTooltip(Item.TooltipContext context, Consumer<Text> textConsumer, TooltipType type, ComponentsAccess components) - Specified by:
appendTooltipin interfaceTooltipAppender- Mappings:
Namespace Name Mixin selector named appendTooltipLnet/minecraft/item/tooltip/TooltipAppender;appendTooltip(Lnet/minecraft/item/Item$TooltipContext;Ljava/util/function/Consumer;Lnet/minecraft/item/tooltip/TooltipType;Lnet/minecraft/component/ComponentsAccess;)Vintermediary method_57409Lnet/minecraft/class_9299;method_57409(Lnet/minecraft/class_1792$class_9635;Ljava/util/function/Consumer;Lnet/minecraft/class_1836;Lnet/minecraft/class_9473;)Vofficial aLddp;a(Ldag$b;Ljava/util/function/Consumer;Ldbz;Lkg;)V
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
potion
Returns the value of thepotionrecord component.- Returns:
- the value of the
potionrecord component
-
customColor
Returns the value of thecustomColorrecord component.- Returns:
- the value of the
customColorrecord component
-
customName
Returns the value of thecustomNamerecord component.- Returns:
- the value of the
customNamerecord component
-