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 ClassesModifier and TypeClassDescriptionstatic enumIdentifies the source of a staff chat message.Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionStaffChatMessageEvent(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 TypeMethodDescriptionstatic @NotNull org.bukkit.event.HandlerListReturns this event's handler list.@NotNull org.bukkit.event.HandlerList@NotNull net.kyori.adventure.text.ComponentReturns the message that Plex will send.@Nullable org.bukkit.command.CommandSenderReturns the player or console that sent the message.@NotNull StaffChatMessageEvent.SourceReturns how the message entered staff chat.booleanvoidsetCancelled(boolean cancelled) voidsetMessage(@NotNull net.kyori.adventure.text.Component message) Replaces the message Plex will deliver.Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
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 messagemessage- message to be deliveredsource- source of the messageasync- 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
Returns how the message entered staff chat.- Returns:
- message source
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceorg.bukkit.event.Cancellable
-
setCancelled
public void setCancelled(boolean cancelled) - Specified by:
setCancelledin interfaceorg.bukkit.event.Cancellable
-
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlersin classorg.bukkit.event.Event
-
getHandlerList
@NotNull public static @NotNull org.bukkit.event.HandlerList getHandlerList()Returns this event's handler list.- Returns:
- handler list
-