Class ServerMessageEvent
java.lang.Object
me.internalizable.numdrassl.api.event.server.ServerMessageEvent
- All Implemented Interfaces:
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumType of server message. -
Constructor Summary
ConstructorsConstructorDescriptionServerMessageEvent(Player player, ServerMessageEvent.MessageType type, String message) -
Method Summary
Modifier and TypeMethodDescriptionGet the message content.Get the player receiving the message.getType()Get the type of message.booleanCheck if this event has been cancelled.voidsetCancelled(boolean cancelled) Set whether this event is cancelled.voidsetMessage(String message) Set the message content.
-
Constructor Details
-
ServerMessageEvent
public ServerMessageEvent(@Nonnull Player player, @Nonnull ServerMessageEvent.MessageType type, @Nullable String message)
-
-
Method Details
-
getPlayer
-
getType
Get the type of message.- Returns:
- the message type
-
getMessage
-
setMessage
Set the message content.- Parameters:
message- the new message
-
isCancelled
public boolean isCancelled()Description copied from interface:CancellableCheck if this event has been cancelled.- Specified by:
isCancelledin interfaceCancellable- Returns:
- true if the event is cancelled
-
setCancelled
public void setCancelled(boolean cancelled) Description copied from interface:CancellableSet whether this event is cancelled.- Specified by:
setCancelledin interfaceCancellable- Parameters:
cancelled- true to cancel the event
-