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
DataComponents.POTION_CONTENTS
.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec
<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 aCustomPotionEffect
record class. -
Method Summary
Modifier and TypeMethodDescriptionint
int
duration()
final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.@NotNull PotionEffect
id()
Returns the value of theid
record component.boolean
@NotNull CustomPotionEffect.Settings
settings()
Returns the value of thesettings
record component.boolean
showIcon()
boolean
final String
toString()
Returns a string representation of this record class.
-
Field Details
-
NETWORK_TYPE
-
CODEC
-
-
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 aCustomPotionEffect
record class.- Parameters:
id
- the value for theid
record componentsettings
- the value for thesettings
record 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 theid
record component.- Returns:
- the value of the
id
record component
-
settings
Returns the value of thesettings
record component.- Returns:
- the value of the
settings
record component
-