Enum Class O2EffectType
- All Implemented Interfaces:
Serializable,Comparable<O2EffectType>,Constable
O2EffectType defines every magical effect that can be applied to players, from beneficial effects (HEAL, LUCK, NIGHT_VISION) to harmful effects (POISON, HARM, WEAKNESS) to utility effects (FLYING, PROTECTION). Each effect type maps to:
- An O2Effect implementation class used for instantiation via reflection
- A MagicLevel indicating the spell's difficulty and for counter-spell matching
- An enabled flag allowing runtime configuration of which effects are active
Effects are created by spells and divination, managed by O2Effects, and applied to players through the effect system. Each effect type has a corresponding O2Effect subclass that implements the specific behavior of that effect.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Method Summary
Modifier and TypeMethodDescription@NotNull Class<?> Get the O2Effect implementation class for this effect type.@NotNull MagicLevelgetLevel()Get the magic level (difficulty) of this effect.intGet the maximum duration, in ticks, for this effect typeintGet the minimum duration, in ticks, for this effect typebooleanCheck whether this effect type is currently enabled.voidsetEnabled(boolean enabled) Enable or disable this effect type at runtime.static O2EffectTypeReturns the enum constant of this class with the specified name.static O2EffectType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
AGGRESSION
-
ANIMAGUS_EFFECT
-
ANIMAGUS_INCANTATION
-
AWAKE
-
AWAKE_ANTIDOTE_LESSER
-
BABBLING
-
BABBLING_ANTIDOTE_LESSER
-
BLINDNESS
-
BROOM_FLYING
-
BURNING
-
CONFUSION
-
DANCING_FEET
-
FAST_LEARNING
-
FIRE_RESISTANCE
-
FLAGRANTE_BURNING
-
FLYING
-
FUMOS
-
FUMOS_DUO
-
HARM
-
HARM_ANTIDOTE_LESSER
-
HEAL
-
HEALTH_BOOST
-
HIGHER_SKILL
-
HUNGER
-
IMMOBILIZE
-
IMPROVED_BOOK_LEARNING
-
LAUGHING
-
LUCK
-
LYCANTHROPY
-
LYCANTHROPY_RELIEF
-
LYCANTHROPY_SPEECH
-
MUCUS
-
MUTED_SPEECH
-
NIGHT_VISION
-
POISON
-
POISON_ANTIDOTE_LESSER
-
PROTEGO
-
REGENERATION
-
SATIATION
-
SHRINKING
-
SLEEP_SPEECH
-
SLEEPING
-
SLOWNESS
-
SPEED
-
SPEED_SPEEDIER
-
SPEED_SPEEDIEST
-
STRENGTH
-
SUSPENSION
-
SWELLING
-
TICKLING
-
UNLUCK
-
UNLUCK_ANTIDOTE_LESSER
-
WATER_BREATHING
-
WEAKNESS
-
WEALTH
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getClassName
Get the O2Effect implementation class for this effect type.The returned class is used with reflection to dynamically instantiate the correct effect object when the effect is applied to a player. See O2Effects.addEffect() and O2Prophecy.fulfill() for usage examples.
- Returns:
- the O2Effect subclass for this effect type
-
getLevel
Get the magic level (difficulty) of this effect.The magic level is used to match effects with appropriate counter-spells and antidotes. For example, an antidote's level must be >= the effect's level to successfully neutralize it.
- Returns:
- the magic level of this effect
-
getMinDuration
public int getMinDuration()Get the minimum duration, in ticks, for this effect type- Returns:
- the minimum duration
-
getMaxDuration
public int getMaxDuration()Get the maximum duration, in ticks, for this effect type- Returns:
- the maximum duration
-
isEnabled
public boolean isEnabled()Check whether this effect type is currently enabled.Disabled effects cannot be applied to players. Effects can be disabled via server configuration (e.g., setting enableLycanthropy to false in the config).
- Returns:
- true if the effect is enabled and can be applied, false if disabled
-
setEnabled
public void setEnabled(boolean enabled) Enable or disable this effect type at runtime.Disabled effects cannot be applied to players via spells or divination. This setting can be changed dynamically without restarting the server.
- Parameters:
enabled- true to enable the effect, false to disable it
-