Package org.bukkit.event.player
Class PlayerChatEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
org.bukkit.event.player.PlayerChatEvent
- All Implemented Interfaces:
Cancellable
@Deprecated public class PlayerChatEvent extends PlayerEvent implements Cancellable
Deprecated.
This event will fire from the main thread and allows the use of
all of the Bukkit API, unlike the
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.
Holds information for player chat and commands
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
Constructors Constructor Description PlayerChatEvent(Player player, String message)Deprecated.PlayerChatEvent(Player player, String message, String format, Set<Player> recipients)Deprecated. -
Method Summary
Modifier and Type Method Description StringgetFormat()Deprecated.Gets the format to use to display this chat messagestatic HandlerListgetHandlerList()Deprecated.HandlerListgetHandlers()Deprecated.StringgetMessage()Deprecated.Gets the message that the player is attempting to sendSet<Player>getRecipients()Deprecated.Gets a set of recipients that this chat message will be displayed tobooleanisCancelled()Deprecated.Gets the cancellation state of this event.voidsetCancelled(boolean cancel)Deprecated.Sets the cancellation state of this event.voidsetFormat(String format)Deprecated.Sets the format to use to display this chat messagevoidsetMessage(String message)Deprecated.Sets the message that the player will sendvoidsetPlayer(Player player)Deprecated.Sets the player that this message will display as, or command will be executed as
-
Constructor Details
-
Method Details
-
isCancelled
public boolean isCancelled()Deprecated.Description copied from interface:CancellableGets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins- Specified by:
isCancelledin interfaceCancellable- Returns:
- true if this event is cancelled
-
setCancelled
public void setCancelled(boolean cancel)Deprecated.Description copied from interface:CancellableSets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.- Specified by:
setCancelledin interfaceCancellable- Parameters:
cancel- true if you wish to cancel this event
-
getMessage
Deprecated.Gets the message that the player is attempting to send- Returns:
- Message the player is attempting to send
-
setMessage
Deprecated.Sets the message that the player will send- Parameters:
message- New message that the player will send
-
setPlayer
Deprecated.Sets the player that this message will display as, or command will be executed as- Parameters:
player- New player which this event will execute as
-
getFormat
Deprecated.Gets the format to use to display this chat message- Returns:
- String.Format compatible format string
-
setFormat
Deprecated.Sets the format to use to display this chat message- Parameters:
format- String.Format compatible format string
-
getRecipients
Deprecated.Gets a set of recipients that this chat message will be displayed to- Returns:
- All Players who will see this chat message
-
getHandlers
Deprecated.- Specified by:
getHandlersin classEvent
-
getHandlerList
Deprecated.
-