Class MUTED_SPEECH
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
-
Field Summary
Fields inherited from class net.pottercraft.ollivanders2.effect.O2Effect
affectedPlayerText, duration, effectType, informousText, kill, legilimensText, p, permanent, targetID -
Constructor Summary
ConstructorsConstructorDescriptionMUTED_SPEECH(@NotNull Ollivanders2 plugin, int duration, boolean isPermanent, @NotNull UUID pid) Constructor for creating a muted speech effect. -
Method Summary
Modifier and TypeMethodDescriptionvoidAge the muted speech effect each game tick.voiddoRemove()Perform cleanup when the muted speech effect is removed.Methods inherited from class net.pottercraft.ollivanders2.effect.O2Effect
age, getAffectedPlayerText, getInformousText, getLegilimensText, getMaxDuration, getMinDuration, getRemainingDuration, getTargetID, isKilled, isPermanent, kill, setPermanent
-
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 pluginduration- the duration of the muted speech effect in game ticksisPermanent- 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:
checkEffectin classO2Effect
-
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.
-