Record Class EntityEffect.ApplyPotionEffect
java.lang.Object
java.lang.Record
net.minestom.server.item.enchant.EntityEffect.ApplyPotionEffect
- All Implemented Interfaces:
Enchantment.Effect
,EntityEffect
,LocationEffect
- Enclosing interface:
EntityEffect
public static record EntityEffect.ApplyPotionEffect(@NotNull RegistryTag<PotionEffect> toApply, @NotNull LevelBasedValue minDuration, @NotNull LevelBasedValue maxDuration, @NotNull LevelBasedValue minAmplifier, @NotNull LevelBasedValue maxAmplifier)
extends Record
implements EntityEffect, LocationEffect
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minestom.server.item.enchant.EntityEffect
EntityEffect.AllOf, EntityEffect.ApplyPotionEffect, EntityEffect.ChangeItemDamage, EntityEffect.DamageEntity, EntityEffect.Explode, EntityEffect.Ignite, EntityEffect.PlaySound, EntityEffect.ReplaceBlock, EntityEffect.ReplaceDisc, EntityEffect.RunFunction, EntityEffect.SetBlockProperties, EntityEffect.SpawnParticles, EntityEffect.SummonEntity
Nested classes/interfaces inherited from interface net.minestom.server.item.enchant.LocationEffect
LocationEffect.AllOf
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionApplyPotionEffect
(@NotNull RegistryTag<PotionEffect> toApply, @NotNull LevelBasedValue minDuration, @NotNull LevelBasedValue maxDuration, @NotNull LevelBasedValue minAmplifier, @NotNull LevelBasedValue maxAmplifier) Creates an instance of aApplyPotionEffect
record class. -
Method Summary
Modifier and TypeMethodDescription@NotNull StructCodec
<EntityEffect.ApplyPotionEffect> codec()
final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.@NotNull LevelBasedValue
Returns the value of themaxAmplifier
record component.@NotNull LevelBasedValue
Returns the value of themaxDuration
record component.@NotNull LevelBasedValue
Returns the value of theminAmplifier
record component.@NotNull LevelBasedValue
Returns the value of theminDuration
record component.@NotNull RegistryTag
<PotionEffect> toApply()
Returns the value of thetoApply
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
CODEC
-
-
Constructor Details
-
ApplyPotionEffect
public ApplyPotionEffect(@NotNull @NotNull RegistryTag<PotionEffect> toApply, @NotNull @NotNull LevelBasedValue minDuration, @NotNull @NotNull LevelBasedValue maxDuration, @NotNull @NotNull LevelBasedValue minAmplifier, @NotNull @NotNull LevelBasedValue maxAmplifier) Creates an instance of aApplyPotionEffect
record class.- Parameters:
toApply
- the value for thetoApply
record componentminDuration
- the value for theminDuration
record componentmaxDuration
- the value for themaxDuration
record componentminAmplifier
- the value for theminAmplifier
record componentmaxAmplifier
- the value for themaxAmplifier
record component
-
-
Method Details
-
codec
- Specified by:
codec
in interfaceEntityEffect
- Specified by:
codec
in interfaceLocationEffect
-
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)
. -
toApply
Returns the value of thetoApply
record component.- Returns:
- the value of the
toApply
record component
-
minDuration
Returns the value of theminDuration
record component.- Returns:
- the value of the
minDuration
record component
-
maxDuration
Returns the value of themaxDuration
record component.- Returns:
- the value of the
maxDuration
record component
-
minAmplifier
Returns the value of theminAmplifier
record component.- Returns:
- the value of the
minAmplifier
record component
-
maxAmplifier
Returns the value of themaxAmplifier
record component.- Returns:
- the value of the
maxAmplifier
record component
-