Package net.minestom.server.potion
Record Class CustomPotionEffect
java.lang.Object
java.lang.Record
net.minestom.server.potion.CustomPotionEffect
public record CustomPotionEffect(@NotNull PotionEffect id, @NotNull CustomPotionEffect.Settings settings)
extends Record
Represents a custom effect in
ItemComponent.POTION_CONTENTS.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BinaryTagSerializer<CustomPotionEffect> static final NetworkBuffer.Type<CustomPotionEffect> -
Constructor Summary
ConstructorsConstructorDescriptionCustomPotionEffect(@NotNull PotionEffect id, int amplifier, int duration, boolean isAmbient, boolean showParticles, boolean showIcon) CustomPotionEffect(@NotNull PotionEffect id, @NotNull CustomPotionEffect.Settings settings) Creates an instance of aCustomPotionEffectrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintintduration()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull PotionEffectid()Returns the value of theidrecord component.boolean@NotNull CustomPotionEffect.Settingssettings()Returns the value of thesettingsrecord component.booleanshowIcon()booleanfinal StringtoString()Returns a string representation of this record class.
-
Field Details
-
NETWORK_TYPE
-
NBT_TYPE
-
-
Constructor Details
-
CustomPotionEffect
public CustomPotionEffect(@NotNull @NotNull PotionEffect id, int amplifier, int duration, boolean isAmbient, boolean showParticles, boolean showIcon) -
CustomPotionEffect
public CustomPotionEffect(@NotNull @NotNull PotionEffect id, @NotNull @NotNull CustomPotionEffect.Settings settings) Creates an instance of aCustomPotionEffectrecord class.- Parameters:
id- the value for theidrecord componentsettings- the value for thesettingsrecord component
-
-
Method Details
-
amplifier
public int amplifier() -
duration
public int duration() -
isAmbient
public boolean isAmbient() -
showParticles
public boolean showParticles() -
showIcon
public boolean showIcon() -
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). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
settings
Returns the value of thesettingsrecord component.- Returns:
- the value of the
settingsrecord component
-