Class PreChatEvent

All Implemented Interfaces:
CancellableEvent, ChatPluginEvent, ChatPluginPlayerEvent, ChatPluginServerPlayerEvent

public class PreChatEvent extends PublicMessageEvent implements CancellableEvent
Represents an event called before a player's message gets processed.
  • Constructor Details

    • PreChatEvent

      public PreChatEvent(ChatPluginServerPlayer player, String message, boolean global)
      Constructs a new pre chat event.
      Parameters:
      player - Player involved
      message - Message involved
      global - Whether the message is global
  • Method Details

    • isCancelled

      public boolean isCancelled()
      Description copied from interface: CancellableEvent
      Checks if this event has been cancelled and will not be executed.
      Specified by:
      isCancelled in interface CancellableEvent
      Returns:
      Whether this event is cancelled
    • setCancelled

      public void setCancelled(boolean cancelled)
      Description copied from interface: CancellableEvent
      Sets the cancellation state of this event.

      It will be passed through other registered listeners even if it is cancelled, but it will not be executed.

      Specified by:
      setCancelled in interface CancellableEvent
      Parameters:
      cancelled - Whether this event should be cancelled