public final class PlayerChatEvent extends PlayerEvent implements Cancellable
PlayerPrivateMessageEvent,
PlayerCommandEvent| Constructor and Description |
|---|
PlayerChatEvent(Player player,
java.lang.String chatName,
java.lang.String chatMessage) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getChatMessage()
Gets the chat message.
|
java.lang.String |
getPlayerChatName()
Gets the full player name (including all prefixes and color codes [if set]) in the chat.
|
boolean |
isCancelled()
Determines if the event is cancelled.
|
void |
setCancelled(boolean cancel)
Cancels this event.
|
void |
setChatMessage(java.lang.String message)
Sets the chat message.
|
void |
setPlayerChatName(java.lang.String newName)
Sets the player name in chat.
|
getPlayerpublic PlayerChatEvent(Player player, java.lang.String chatName, java.lang.String chatMessage)
public void setChatMessage(java.lang.String message)
message - the new message.public java.lang.String getChatMessage()
public void setPlayerChatName(java.lang.String newName)
getPlayerChatName()newName - the new player chat name (only relevant for this chat message / event)public java.lang.String getPlayerChatName()
public boolean isCancelled()
CancellableisCancelled in interface Cancellablepublic void setCancelled(boolean cancel)
CancellablesetCancelled in interface Cancellablecancel - set to true if you want to cancel this event.