Package net.minecraft.component.type
Record Class PotionContentsComponent
java.lang.Object
java.lang.Record
net.minecraft.component.type.PotionContentsComponent
- Record Components:
potion-customColor-customEffects-
public record PotionContentsComponent(Optional<RegistryEntry<Potion>> potion, Optional<Integer> customColor, List<StatusEffectInstance> customEffects)
extends Record
- Mappings:
Namespace Name official ctqintermediary net/minecraft/class_1844named net/minecraft/component/type/PotionContentsComponentofficial eintermediary comp_2378named potionofficial fintermediary comp_2379named customColorofficial gintermediary comp_2380named customEffects
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<PotionContentsComponent> The field for thecustomColorrecord component.private final List<StatusEffectInstance> The field for thecustomEffectsrecord component.static final PotionContentsComponentprivate static final intstatic final intprivate static final com.mojang.serialization.Codec<PotionContentsComponent> private static final Textstatic final PacketCodec<RegistryByteBuf, PotionContentsComponent> private final Optional<RegistryEntry<Potion>> The field for thepotionrecord component.private static final int -
Constructor Summary
ConstructorsConstructorDescriptionPotionContentsComponent(Optional<RegistryEntry<Potion>> optional, Optional<Integer> optional2, List<StatusEffectInstance> list) PotionContentsComponent(RegistryEntry<Potion> potion) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidbuildTooltip(Iterable<StatusEffectInstance> effects, Consumer<Text> textConsumer, float durationMultiplier, float tickRate) voidbuildTooltip(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.final booleanIndicates whether some other object is "equal to" this one.voidforEachEffect(Consumer<StatusEffectInstance> effectConsumer) intgetColor()static intgetColor(Iterable<StatusEffectInstance> effects) static intgetColor(RegistryEntry<Potion> potion) intbooleanfinal inthashCode()Returns a hash code value for this object.booleanmatches(RegistryEntry<Potion> potion) static intmethod_58111(Iterable<StatusEffectInstance> iterable) 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. -
DEFAULT
- Mappings:
Namespace Name Mixin selector official aLctq;a:Lctq;intermediary field_49274Lnet/minecraft/class_1844;field_49274:Lnet/minecraft/class_1844;named DEFAULTLnet/minecraft/component/type/PotionContentsComponent;DEFAULT:Lnet/minecraft/component/type/PotionContentsComponent;
-
NONE_TEXT
- Mappings:
Namespace Name Mixin selector official hLctq;h:Lwi;intermediary field_25817Lnet/minecraft/class_1844;field_25817:Lnet/minecraft/class_2561;named NONE_TEXTLnet/minecraft/component/type/PotionContentsComponent;NONE_TEXT:Lnet/minecraft/text/Text;
-
UNCRAFTABLE_COLOR
private static final int UNCRAFTABLE_COLOR- See Also:
- Mappings:
Namespace Name Mixin selector official iLctq;i:Iintermediary field_30946Lnet/minecraft/class_1844;field_30946:Inamed UNCRAFTABLE_COLORLnet/minecraft/component/type/PotionContentsComponent;UNCRAFTABLE_COLOR:I
-
EFFECTLESS_COLOR
private static final int EFFECTLESS_COLOR- See Also:
- Mappings:
Namespace Name Mixin selector official jLctq;j:Iintermediary field_49277Lnet/minecraft/class_1844;field_49277:Inamed EFFECTLESS_COLORLnet/minecraft/component/type/PotionContentsComponent;EFFECTLESS_COLOR:I
-
field_49748
public static final int field_49748- See Also:
- Mappings:
Namespace Name Mixin selector official bLctq;b:Iintermediary field_49748Lnet/minecraft/class_1844;field_49748:Inamed field_49748Lnet/minecraft/component/type/PotionContentsComponent;field_49748:I
-
field_49749
- Mappings:
Namespace Name Mixin selector official kLctq;k:Lcom/mojang/serialization/Codec;intermediary field_49749Lnet/minecraft/class_1844;field_49749:Lcom/mojang/serialization/Codec;named field_49749Lnet/minecraft/component/type/PotionContentsComponent;field_49749:Lcom/mojang/serialization/Codec;
-
CODEC
- Mappings:
Namespace Name Mixin selector official cLctq;c:Lcom/mojang/serialization/Codec;intermediary field_49275Lnet/minecraft/class_1844;field_49275:Lcom/mojang/serialization/Codec;named CODECLnet/minecraft/component/type/PotionContentsComponent;CODEC:Lcom/mojang/serialization/Codec;
-
PACKET_CODEC
- Mappings:
Namespace Name Mixin selector official dLctq;d:Lyg;intermediary field_49276Lnet/minecraft/class_1844;field_49276:Lnet/minecraft/class_9139;named PACKET_CODECLnet/minecraft/component/type/PotionContentsComponent;PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;
-
-
Constructor Details
-
PotionContentsComponent
- Mappings:
Namespace Name Mixin selector official <init>Lctq;<init>(Lin;)Vintermediary <init>Lnet/minecraft/class_1844;<init>(Lnet/minecraft/class_6880;)Vnamed <init>Lnet/minecraft/component/type/PotionContentsComponent;<init>(Lnet/minecraft/registry/entry/RegistryEntry;)V
-
PotionContentsComponent
public PotionContentsComponent(Optional<RegistryEntry<Potion>> optional, Optional<Integer> optional2, List<StatusEffectInstance> list)
-
-
Method Details
-
createStack
- Mappings:
Namespace Name Mixin selector official aLctq;a(Lcrn;Lin;)Lcrs;intermediary method_57400Lnet/minecraft/class_1844;method_57400(Lnet/minecraft/class_1792;Lnet/minecraft/class_6880;)Lnet/minecraft/class_1799;named createStackLnet/minecraft/component/type/PotionContentsComponent;createStack(Lnet/minecraft/item/Item;Lnet/minecraft/registry/entry/RegistryEntry;)Lnet/minecraft/item/ItemStack;
-
matches
- Mappings:
Namespace Name Mixin selector official aLctq;a(Lin;)Zintermediary method_57401Lnet/minecraft/class_1844;method_57401(Lnet/minecraft/class_6880;)Znamed matchesLnet/minecraft/component/type/PotionContentsComponent;matches(Lnet/minecraft/registry/entry/RegistryEntry;)Z
-
getEffects
- Mappings:
Namespace Name Mixin selector official aLctq;a()Ljava/lang/Iterable;intermediary method_57397Lnet/minecraft/class_1844;method_57397()Ljava/lang/Iterable;named getEffectsLnet/minecraft/component/type/PotionContentsComponent;getEffects()Ljava/lang/Iterable;
-
forEachEffect
- Mappings:
Namespace Name Mixin selector official aLctq;a(Ljava/util/function/Consumer;)Vintermediary method_57402Lnet/minecraft/class_1844;method_57402(Ljava/util/function/Consumer;)Vnamed forEachEffectLnet/minecraft/component/type/PotionContentsComponent;forEachEffect(Ljava/util/function/Consumer;)V
-
with
- Mappings:
Namespace Name Mixin selector official bLctq;b(Lin;)Lctq;intermediary method_57403Lnet/minecraft/class_1844;method_57403(Lnet/minecraft/class_6880;)Lnet/minecraft/class_1844;named withLnet/minecraft/component/type/PotionContentsComponent;with(Lnet/minecraft/registry/entry/RegistryEntry;)Lnet/minecraft/component/type/PotionContentsComponent;
-
with
- Mappings:
Namespace Name Mixin selector official aLctq;a(Lbpm;)Lctq;intermediary method_57398Lnet/minecraft/class_1844;method_57398(Lnet/minecraft/class_1293;)Lnet/minecraft/class_1844;named withLnet/minecraft/component/type/PotionContentsComponent;with(Lnet/minecraft/entity/effect/StatusEffectInstance;)Lnet/minecraft/component/type/PotionContentsComponent;
-
getColor
public int getColor()- Mappings:
Namespace Name Mixin selector official bLctq;b()Iintermediary method_8064Lnet/minecraft/class_1844;method_8064()Inamed getColorLnet/minecraft/component/type/PotionContentsComponent;getColor()I
-
getCustomColor
public int getCustomColor()- Mappings:
Namespace Name Mixin selector official cLctq;c()Iintermediary method_57404Lnet/minecraft/class_1844;method_57404()Inamed getCustomColorLnet/minecraft/component/type/PotionContentsComponent;getCustomColor()I
-
getColor
- Mappings:
Namespace Name Mixin selector official cLctq;c(Lin;)Iintermediary method_8062Lnet/minecraft/class_1844;method_8062(Lnet/minecraft/class_6880;)Inamed getColorLnet/minecraft/component/type/PotionContentsComponent;getColor(Lnet/minecraft/registry/entry/RegistryEntry;)I
-
getColor
- Mappings:
Namespace Name Mixin selector official aLctq;a(Ljava/lang/Iterable;)Iintermediary method_8055Lnet/minecraft/class_1844;method_8055(Ljava/lang/Iterable;)Inamed getColorLnet/minecraft/component/type/PotionContentsComponent;getColor(Ljava/lang/Iterable;)I
-
method_58111
- Mappings:
Namespace Name Mixin selector official bLctq;b(Ljava/lang/Iterable;)Iintermediary method_58111Lnet/minecraft/class_1844;method_58111(Ljava/lang/Iterable;)Inamed method_58111Lnet/minecraft/component/type/PotionContentsComponent;method_58111(Ljava/lang/Iterable;)I
-
hasEffects
public boolean hasEffects()- Mappings:
Namespace Name Mixin selector official dLctq;d()Zintermediary method_57405Lnet/minecraft/class_1844;method_57405()Znamed hasEffectsLnet/minecraft/component/type/PotionContentsComponent;hasEffects()Z
-
customEffects
Returns the value of thecustomEffectsrecord component.- Returns:
- the value of the
customEffectsrecord component
-
buildTooltip
- Mappings:
Namespace Name Mixin selector official aLctq;a(Ljava/util/function/Consumer;FF)Vintermediary method_47372Lnet/minecraft/class_1844;method_47372(Ljava/util/function/Consumer;FF)Vnamed buildTooltipLnet/minecraft/component/type/PotionContentsComponent;buildTooltip(Ljava/util/function/Consumer;FF)V
-
buildTooltip
public static void buildTooltip(Iterable<StatusEffectInstance> effects, Consumer<Text> textConsumer, float durationMultiplier, float tickRate) - Mappings:
Namespace Name Mixin selector official aLctq;a(Ljava/lang/Iterable;Ljava/util/function/Consumer;FF)Vintermediary method_8065Lnet/minecraft/class_1844;method_8065(Ljava/lang/Iterable;Ljava/util/function/Consumer;FF)Vnamed buildTooltipLnet/minecraft/component/type/PotionContentsComponent;buildTooltip(Ljava/lang/Iterable;Ljava/util/function/Consumer;FF)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
-