Class TICKLING

java.lang.Object
net.pottercraft.ollivanders2.effect.O2Effect
net.pottercraft.ollivanders2.effect.TICKLING

public class TICKLING extends O2Effect
Tickling effect that forces the affected player into a continuous sneak state.

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".

  • 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 plugin
      duration - the duration of the tickling effect in game ticks
      isPermanent - 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: O2Effect
      Execute 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:
      checkEffect in class O2Effect
    • doRemove

      public void doRemove()
      Description copied from class: O2Effect
      Perform 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.

      Specified by:
      doRemove in class O2Effect