Class ServerMessageEvent

java.lang.Object
me.internalizable.numdrassl.api.event.server.ServerMessageEvent
All Implemented Interfaces:
Cancellable

public class ServerMessageEvent extends Object implements Cancellable
Event fired when the server sends a chat/system message to a player. This event is fired BEFORE the message is delivered to the client.

This event is cancellable. If cancelled, the message will not be shown to the player.

  • Constructor Details

  • Method Details

    • getPlayer

      @Nonnull public Player getPlayer()
      Get the player receiving the message.
      Returns:
      the player
    • getType

      @Nonnull public ServerMessageEvent.MessageType getType()
      Get the type of message.
      Returns:
      the message type
    • getMessage

      @Nonnull public String getMessage()
      Get the message content.
      Returns:
      the message
    • setMessage

      public void setMessage(@Nonnull String message)
      Set the message content.
      Parameters:
      message - the new message
    • isCancelled

      public boolean isCancelled()
      Description copied from interface: Cancellable
      Check if this event has been cancelled.
      Specified by:
      isCancelled in interface Cancellable
      Returns:
      true if the event is cancelled
    • setCancelled

      public void setCancelled(boolean cancelled)
      Description copied from interface: Cancellable
      Set whether this event is cancelled.
      Specified by:
      setCancelled in interface Cancellable
      Parameters:
      cancelled - true to cancel the event