Class AsyncChatDecorateEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.server.ServerEvent
io.papermc.paper.event.player.AsyncChatDecorateEvent
- All Implemented Interfaces:
Cancellable
- Direct Known Subclasses:
AsyncChatCommandDecorateEvent
@Experimental
@NullMarked
public class AsyncChatDecorateEvent
extends ServerEvent
implements Cancellable
This event is fired when the server decorates a component for chat purposes. This is called
before
See
AsyncChatEvent and the other chat events. It is recommended that you modify the
message here, and use the chat events for modifying receivers and later the chat type. If you
want to keep the message as "signed" for the clients who get it, be sure to include the entire
original message somewhere in the final message.
See
AsyncChatCommandDecorateEvent for the decoration of messages sent via commands-
Nested Class Summary
Nested classes/interfaces inherited from class Event
Event.Result -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic HandlerListbooleanGets the cancellation state of this event.Gets the original decoration inputplayer()Gets the player (if available) associated with this event.result()Gets the decoration result.voidSets the resulting decorated component.voidsetCancelled(boolean cancel) A cancelled decorating event means that no changes to the result component will have any effect.Methods inherited from class Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
AsyncChatDecorateEvent
-
-
Method Details
-
player
-
originalMessage
-
result
Gets the decoration result. This may already be different fromoriginalMessage()if some other listener to this event changed the result.- Returns:
- the result
-
result
Sets the resulting decorated component.- Parameters:
result- the result
-
isCancelled
public boolean isCancelled()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:
trueif this event is cancelled
-
setCancelled
public void setCancelled(boolean cancel) A cancelled decorating event means that no changes to the result component will have any effect. The decorated component will be equal to the original component.- Specified by:
setCancelledin interfaceCancellable- Parameters:
cancel-trueif you wish to cancel this event
-
getHandlers
- Specified by:
getHandlersin classEvent
-
getHandlerList
-