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 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
  • Constructor Details

  • Method Details

    • player

      public @Nullable Player player()
      Gets the player (if available) associated with this event.

      Certain commands request decorations without a player context which is why this is possibly null.

      Returns:
      the player or null
    • originalMessage

      public Component originalMessage()
      Gets the original decoration input
      Returns:
      the input
    • result

      public Component result()
      Gets the decoration result. This may already be different from originalMessage() if some other listener to this event changed the result.
      Returns:
      the result
    • result

      public void result(Component result)
      Sets the resulting decorated component.
      Parameters:
      result - the result
    • isCancelled

      public boolean isCancelled()
      Description copied from interface: Cancellable
      Gets 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:
      isCancelled in interface Cancellable
      Returns:
      true if 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:
      setCancelled in interface Cancellable
      Parameters:
      cancel - true if you wish to cancel this event
    • getHandlers

      public HandlerList getHandlers()
      Specified by:
      getHandlers in class Event
    • getHandlerList

      public static HandlerList getHandlerList()