Package net.minestom.server.item.enchant
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 ObjectSet<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.SummonEntityNested classes/interfaces inherited from interface net.minestom.server.item.enchant.LocationEffect
LocationEffect.AllOf -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionApplyPotionEffect(@NotNull ObjectSet<PotionEffect> toApply, @NotNull LevelBasedValue minDuration, @NotNull LevelBasedValue maxDuration, @NotNull LevelBasedValue minAmplifier, @NotNull LevelBasedValue maxAmplifier) Creates an instance of aApplyPotionEffectrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull StructCodec<EntityEffect.ApplyPotionEffect> codec()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull LevelBasedValueReturns the value of themaxAmplifierrecord component.@NotNull LevelBasedValueReturns the value of themaxDurationrecord component.@NotNull LevelBasedValueReturns the value of theminAmplifierrecord component.@NotNull LevelBasedValueReturns the value of theminDurationrecord component.@NotNull ObjectSet<PotionEffect> toApply()Returns the value of thetoApplyrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
-
Constructor Details
-
ApplyPotionEffect
public ApplyPotionEffect(@NotNull @NotNull ObjectSet<PotionEffect> toApply, @NotNull @NotNull LevelBasedValue minDuration, @NotNull @NotNull LevelBasedValue maxDuration, @NotNull @NotNull LevelBasedValue minAmplifier, @NotNull @NotNull LevelBasedValue maxAmplifier) Creates an instance of aApplyPotionEffectrecord class.- Parameters:
toApply- the value for thetoApplyrecord componentminDuration- the value for theminDurationrecord componentmaxDuration- the value for themaxDurationrecord componentminAmplifier- the value for theminAmplifierrecord componentmaxAmplifier- the value for themaxAmplifierrecord component
-
-
Method Details
-
codec
- Specified by:
codecin interfaceEntityEffect- Specified by:
codecin interfaceLocationEffect
-
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). -
toApply
Returns the value of thetoApplyrecord component.- Returns:
- the value of the
toApplyrecord component
-
minDuration
Returns the value of theminDurationrecord component.- Returns:
- the value of the
minDurationrecord component
-
maxDuration
Returns the value of themaxDurationrecord component.- Returns:
- the value of the
maxDurationrecord component
-
minAmplifier
Returns the value of theminAmplifierrecord component.- Returns:
- the value of the
minAmplifierrecord component
-
maxAmplifier
Returns the value of themaxAmplifierrecord component.- Returns:
- the value of the
maxAmplifierrecord component
-