Class TICKLING
TICKLING is a debilitating effect that causes the target player to be overcome with tickling, forcing them to crouch (sneak) continuously. The player is forced into a sneak state and cannot toggle out of it while the effect is active. Any attempts to stop sneaking are cancelled. When the effect expires, the player is restored to normal standing state. The effect is detectable by both mind-reading spells (Legilimens) and information spells (Informous) which report the target "is doubled-over from tickling".
-
Field Summary
Fields inherited from class net.pottercraft.ollivanders2.effect.O2Effect
affectedPlayerText, duration, effectType, informousText, kill, legilimensText, p, permanent, targetID -
Constructor Summary
ConstructorsConstructorDescriptionTICKLING(@NotNull Ollivanders2 plugin, int duration, boolean isPermanent, @NotNull UUID pid) Constructor for creating a tickling effect. -
Method Summary
Modifier and TypeMethodDescriptionvoidExecute this effect's behavior for the current game tick.voiddoRemove()Perform cleanup when this effect is removed from the player.Methods inherited from class net.pottercraft.ollivanders2.effect.O2Effect
age, getAffectedPlayerText, getInformousText, getLegilimensText, getMaxDuration, getMinDuration, getRemainingDuration, getTargetID, isKilled, isPermanent, kill, setPermanent
-
Constructor Details
-
TICKLING
public TICKLING(@NotNull @NotNull Ollivanders2 plugin, int duration, boolean isPermanent, @NotNull @NotNull UUID pid) Constructor for creating a tickling effect.Creates a tickling effect that forces the target player into a sneak state. The sneak state is applied with a 5-tick delay to ensure proper initialization. Detection text is set for information spells and player notifications are configured. If the player is offline when the effect is created, the effect is immediately terminated.
- Parameters:
plugin- a callback to the MC pluginduration- the duration of the tickling effect in game ticksisPermanent- is this effect permanent (does not age)pid- the unique ID of the player to tickle
-
-
Method Details
-
checkEffect
public void checkEffect()Description copied from class:O2EffectExecute this effect's behavior for the current game tick.This method is called once per game tick for active effects on a player. Subclasses should override this method to implement the effect's specific behavior (e.g., applying potion effects, restricting actions, modifying movement, etc.). Subclasses should call age() in this method to ensure the effect ages and eventually expires.
Implementation Note: This method is called within the main server thread on each tick. Keep execution time short to avoid lag.
- Specified by:
checkEffectin classO2Effect
-
doRemove
public void doRemove()Description copied from class:O2EffectPerform cleanup when this effect is removed from the player.Called when the effect is about to be removed from the player's effect list (either due to expiration, being killed, or a player logout). Subclasses should override this method to undo any permanent changes made by the effect, such as removing potion effects, restoring abilities, or updating the player's state.
-