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 cuy
intermediary net/minecraft/class_1844
named net/minecraft/component/type/PotionContentsComponent
official e
intermediary comp_2378
named potion
official f
intermediary comp_2379
named customColor
official g
intermediary comp_2380
named customEffects
  • Field Details

    • potion

      private final Optional<RegistryEntry<Potion>> potion
      The field for the potion record component.
    • customColor

      private final Optional<Integer> customColor
      The field for the customColor record component.
    • customEffects

      private final List<StatusEffectInstance> customEffects
      The field for the customEffects record component.
    • DEFAULT

      public static final PotionContentsComponent DEFAULT
      Mappings:
      Namespace Name Mixin selector
      official a Lcuy;a:Lcuy;
      intermediary field_49274 Lnet/minecraft/class_1844;field_49274:Lnet/minecraft/class_1844;
      named DEFAULT Lnet/minecraft/component/type/PotionContentsComponent;DEFAULT:Lnet/minecraft/component/type/PotionContentsComponent;
    • NONE_TEXT

      private static final Text NONE_TEXT
      Mappings:
      Namespace Name Mixin selector
      official h Lcuy;h:Lwu;
      intermediary field_25817 Lnet/minecraft/class_1844;field_25817:Lnet/minecraft/class_2561;
      named NONE_TEXT Lnet/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 i Lcuy;i:I
      intermediary field_30946 Lnet/minecraft/class_1844;field_30946:I
      named UNCRAFTABLE_COLOR Lnet/minecraft/component/type/PotionContentsComponent;UNCRAFTABLE_COLOR:I
    • EFFECTLESS_COLOR

      private static final int EFFECTLESS_COLOR
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official j Lcuy;j:I
      intermediary field_49277 Lnet/minecraft/class_1844;field_49277:I
      named EFFECTLESS_COLOR Lnet/minecraft/component/type/PotionContentsComponent;EFFECTLESS_COLOR:I
    • field_49748

      public static final int field_49748
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official b Lcuy;b:I
      intermediary field_49748 Lnet/minecraft/class_1844;field_49748:I
      named field_49748 Lnet/minecraft/component/type/PotionContentsComponent;field_49748:I
    • BASE_CODEC

      private static final com.mojang.serialization.Codec<PotionContentsComponent> BASE_CODEC
      Mappings:
      Namespace Name Mixin selector
      official k Lcuy;k:Lcom/mojang/serialization/Codec;
      intermediary field_49749 Lnet/minecraft/class_1844;field_49749:Lcom/mojang/serialization/Codec;
      named BASE_CODEC Lnet/minecraft/component/type/PotionContentsComponent;BASE_CODEC:Lcom/mojang/serialization/Codec;
    • CODEC

      public static final com.mojang.serialization.Codec<PotionContentsComponent> CODEC
      Mappings:
      Namespace Name Mixin selector
      official c Lcuy;c:Lcom/mojang/serialization/Codec;
      intermediary field_49275 Lnet/minecraft/class_1844;field_49275:Lcom/mojang/serialization/Codec;
      named CODEC Lnet/minecraft/component/type/PotionContentsComponent;CODEC:Lcom/mojang/serialization/Codec;
    • PACKET_CODEC

      public static final PacketCodec<RegistryByteBuf,PotionContentsComponent> PACKET_CODEC
      Mappings:
      Namespace Name Mixin selector
      official d Lcuy;d:Lys;
      intermediary field_49276 Lnet/minecraft/class_1844;field_49276:Lnet/minecraft/class_9139;
      named PACKET_CODEC Lnet/minecraft/component/type/PotionContentsComponent;PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;
  • Constructor Details

    • PotionContentsComponent

      public PotionContentsComponent(RegistryEntry<Potion> potion)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lcuy;<init>(Liw;)V
      intermediary <init> Lnet/minecraft/class_1844;<init>(Lnet/minecraft/class_6880;)V
      named <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

      public static ItemStack createStack(Item item, RegistryEntry<Potion> potion)
      Mappings:
      Namespace Name Mixin selector
      official a Lcuy;a(Lcsu;Liw;)Lcsz;
      intermediary method_57400 Lnet/minecraft/class_1844;method_57400(Lnet/minecraft/class_1792;Lnet/minecraft/class_6880;)Lnet/minecraft/class_1799;
      named createStack Lnet/minecraft/component/type/PotionContentsComponent;createStack(Lnet/minecraft/item/Item;Lnet/minecraft/registry/entry/RegistryEntry;)Lnet/minecraft/item/ItemStack;
    • matches

      public boolean matches(RegistryEntry<Potion> potion)
      Mappings:
      Namespace Name Mixin selector
      official a Lcuy;a(Liw;)Z
      intermediary method_57401 Lnet/minecraft/class_1844;method_57401(Lnet/minecraft/class_6880;)Z
      named matches Lnet/minecraft/component/type/PotionContentsComponent;matches(Lnet/minecraft/registry/entry/RegistryEntry;)Z
    • getEffects

      public Iterable<StatusEffectInstance> getEffects()
      Mappings:
      Namespace Name Mixin selector
      official a Lcuy;a()Ljava/lang/Iterable;
      intermediary method_57397 Lnet/minecraft/class_1844;method_57397()Ljava/lang/Iterable;
      named getEffects Lnet/minecraft/component/type/PotionContentsComponent;getEffects()Ljava/lang/Iterable;
    • forEachEffect

      public void forEachEffect(Consumer<StatusEffectInstance> effectConsumer)
      Mappings:
      Namespace Name Mixin selector
      official a Lcuy;a(Ljava/util/function/Consumer;)V
      intermediary method_57402 Lnet/minecraft/class_1844;method_57402(Ljava/util/function/Consumer;)V
      named forEachEffect Lnet/minecraft/component/type/PotionContentsComponent;forEachEffect(Ljava/util/function/Consumer;)V
    • with

      Mappings:
      Namespace Name Mixin selector
      official b Lcuy;b(Liw;)Lcuy;
      intermediary method_57403 Lnet/minecraft/class_1844;method_57403(Lnet/minecraft/class_6880;)Lnet/minecraft/class_1844;
      named with Lnet/minecraft/component/type/PotionContentsComponent;with(Lnet/minecraft/registry/entry/RegistryEntry;)Lnet/minecraft/component/type/PotionContentsComponent;
    • with

      public PotionContentsComponent with(StatusEffectInstance customEffect)
      Mappings:
      Namespace Name Mixin selector
      official a Lcuy;a(Lbqt;)Lcuy;
      intermediary method_57398 Lnet/minecraft/class_1844;method_57398(Lnet/minecraft/class_1293;)Lnet/minecraft/class_1844;
      named with Lnet/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 b Lcuy;b()I
      intermediary method_8064 Lnet/minecraft/class_1844;method_8064()I
      named getColor Lnet/minecraft/component/type/PotionContentsComponent;getColor()I
    • getCustomColor

      public int getCustomColor()
      Mappings:
      Namespace Name Mixin selector
      official c Lcuy;c()I
      intermediary method_57404 Lnet/minecraft/class_1844;method_57404()I
      named getCustomColor Lnet/minecraft/component/type/PotionContentsComponent;getCustomColor()I
    • getColor

      public static int getColor(RegistryEntry<Potion> potion)
      Mappings:
      Namespace Name Mixin selector
      official c Lcuy;c(Liw;)I
      intermediary method_8062 Lnet/minecraft/class_1844;method_8062(Lnet/minecraft/class_6880;)I
      named getColor Lnet/minecraft/component/type/PotionContentsComponent;getColor(Lnet/minecraft/registry/entry/RegistryEntry;)I
    • getColor

      public static int getColor(Iterable<StatusEffectInstance> effects)
      Mappings:
      Namespace Name Mixin selector
      official a Lcuy;a(Ljava/lang/Iterable;)I
      intermediary method_8055 Lnet/minecraft/class_1844;method_8055(Ljava/lang/Iterable;)I
      named getColor Lnet/minecraft/component/type/PotionContentsComponent;getColor(Ljava/lang/Iterable;)I
    • mixColors

      public static int mixColors(Iterable<StatusEffectInstance> effects)
      Mappings:
      Namespace Name Mixin selector
      official b Lcuy;b(Ljava/lang/Iterable;)I
      intermediary method_58111 Lnet/minecraft/class_1844;method_58111(Ljava/lang/Iterable;)I
      named mixColors Lnet/minecraft/component/type/PotionContentsComponent;mixColors(Ljava/lang/Iterable;)I
    • hasEffects

      public boolean hasEffects()
      Mappings:
      Namespace Name Mixin selector
      official d Lcuy;d()Z
      intermediary method_57405 Lnet/minecraft/class_1844;method_57405()Z
      named hasEffects Lnet/minecraft/component/type/PotionContentsComponent;hasEffects()Z
    • customEffects

      public List<StatusEffectInstance> customEffects()
      Returns the value of the customEffects record component.
      Returns:
      the value of the customEffects record component
    • buildTooltip

      public void buildTooltip(Consumer<Text> textConsumer, float durationMultiplier, float tickRate)
      Mappings:
      Namespace Name Mixin selector
      official a Lcuy;a(Ljava/util/function/Consumer;FF)V
      intermediary method_47372 Lnet/minecraft/class_1844;method_47372(Ljava/util/function/Consumer;FF)V
      named buildTooltip Lnet/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 a Lcuy;a(Ljava/lang/Iterable;Ljava/util/function/Consumer;FF)V
      intermediary method_8065 Lnet/minecraft/class_1844;method_8065(Ljava/lang/Iterable;Ljava/util/function/Consumer;FF)V
      named buildTooltip Lnet/minecraft/component/type/PotionContentsComponent;buildTooltip(Ljava/lang/Iterable;Ljava/util/function/Consumer;FF)V
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object object)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      object - the object with which to compare
      Returns:
      true if this object is the same as the object argument; false otherwise.
    • potion

      public Optional<RegistryEntry<Potion>> potion()
      Returns the value of the potion record component.
      Returns:
      the value of the potion record component
    • customColor

      public Optional<Integer> customColor()
      Returns the value of the customColor record component.
      Returns:
      the value of the customColor record component