Class StaffChatMessageEvent

java.lang.Object
org.bukkit.event.Event
dev.plex.api.event.StaffChatMessageEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable

public final class StaffChatMessageEvent extends org.bukkit.event.Event implements org.bukkit.event.Cancellable
Fires before Plex sends a local staff chat message.

This event applies to staff chat mode and to the /adminchat <message> command. It does not apply to messages from other servers.

This event can run asynchronously. Check Event.isAsynchronous() before you use APIs that require a server or region thread.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Identifies the source of a staff chat message.

    Nested classes/interfaces inherited from class org.bukkit.event.Event

    org.bukkit.event.Event.Result
  • Constructor Summary

    Constructors
    Constructor
    Description
    StaffChatMessageEvent(net.kyori.adventure.text.Component message, StaffChatMessageEvent.Source source, boolean async)
     
    StaffChatMessageEvent(@NotNull org.bukkit.command.CommandSender sender, @NotNull net.kyori.adventure.text.Component message, @NotNull StaffChatMessageEvent.Source source, boolean async)
    Creates a staff-chat message event.
  • Method Summary

    Modifier and Type
    Method
    Description
    static @NotNull org.bukkit.event.HandlerList
    Returns this event's handler list.
    @NotNull org.bukkit.event.HandlerList
     
    @NotNull net.kyori.adventure.text.Component
    Returns the message that Plex will send.
    @Nullable org.bukkit.command.CommandSender
    Returns the player or console that sent the message.
    Returns how the message entered staff chat.
    boolean
     
    void
    setCancelled(boolean cancelled)
     
    void
    setMessage(@NotNull net.kyori.adventure.text.Component message)
    Replaces the message Plex will deliver.

    Methods inherited from class org.bukkit.event.Event

    callEvent, getEventName, isAsynchronous

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • StaffChatMessageEvent

      public StaffChatMessageEvent(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull net.kyori.adventure.text.Component message, @NotNull @NotNull StaffChatMessageEvent.Source source, boolean async)
      Creates a staff-chat message event.
      Parameters:
      sender - sender of the message
      message - message to be delivered
      source - source of the message
      async - whether the event is asynchronous
    • StaffChatMessageEvent

      public StaffChatMessageEvent(net.kyori.adventure.text.Component message, StaffChatMessageEvent.Source source, boolean async)
  • Method Details

    • getSender

      @Nullable public @Nullable org.bukkit.command.CommandSender getSender()
      Returns the player or console that sent the message.
      Returns:
      message sender
    • getMessage

      @NotNull public @NotNull net.kyori.adventure.text.Component getMessage()
      Returns the message that Plex will send.
      Returns:
      staff-chat message
    • setMessage

      public void setMessage(@NotNull @NotNull net.kyori.adventure.text.Component message)
      Replaces the message Plex will deliver.
      Parameters:
      message - replacement message
    • getSource

      @NotNull public @NotNull StaffChatMessageEvent.Source getSource()
      Returns how the message entered staff chat.
      Returns:
      message source
    • isCancelled

      public boolean isCancelled()
      Specified by:
      isCancelled in interface org.bukkit.event.Cancellable
    • setCancelled

      public void setCancelled(boolean cancelled)
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable
    • getHandlers

      @NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()
      Specified by:
      getHandlers in class org.bukkit.event.Event
    • getHandlerList

      @NotNull public static @NotNull org.bukkit.event.HandlerList getHandlerList()
      Returns this event's handler list.
      Returns:
      handler list