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
-
Field Summary
Modifier and TypeFieldDescriptionstatic final BinaryTagSerializer
<CustomPotionEffect> static final NetworkBuffer.Type
<CustomPotionEffect> -
Constructor Summary
ConstructorDescriptionCustomPotionEffect
(@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
-
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 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
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 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
-