Class PlayerChatEvent
java.lang.Object
me.internalizable.numdrassl.api.event.player.PlayerChatEvent
- All Implemented Interfaces:
Cancellable
Event fired when a player sends a chat message.
This is fired BEFORE the message is sent to the server.
This event is cancellable. If cancelled, the chat message will not be sent.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the chat message.Get the player who sent the message.booleanCheck if this event has been cancelled.booleanCheck if this is a command (starts with /).voidsetCancelled(boolean cancelled) Set whether this event is cancelled.voidsetMessage(String message) Set the chat message.
-
Constructor Details
-
PlayerChatEvent
-
-
Method Details
-
getPlayer
-
getMessage
-
setMessage
Set the chat message. This allows plugins to modify the message before it's sent.- Parameters:
message- the new message
-
isCommand
public boolean isCommand()Check if this is a command (starts with /).- Returns:
- true if this is a command
-
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
-