Package net.forthecrown.grenadier
Class CommandBroadcastEvent
java.lang.Object
org.bukkit.event.Event
net.forthecrown.grenadier.CommandBroadcastEvent
- All Implemented Interfaces:
Cancellable
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Formatter for a command broadcastNested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result
-
Constructor Summary
ConstructorDescriptionCommandBroadcastEvent
(CommandSource source, Component message, Set<Audience> viewers) -
Method Summary
Modifier and TypeMethodDescriptionGets the broadcast message formatterstatic HandlerList
@NotNull HandlerList
Gets the message of the announcementGets the source of the broadcastGets a mutable set of broadcast viewers.boolean
void
setCancelled
(boolean cancelled) void
setFormatter
(CommandBroadcastEvent.Formatter formatter) Sets the broadcast message formattervoid
setMessage
(Component message) Sets the announcement messageMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
CommandBroadcastEvent
-
-
Method Details
-
getSource
Gets the source of the broadcast- Returns:
- broadcast source
-
getMessage
Gets the message of the announcement- Returns:
- Announcement message
-
setMessage
Sets the announcement message- Parameters:
message
- new message
-
getViewers
Gets a mutable set of broadcast viewers.Unless manually added, this set will not contain the player the
getSource()
represents, or, in the case the source is the console, this set will not contain the console sender- Returns:
- Viewers
-
getFormatter
Gets the broadcast message formatter- Returns:
- Broadcast formatter
-
setFormatter
Sets the broadcast message formatter- Parameters:
formatter
- message formatter
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelled
in interfaceCancellable
-
setCancelled
public void setCancelled(boolean cancelled) - Specified by:
setCancelled
in interfaceCancellable
-
getHandlerList
-
getHandlers
- Specified by:
getHandlers
in classEvent
-