Package net.minecraftforge.event
Class ServerChatEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.ServerChatEvent
public class ServerChatEvent
extends net.minecraftforge.eventbus.api.Event
ServerChatEvent is fired whenever a C01PacketChatMessage is processed.
This event is fired via
This event is
If this event is canceled, the chat message is never distributed to all clients.
This event does not have a result.
This event is fired on the
This event is fired via
ForgeHooks.onServerChatEvent(ServerGamePacketListenerImpl, String, Component)
,
which is executed by the ServerGamePacketListenerImpl.handleChat(ServerboundChatPacket)
username
contains the username of the player sending the chat message.message
contains the message being sent.player
the instance of EntityPlayerMP for the player sending the chat message.component
contains the instance of ChatComponentTranslation for the sent message.This event is
Cancelable
. If this event is canceled, the chat message is never distributed to all clients.
This event does not have a result.
Event.HasResult
This event is fired on the
MinecraftForge.EVENT_BUS
.-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
Field Summary
-
Constructor Summary
ConstructorDescriptionServerChatEvent
(ServerPlayer player, String message, Component component) Deprecated.ServerChatEvent
(ServerPlayer player, String message, Component component, String filteredMessage, Component filteredComponent) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getParentListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult, setup
-
Field Details
-
message
-
filteredMessage
-
username
-
player
-
component
-
filteredComponent
-
-
Constructor Details
-
ServerChatEvent
Deprecated. -
ServerChatEvent
public ServerChatEvent(ServerPlayer player, String message, Component component, @Nullable String filteredMessage, @Nullable Component filteredComponent)
-
-
Method Details
-
setComponent
-
setFilteredComponent
-
getComponent
-
getFilteredComponent
-
getMessage
-
getFilteredMessage
-
getUsername
-
getPlayer
-