类 BroadcastMessageEvent
- 所有已实现的接口:
Cancellable
Server.broadcast(String, String) 方法) 时调用.
这个事件与 AsyncPlayerChatEvent 表现相似,
如果这个事件从一个异步线程触发, 那这个事件也应是异步的.
前往 AsyncPlayerChatEvent 了解更多信息.-
嵌套类概要
从类继承的嵌套类/接口 org.bukkit.event.Event
Event.Result -
构造器概要
构造器构造器说明BroadcastMessageEvent(boolean isAsync, @NotNull String message, @NotNull Set<CommandSender> recipients) BroadcastMessageEvent(@NotNull String message, @NotNull Set<CommandSender> recipients) 已过时。 -
方法概要
修饰符和类型方法说明static @NotNull HandlerList获取将广播的消息.获取一个将显示这条消息的接收者的集合.boolean获取这个事件是否被取消.一个被取消的事件不会在服务器里执行,但是仍然会传递事件到其他插件.voidsetCancelled(boolean cancelled) 取消这个事件.voidsetMessage(@NotNull String message) 设置将广播的消息.从类继承的方法 org.bukkit.event.Event
getEventName, isAsynchronous
-
构造器详细资料
-
BroadcastMessageEvent
@Deprecated(since="1.14") public BroadcastMessageEvent(@NotNull @NotNull String message, @NotNull @NotNull Set<CommandSender> recipients) 已过时。 -
BroadcastMessageEvent
-
-
方法详细资料
-
getMessage
获取将广播的消息.原文: Get the message to broadcast.
- 返回:
- 广播的消息
-
setMessage
设置将广播的消息.原文: Set the message to broadcast.
- 参数:
message- 广播的消息
-
getRecipients
获取一个将显示这条消息的接收者的集合.本方法返回的集合不保证可以改变和访问时可能自动填充. 任何访问这个集合的监听器都应注意对于一个 lazy set 的实现可能会降低性能.
监听器应注意到如果事件传唤者提供了一个不可修改的Set集合的话修改这个列表可能会抛出
UnsupportedOperationException异常.原文: 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
UnsupportedOperationExceptionif the event caller provides an unmodifiable set.- 返回:
- 所有会看到这条消息的接收者
-
isCancelled
public boolean isCancelled()从接口复制的说明: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
- 指定者:
isCancelled在接口中Cancellable- 返回:
- 如果事件已经被取消,则为true
-
setCancelled
public void setCancelled(boolean cancelled) 从接口复制的说明: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.
- 指定者:
setCancelled在接口中Cancellable- 参数:
cancelled- 如果你想取消这个事件,则为true
-
getHandlers
- 指定者:
getHandlers在类中Event
-
getHandlerList
-