Class BroadcastMessageEvent

    • Constructor Detail

      • BroadcastMessageEvent

        public BroadcastMessageEvent​(boolean isAsync,
                                     @NotNull
                                     String message,
                                     @NotNull
                                     Set<CommandSender> recipients)
    • Method Detail

      • getMessage

        @NotNull
        public String getMessage()
        Get the message to broadcast.
        Returns:
        Message to broadcast
      • setMessage

        public void setMessage​(@NotNull
                               String message)
        Set the message to broadcast.
        Parameters:
        message - New message to broadcast
      • getRecipients

        @NotNull
        public Set<CommandSender> getRecipients()
        Gets 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 UnsupportedOperationException if the event caller provides an unmodifiable set.

        Returns:
        All CommandSenders who will see this chat message
      • isCancelled

        public boolean isCancelled()
        Description copied from interface: Cancellable
        Gets 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:
        isCancelled in interface Cancellable
        Returns:
        true if this event is cancelled
      • setCancelled

        public void setCancelled​(boolean cancelled)
        Description copied from interface: Cancellable
        Sets 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:
        setCancelled in interface Cancellable
        Parameters:
        cancelled - true if you wish to cancel this event
      • getHandlerList

        @NotNull
        public static HandlerList getHandlerList()