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
public record PotionContentsComponent(Optional<RegistryEntry<Potion>> potion, Optional<Integer> customColor, List<StatusEffectInstance> customEffects, Optional<String> customName)
extends Record
implements Consumable
- Mappings:
- Namespace - Name - named - net/minecraft/component/type/PotionContentsComponent- intermediary - net/minecraft/class_1844- official - cyp- named - potion- intermediary - comp_2378- official - e- named - customColor- intermediary - comp_2379- official - f- named - customEffects- intermediary - comp_2380- official - g- named - customName- intermediary - comp_3209- official - h
- 
Field SummaryFieldsModifier 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 SummaryConstructorsConstructorDescriptionPotionContentsComponent(Optional<RegistryEntry<Potion>> optional, Optional<Integer> optional2, List<StatusEffectInstance> list, Optional<String> optional3) PotionContentsComponent(RegistryEntry<Potion> potion) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidapply(LivingEntity user) static 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.Returns the value of thecustomNamerecord component.final booleanIndicates whether some other object is "equal to" this one.voidforEachEffect(Consumer<StatusEffectInstance> effectConsumer) intgetColor()intgetColor(int defaultColor) 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- 
potionThe field for thepotionrecord component.
- 
customColorThe field for thecustomColorrecord component.
- 
customEffectsThe field for thecustomEffectsrecord component.
- 
customNameThe field for thecustomNamerecord component.
- 
DEFAULT- Mappings:
- Namespace - Name - Mixin selector - named - DEFAULT- Lnet/minecraft/component/type/PotionContentsComponent;DEFAULT:Lnet/minecraft/component/type/PotionContentsComponent;- intermediary - field_49274- Lnet/minecraft/class_1844;field_49274:Lnet/minecraft/class_1844;- official - a- Lcyp;a:Lcyp;
 
- 
NONE_TEXT- Mappings:
- Namespace - Name - Mixin selector - named - NONE_TEXT- Lnet/minecraft/component/type/PotionContentsComponent;NONE_TEXT:Lnet/minecraft/text/Text;- intermediary - field_25817- Lnet/minecraft/class_1844;field_25817:Lnet/minecraft/class_2561;- official - i- Lcyp;i:Lwp;
 
- 
EFFECTLESS_COLORpublic static final int EFFECTLESS_COLOR- See Also:
- Mappings:
- Namespace - Name - Mixin selector - named - EFFECTLESS_COLOR- Lnet/minecraft/component/type/PotionContentsComponent;EFFECTLESS_COLOR:I- intermediary - field_49277- Lnet/minecraft/class_1844;field_49277:I- official - b- Lcyp;b:I
 
- 
BASE_CODEC- Mappings:
- Namespace - Name - Mixin selector - named - BASE_CODEC- Lnet/minecraft/component/type/PotionContentsComponent;BASE_CODEC:Lcom/mojang/serialization/Codec;- intermediary - field_49749- Lnet/minecraft/class_1844;field_49749:Lcom/mojang/serialization/Codec;- official - j- Lcyp;j:Lcom/mojang/serialization/Codec;
 
- 
CODEC- Mappings:
- Namespace - Name - Mixin selector - named - CODEC- Lnet/minecraft/component/type/PotionContentsComponent;CODEC:Lcom/mojang/serialization/Codec;- intermediary - field_49275- Lnet/minecraft/class_1844;field_49275:Lcom/mojang/serialization/Codec;- official - c- Lcyp;c:Lcom/mojang/serialization/Codec;
 
- 
PACKET_CODEC- Mappings:
- Namespace - Name - Mixin selector - named - PACKET_CODEC- Lnet/minecraft/component/type/PotionContentsComponent;PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;- intermediary - field_49276- Lnet/minecraft/class_1844;field_49276:Lnet/minecraft/class_9139;- official - d- Lcyp;d:Lyn;
 
 
- 
- 
Constructor Details- 
PotionContentsComponent- Mappings:
- Namespace - Name - Mixin selector - named - <init>- Lnet/minecraft/component/type/PotionContentsComponent;<init>(Lnet/minecraft/registry/entry/RegistryEntry;)V- intermediary - <init>- Lnet/minecraft/class_1844;<init>(Lnet/minecraft/class_6880;)V- official - <init>- Lcyp;<init>(Ljr;)V
 
- 
PotionContentsComponentpublic PotionContentsComponent(Optional<RegistryEntry<Potion>> optional, Optional<Integer> optional2, List<StatusEffectInstance> list, Optional<String> optional3) 
 
- 
- 
Method Details- 
createStack- Mappings:
- Namespace - Name - Mixin selector - named - createStack- Lnet/minecraft/component/type/PotionContentsComponent;createStack(Lnet/minecraft/item/Item;Lnet/minecraft/registry/entry/RegistryEntry;)Lnet/minecraft/item/ItemStack;- intermediary - method_57400- Lnet/minecraft/class_1844;method_57400(Lnet/minecraft/class_1792;Lnet/minecraft/class_6880;)Lnet/minecraft/class_1799;- official - a- Lcyp;a(Lcwm;Ljr;)Lcwq;
 
- 
matches- Mappings:
- Namespace - Name - Mixin selector - named - matches- Lnet/minecraft/component/type/PotionContentsComponent;matches(Lnet/minecraft/registry/entry/RegistryEntry;)Z- intermediary - method_57401- Lnet/minecraft/class_1844;method_57401(Lnet/minecraft/class_6880;)Z- official - a- Lcyp;a(Ljr;)Z
 
- 
getEffects- Mappings:
- Namespace - Name - Mixin selector - named - getEffects- Lnet/minecraft/component/type/PotionContentsComponent;getEffects()Ljava/lang/Iterable;- intermediary - method_57397- Lnet/minecraft/class_1844;method_57397()Ljava/lang/Iterable;- official - a- Lcyp;a()Ljava/lang/Iterable;
 
- 
forEachEffect- Mappings:
- Namespace - Name - Mixin selector - named - forEachEffect- Lnet/minecraft/component/type/PotionContentsComponent;forEachEffect(Ljava/util/function/Consumer;)V- intermediary - method_57402- Lnet/minecraft/class_1844;method_57402(Ljava/util/function/Consumer;)V- official - a- Lcyp;a(Ljava/util/function/Consumer;)V
 
- 
with- Mappings:
- Namespace - Name - Mixin selector - named - with- Lnet/minecraft/component/type/PotionContentsComponent;with(Lnet/minecraft/registry/entry/RegistryEntry;)Lnet/minecraft/component/type/PotionContentsComponent;- intermediary - method_57403- Lnet/minecraft/class_1844;method_57403(Lnet/minecraft/class_6880;)Lnet/minecraft/class_1844;- official - b- Lcyp;b(Ljr;)Lcyp;
 
- 
with- Mappings:
- Namespace - Name - Mixin selector - named - with- Lnet/minecraft/component/type/PotionContentsComponent;with(Lnet/minecraft/entity/effect/StatusEffectInstance;)Lnet/minecraft/component/type/PotionContentsComponent;- intermediary - method_57398- Lnet/minecraft/class_1844;method_57398(Lnet/minecraft/class_1293;)Lnet/minecraft/class_1844;- official - a- Lcyp;a(Lbtr;)Lcyp;
 
- 
getColorpublic int getColor()- Mappings:
- Namespace - Name - Mixin selector - named - getColor- Lnet/minecraft/component/type/PotionContentsComponent;getColor()I- intermediary - method_8064- Lnet/minecraft/class_1844;method_8064()I- official - b- Lcyp;b()I
 
- 
getColorpublic int getColor(int defaultColor) - Mappings:
- Namespace - Name - Mixin selector - named - getColor- Lnet/minecraft/component/type/PotionContentsComponent;getColor(I)I- intermediary - method_65361- Lnet/minecraft/class_1844;method_65361(I)I- official - a- Lcyp;a(I)I
 
- 
getName- Mappings:
- Namespace - Name - Mixin selector - named - getName- Lnet/minecraft/component/type/PotionContentsComponent;getName(Ljava/lang/String;)Lnet/minecraft/text/Text;- intermediary - method_64195- Lnet/minecraft/class_1844;method_64195(Ljava/lang/String;)Lnet/minecraft/class_2561;- official - a- Lcyp;a(Ljava/lang/String;)Lwp;
 
- 
mixColors- Mappings:
- Namespace - Name - Mixin selector - named - mixColors- Lnet/minecraft/component/type/PotionContentsComponent;mixColors(Ljava/lang/Iterable;)Ljava/util/OptionalInt;- intermediary - method_58111- Lnet/minecraft/class_1844;method_58111(Ljava/lang/Iterable;)Ljava/util/OptionalInt;- official - a- Lcyp;a(Ljava/lang/Iterable;)Ljava/util/OptionalInt;
 
- 
hasEffectspublic boolean hasEffects()- Mappings:
- Namespace - Name - Mixin selector - named - hasEffects- Lnet/minecraft/component/type/PotionContentsComponent;hasEffects()Z- intermediary - method_57405- Lnet/minecraft/class_1844;method_57405()Z- official - c- Lcyp;c()Z
 
- 
customEffectsReturns the value of thecustomEffectsrecord component.- Returns:
- the value of the customEffectsrecord component
 
- 
buildTooltip- Mappings:
- Namespace - Name - Mixin selector - named - buildTooltip- Lnet/minecraft/component/type/PotionContentsComponent;buildTooltip(Ljava/util/function/Consumer;FF)V- intermediary - method_47372- Lnet/minecraft/class_1844;method_47372(Ljava/util/function/Consumer;FF)V- official - a- Lcyp;a(Ljava/util/function/Consumer;FF)V
 
- 
apply- Mappings:
- Namespace - Name - Mixin selector - named - apply- Lnet/minecraft/component/type/PotionContentsComponent;apply(Lnet/minecraft/entity/LivingEntity;)V- intermediary - method_62839- Lnet/minecraft/class_1844;method_62839(Lnet/minecraft/class_1309;)V- official - a- Lcyp;a(Lbvi;)V
 
- 
buildTooltippublic static void buildTooltip(Iterable<StatusEffectInstance> effects, Consumer<Text> textConsumer, float durationMultiplier, float tickRate) - Mappings:
- Namespace - Name - Mixin selector - named - buildTooltip- Lnet/minecraft/component/type/PotionContentsComponent;buildTooltip(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- official - a- Lcyp;a(Ljava/lang/Iterable;Ljava/util/function/Consumer;FF)V
 
- 
onConsumepublic void onConsume(World world, LivingEntity user, ItemStack stack, ConsumableComponent consumable) - Specified by:
- onConsumein interface- Consumable
- Mappings:
- Namespace - Name - Mixin selector - named - onConsume- Lnet/minecraft/component/type/Consumable;onConsume(Lnet/minecraft/world/World;Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/item/ItemStack;Lnet/minecraft/component/type/ConsumableComponent;)V- intermediary - method_62831- Lnet/minecraft/class_10127;method_62831(Lnet/minecraft/class_1937;Lnet/minecraft/class_1309;Lnet/minecraft/class_1799;Lnet/minecraft/class_10124;)V- official - a- Lcyx;a(Ldgj;Lbvi;Lcwq;Lcyw;)V
 
- 
toStringReturns 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.
- 
hashCodepublic 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.
- 
equalsIndicates 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).
- 
potionReturns the value of thepotionrecord component.- Returns:
- the value of the potionrecord component
 
- 
customColorReturns the value of thecustomColorrecord component.- Returns:
- the value of the customColorrecord component
 
- 
customNameReturns the value of thecustomNamerecord component.- Returns:
- the value of the customNamerecord component
 
 
-