类 ClientChatReceivedEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.client.event.ClientChatReceivedEvent
public class ClientChatReceivedEvent
extends net.minecraftforge.eventbus.api.Event
Fired when a chat message is received on the client.
This can be used for filtering and detecting messages with specific words or phrases, and suppressing them.
This event is cancellable, and does not have a result. If the event is cancelled, the message is not displayed in the chat message window.
This event is fired on the main Forge event bus, only on the logical client.
- 另请参阅:
-
嵌套类概要
嵌套类修饰符和类型类说明static class
Fired when a player chat message is received on the client.static class
已过时, 待删除: 此 API 元素将从以后的版本中删除。从类继承的嵌套类/接口 net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明返回 the bound chat type of the chat message。返回 the message that will be displayed in the chat message window, if the event is not cancelled。返回 the message sender。boolean
isSystem()
已过时, 待删除: 此 API 元素将从以后的版本中删除。void
setMessage
(Component message) Sets the new message to be displayed in the chat message window, if the event is not cancelled.从类继承的方法 net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
字段详细资料
-
message
-
boundChatType
-
sender
-
-
构造器详细资料
-
ClientChatReceivedEvent
@Internal public ClientChatReceivedEvent(ChatType.Bound boundChatType, Component message, UUID sender)
-
-
方法详细资料
-
getMessage
返回 the message that will be displayed in the chat message window, if the event is not cancelled。- 返回:
- the message that will be displayed in the chat message window, if the event is not cancelled
-
setMessage
Sets the new message to be displayed in the chat message window, if the event is not cancelled.- 参数:
message
- the new message to be displayed
-
getBoundChatType
返回 the bound chat type of the chat message。. This contains the chat type, display name of the sender, and nullable target name depending on the chat type.- 返回:
- the bound chat type of the chat message
-
getSender
返回 the message sender。.- 返回:
- the message sender
-
isSystem
已过时, 待删除: 此 API 元素将从以后的版本中删除。返回true
if the message was sent by the system,false
otherwise。- 返回:
true
if the message was sent by the system,false
otherwise
-