Record Class CustomPotionEffect
java.lang.Object
java.lang.Record
net.minestom.server.potion.CustomPotionEffect
public record CustomPotionEffect(PotionEffect id, CustomPotionEffect.Settings settings)
extends Record
Represents a custom effect in
DataComponents.POTION_CONTENTS.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<CustomPotionEffect> static final NetworkBuffer.Type<CustomPotionEffect> -
Constructor Summary
ConstructorsConstructorDescriptionCustomPotionEffect(PotionEffect id, int amplifier, int duration, boolean isAmbient, boolean showParticles, boolean showIcon) CustomPotionEffect(PotionEffect id, 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.id()Returns the value of theidrecord component.booleansettings()Returns the value of thesettingsrecord component.booleanshowIcon()booleanfinal StringtoString()Returns a string representation of this record class.
-
Field Details
-
NETWORK_TYPE
-
CODEC
-
-
Constructor Details
-
CustomPotionEffect
public CustomPotionEffect(PotionEffect id, int amplifier, int duration, boolean isAmbient, boolean showParticles, boolean showIcon) -
CustomPotionEffect
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
-
hashCode
-
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
-