Cancellablepublic class BroadcastMessageEvent extends ServerEvent implements Cancellable
Server.broadcast(String, String).
This event behaves similarly to AsyncPlayerChatEvent in that it
should be async if fired from an async thread. Please see that event for
further information.Event.Result| Constructor | Description |
|---|---|
BroadcastMessageEvent(boolean isAsync,
String message,
Set<CommandSender> recipients) |
|
BroadcastMessageEvent(String message,
Set<CommandSender> recipients) |
Deprecated.
|
| Modifier and Type | Method | Description |
|---|---|---|
static HandlerList |
getHandlerList() |
|
HandlerList |
getHandlers() |
|
String |
getMessage() |
Get the message to broadcast.
|
Set<CommandSender> |
getRecipients() |
Gets a set of recipients that this chat message will be displayed to.
|
boolean |
isCancelled() |
Gets the cancellation state of this event.
|
void |
setCancelled(boolean cancelled) |
Sets the cancellation state of this event.
|
void |
setMessage(String message) |
Set the message to broadcast.
|
getEventName, isAsynchronous@Deprecated public BroadcastMessageEvent(@NotNull String message, @NotNull Set<CommandSender> recipients)
public BroadcastMessageEvent(boolean isAsync,
@NotNull
String message,
@NotNull
Set<CommandSender> recipients)
@NotNull public String getMessage()
public void setMessage(@NotNull
String message)
message - New message to broadcast@NotNull public Set<CommandSender> getRecipients()
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 UnsupportedOperationException if the event caller provides an
unmodifiable set.
public boolean isCancelled()
CancellableisCancelled in interface Cancellablepublic void setCancelled(boolean cancelled)
CancellablesetCancelled in interface Cancellablecancelled - true if you wish to cancel this event@NotNull public HandlerList getHandlers()
getHandlers in class Event@NotNull public static HandlerList getHandlerList()
Copyright © 2019. All rights reserved.