Class MUTED_SPEECH

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

public class MUTED_SPEECH extends O2Effect
Speech suppression effect that prevents the affected player from chatting.

MUTED_SPEECH is a debilitating effect that silences the target player by preventing them from sending any chat messages. All chat events from the muted player are cancelled, preventing their messages from being delivered to the server or other players. The effect is detectable by both mind-reading spells (Legilimens) and information spells (Informous) which report the target "is unable to speak". The player receives an affectation notification of "You feel tongue-tied." when the effect is applied.

Mechanism:

  • Blocks all player chat messages through AsyncPlayerChatEvent cancellation
  • Player cannot communicate via chat while muted
  • Detectable by both mind-reading spells (Legilimens) and information spells (Informous)
  • Detection text: "is unable to speak"
  • Player affectation text: "You feel tongue-tied."
  • Effect expires naturally when duration reaches zero
  • Constructor Details

    • MUTED_SPEECH

      public MUTED_SPEECH(@NotNull @NotNull Ollivanders2 plugin, int duration, boolean isPermanent, @NotNull @NotNull UUID pid)
      Constructor for creating a muted speech effect.

      Creates an effect that prevents the target player from sending any chat messages. Sets detection text for both mind-reading spells (Legilimens) and information spells (Informous) to "is unable to speak", and notifies the player "You feel tongue-tied." when the effect is applied.

      Parameters:
      plugin - a callback to the MC plugin
      duration - the duration of the muted speech effect in game ticks
      isPermanent - is this effect permanent (does not age)
      pid - the unique ID of the player to mute
  • Method Details

    • checkEffect

      public void checkEffect()
      Age the muted speech effect each game tick.

      Called each game tick. This effect tracks its remaining duration. Chat message blocking is handled through event cancellation in the doOnAsyncPlayerChatEvent() method. When the duration reaches zero, the effect is automatically killed and removed from the player.

      Specified by:
      checkEffect in class O2Effect
    • doRemove

      public void doRemove()
      Perform cleanup when the muted speech effect is removed.

      The default implementation does nothing, as the muted speech effect has no persistent state to clean up. When removed, the player regains normal chat ability.

      Specified by:
      doRemove in class O2Effect