PlayerChatEvent
PlayerChatEvent
=> org.bukkit.event.Event
=> org.bukkit.event.player.PlayerEvent
=> org.bukkit.event.player.PlayerChatEvent
Holds information for player chat and commands@deprecated This event will fire from the main thread and allows the use ofall of the Bukkit API, unlike the {@link AsyncPlayerChatEvent}.Listening to this event forces chat to wait for the main thread whichcauses delays for chat. {@link AsyncPlayerChatEvent} is the encouragedalternative for thread safe implementations.本事件存储了玩家所发送的聊天消息和指令的有关信息。@deprecated 本事件已过时,因为它在主线程触发。该事件的监听器可以任意访问Bukkit API
,而可能异步触发的AsyncPlayerChatEvent
则不然。监听本事件会使聊天用的异步线程不得不等待主线程上各监听器的处理结果,使聊天出现延迟。如果该事件的监听器所需要用到的方法是线程安全的,则建议使用AsyncPlayerChatEvent
替代本事件。译注:请使用AsyncPlayerChatEvent
。本事件已经过时。
方法声明: public boolean isCancelled()
方法签名: ()Z
方法声明: public void setCancelled(boolean cancel)
方法签名: (Z)V
方法声明: public String getMessage()
方法签名: ()Ljava/lang/String;
Gets the message that the player is attempting to send@return Message the player is attempting to send译注:请使用AsyncPlayerChatEvent
。本事件已经过时。
方法声明: public void setMessage(@NotNull String message)
方法签名: (Ljava/lang/String;)V
Sets the message that the player will send@param message New message that the player will send译注:请使用AsyncPlayerChatEvent
。本事件已经过时。
方法声明: public void setPlayer(@NotNull final Player player)
方法签名: (Lorg/bukkit/entity/Player;)V
Sets the player that this message will display as, or command will beexecuted as@param player New player which this event will execute as译注:请使用AsyncPlayerChatEvent
。本事件已经过时。
方法声明: public String getFormat()
方法签名: ()Ljava/lang/String;
Gets the format to use to display this chat message@return String.Format compatible format string译注:请使用AsyncPlayerChatEvent
。本事件已经过时。
方法声明: public void setFormat(@NotNull final String format)
方法签名: (Ljava/lang/String;)V
Sets the format to use to display this chat message@param format String.Format compatible format string译注:请使用AsyncPlayerChatEvent
。本事件已经过时。
方法声明: public Set getRecipients()
方法签名: ()Ljava/util/Set;
Gets a set of recipients that this chat message will be displayed to@return All Players who will see this chat message译注:请使用AsyncPlayerChatEvent
。本事件已经过时。
方法声明: public HandlerList getHandlers()
方法签名: ()Lorg/bukkit/event/HandlerList;
方法声明: public static HandlerList getHandlerList()
方法签名: ()Lorg/bukkit/event/HandlerList;
Last modified 1mo ago