Package org.bukkit.event.server
Class BroadcastMessageEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.server.ServerEvent
org.bukkit.event.server.BroadcastMessageEvent
- All Implemented Interfaces:
- Cancellable
Event triggered for server broadcast messages such as from
 
Server.broadcast(net.kyori.adventure.text.Component) (String, String)}.
 This event behaves similarly to AsyncChatEvent in that it
 should be async if fired from an async thread. Please see that event for
 further information.- 
Nested Class SummaryNested classes/interfaces inherited from class org.bukkit.event.EventEvent.Result
- 
Constructor SummaryConstructorsConstructorDescriptionBroadcastMessageEvent(boolean isAsync, @NotNull String message, @NotNull Set<CommandSender> recipients) Deprecated.BroadcastMessageEvent(boolean isAsync, @NotNull Component message, @NotNull Set<CommandSender> recipients) BroadcastMessageEvent(@NotNull String message, @NotNull Set<CommandSender> recipients) Deprecated.BroadcastMessageEvent(@NotNull Component message, @NotNull Set<CommandSender> recipients) Deprecated.
- 
Method SummaryModifier and TypeMethodDescriptionstatic @NotNull HandlerListDeprecated.Gets a set of recipients that this chat message will be displayed to.booleanGets the cancellation state of this event.message()Get the broadcast message.voidSet the broadcast message.voidsetCancelled(boolean cancelled) Sets the cancellation state of this event.voidsetMessage(@NotNull String message) Deprecated.in favour ofmessage(net.kyori.adventure.text.Component)Methods inherited from class org.bukkit.event.EventcallEvent, getEventName, isAsynchronous
- 
Constructor Details- 
BroadcastMessageEvent@Deprecated public BroadcastMessageEvent(@NotNull @NotNull String message, @NotNull @NotNull Set<CommandSender> recipients) Deprecated.
- 
BroadcastMessageEvent@Deprecated public BroadcastMessageEvent(boolean isAsync, @NotNull @NotNull String message, @NotNull @NotNull Set<CommandSender> recipients) Deprecated.
- 
BroadcastMessageEvent@Deprecated public BroadcastMessageEvent(@NotNull Component message, @NotNull @NotNull Set<CommandSender> recipients) Deprecated.
- 
BroadcastMessageEvent
 
- 
- 
Method Details- 
messageGet the broadcast message.- Returns:
- Message to broadcast
 
- 
messageSet the broadcast message.- Parameters:
- message- New message to broadcast
 
- 
getMessageDeprecated.in favour ofmessage()Get the message to broadcast.- Returns:
- Message to broadcast
 
- 
setMessageDeprecated.in favour ofmessage(net.kyori.adventure.text.Component)Set the message to broadcast.- Parameters:
- message- New message to broadcast
 
- 
getRecipientsGets a set of recipients that this chat message will be displayed to.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 UnsupportedOperationExceptionif the event caller provides an unmodifiable set.- Returns:
- All CommandSenders who will see this chat message
 
- 
isCancelledpublic 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 interface- Cancellable
- Returns:
- true if this event is cancelled
 
- 
setCancelledpublic void setCancelled(boolean cancelled) Description copied from interface:CancellableSets 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:
- setCancelledin interface- Cancellable
- Parameters:
- cancelled- true if you wish to cancel this event
 
- 
getHandlers- Specified by:
- getHandlersin class- Event
 
- 
getHandlerList
 
- 
message()