Class AsyncPlayerChatEvent
- All Implemented Interfaces:
- Cancellable
- Direct Known Subclasses:
- AsyncPlayerChatPreviewEvent
The constructor provides a boolean to indicate if the event was fired synchronously or asynchronously. When asynchronous, this event can be called from any thread, sans the main thread, and has limited access to the API.
If a player is the direct cause of this event by an incoming packet, this event will be asynchronous. If a plugin triggers this event by compelling a player to chat, this event will be synchronous.
 Care should be taken to check Event.isAsynchronous() and treat the event
 appropriately.
- 
Nested Class SummaryNested classes/interfaces inherited from class org.bukkit.event.EventEvent.Result
- 
Field SummaryFields inherited from class org.bukkit.event.player.PlayerEventplayer
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionDeprecated.Gets the format to use to display this chat message.static @NotNull HandlerListDeprecated.Deprecated.Deprecated.Gets the message that the player is attempting to send.Deprecated.Gets a set of recipients that this chat message will be displayed to.booleanDeprecated.Gets the cancellation state of this event.voidsetCancelled(boolean cancel) Deprecated.Sets the cancellation state of this event.voidDeprecated.Sets the format to use to display this chat message.voidsetMessage(@NotNull String message) Deprecated.Sets the message that the player will send.Methods inherited from class org.bukkit.event.player.PlayerEventgetPlayerMethods inherited from class org.bukkit.event.EventcallEvent, getEventName, isAsynchronous
- 
Constructor Details- 
AsyncPlayerChatEventpublic AsyncPlayerChatEvent(boolean async, @NotNull @NotNull Player who, @NotNull @NotNull String message, @NotNull @NotNull Set<Player> players) Deprecated.- Parameters:
- async- This changes the event to a synchronous state.
- who- the chat sender
- message- the message sent
- players- the players to receive the message. This may be a lazy or unmodifiable collection.
 
 
- 
- 
Method Details- 
getMessageDeprecated.Gets the message that the player is attempting to send. This message will be used withgetFormat().- Returns:
- Message the player is attempting to send
 
- 
setMessageDeprecated.Sets the message that the player will send. This message will be used withgetFormat().- Parameters:
- message- New message that the player will send
 
- 
getFormatDeprecated.Gets the format to use to display this chat message.When this event finishes execution, the first format parameter is the Player.getDisplayName()and the second parameter isgetMessage()- Returns:
- String.format(String, Object...)compatible format string
 
- 
setFormatpublic void setFormat(@NotNull @NotNull String format) throws IllegalFormatException, NullPointerException Deprecated.Sets the format to use to display this chat message.When this event finishes execution, the first format parameter is the Player.getDisplayName()and the second parameter isgetMessage()- Parameters:
- format-- String.format(String, Object...)compatible format string
- Throws:
- IllegalFormatException- if the underlying API throws the exception
- NullPointerException- if format is null
- See Also:
 
- 
getRecipientsDeprecated.Gets a set of recipients that this chat message will be displayed to.The set returned is not guaranteed to be mutable and may auto-populate on access. Any listener accessing the returned set should be aware that it may reduce performance for a lazy set implementation. Listeners should be aware that modifying the list may throw UnsupportedOperationExceptionif the event caller provides an unmodifiable set.- Returns:
- All Players who will see this chat message
 
- 
isCancelledpublic 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 interface- Cancellable
- Returns:
- true if this event is cancelled
 
- 
setCancelledpublic 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 interface- Cancellable
- Parameters:
- cancel- true if you wish to cancel this event
 
- 
getHandlersDeprecated.- Specified by:
- getHandlersin class- Event
 
- 
getHandlerListDeprecated.
 
- 
AsyncChatEventinstead