类 ServerChatEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.ServerChatEvent
public class ServerChatEvent
extends net.minecraftforge.eventbus.api.Event
This event is fired whenever a
ServerboundChatPacket
is received from a client
who has submitted their chat message.
This event is cancellable, and does not have a result. If the event is cancelled, the message will not be sent to clients.
This event is fired on the main Forge event bus, only on the logical server.
-
嵌套类概要
从类继承的嵌套类/接口 net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明返回 the message that will be sent to the relevant clients, if the event is not cancelled。返回 the player who initiated the chat action。返回 the original raw text of the player chat message。返回 the username of the player who initiated the chat action。void
setMessage
(Component message) Set the message to be sent to the relevant clients.从类继承的方法 net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
字段详细资料
-
player
-
username
-
rawText
-
message
-
-
构造器详细资料
-
ServerChatEvent
-
-
方法详细资料
-
getPlayer
返回 the player who initiated the chat action。- 返回:
- the player who initiated the chat action
-
getUsername
返回 the username of the player who initiated the chat action。- 返回:
- the username of the player who initiated the chat action
-
getRawText
返回 the original raw text of the player chat message。- 返回:
- the original raw text of the player chat message
-
setMessage
Set the message to be sent to the relevant clients. -
getMessage
返回 the message that will be sent to the relevant clients, if the event is not cancelled。- 返回:
- the message that will be sent to the relevant clients, if the event is not cancelled
-