类 ServerChatEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.ServerChatEvent
- 所有已实现的接口:
net.neoforged.bus.api.ICancellableEvent
public class ServerChatEvent
extends net.neoforged.bus.api.Event
implements net.neoforged.bus.api.ICancellableEvent
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
.
If the event is cancelled, the message will not be sent to clients.
引用无效
have a result
This event is fired on the main Forge event bus, only on the logical server.
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明返回 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.从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 net.neoforged.bus.api.ICancellableEvent
isCanceled, setCanceled
-
字段详细资料
-
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
-