AsyncPlayerChatEvent.
Listening to this event forces chat to wait for the main thread which
causes delays for chat. AsyncPlayerChatEvent is the encouraged
alternative for thread safe implementations.
@Deprecated public class PlayerChatEvent extends PlayerEvent implements Cancellable
Event.Resultplayer| Constructor and Description |
|---|
PlayerChatEvent(@NotNull Player player,
@NotNull String message)
Deprecated.
|
PlayerChatEvent(@NotNull Player player,
@NotNull String message,
@NotNull String format,
@NotNull Set<Player> recipients)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
@NotNull String |
getFormat()
Deprecated.
Gets the format to use to display this chat message
|
static @NotNull HandlerList |
getHandlerList()
Deprecated.
|
@NotNull HandlerList |
getHandlers()
Deprecated.
|
@NotNull String |
getMessage()
Deprecated.
Gets the message that the player is attempting to send
|
@NotNull Set<Player> |
getRecipients()
Deprecated.
Gets a set of recipients that this chat message will be displayed to
|
boolean |
isCancelled()
Deprecated.
Gets the cancellation state of this event.
|
void |
setCancelled(boolean cancel)
Deprecated.
Sets the cancellation state of this event.
|
void |
setFormat(@NotNull String format)
Deprecated.
Sets the format to use to display this chat message
|
void |
setMessage(@NotNull String message)
Deprecated.
Sets the message that the player will send
|
void |
setPlayer(@NotNull Player player)
Deprecated.
Sets the player that this message will display as, or command will be
executed as
|
getPlayercallEvent, getEventName, isAsynchronouspublic PlayerChatEvent(@NotNull @NotNull Player player, @NotNull @NotNull String message)
public boolean isCancelled()
CancellableisCancelled in interface Cancellablepublic void setCancelled(boolean cancel)
CancellablesetCancelled in interface Cancellablecancel - true if you wish to cancel this event@NotNull public @NotNull String getMessage()
public void setMessage(@NotNull @NotNull String message)
message - New message that the player will sendpublic void setPlayer(@NotNull @NotNull Player player)
player - New player which this event will execute as@NotNull public @NotNull String getFormat()
public void setFormat(@NotNull @NotNull String format)
format - String.Format compatible format string@NotNull public @NotNull Set<Player> getRecipients()
@NotNull public @NotNull HandlerList getHandlers()
getHandlers in class Event@NotNull public static @NotNull HandlerList getHandlerList()
Copyright © 2021. All rights reserved.