public class ServerChatEvent
extends net.minecraftforge.eventbus.api.Event
ForgeHooks#onServerChatEvent(NetHandlerPlayServer, String, ITextComponent)
,
which is executed by the NetHandlerPlayServer#processChatMessage(CPacketChatMessage)
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.Cancelable
. HasResult
MinecraftForge.EVENT_BUS
.Modifier and Type | Field and Description |
---|---|
private ITextComponent |
component |
private java.lang.String |
message |
private ServerPlayerEntity |
player |
private java.lang.String |
username |
Constructor and Description |
---|
ServerChatEvent(ServerPlayerEntity player,
java.lang.String message,
ITextComponent component) |
Modifier and Type | Method and Description |
---|---|
ITextComponent |
getComponent() |
java.lang.String |
getMessage() |
ServerPlayerEntity |
getPlayer() |
java.lang.String |
getUsername() |
void |
setComponent(ITextComponent e) |
private final java.lang.String message
private final java.lang.String username
private final ServerPlayerEntity player
private ITextComponent component
public ServerChatEvent(ServerPlayerEntity player, java.lang.String message, ITextComponent component)
public void setComponent(ITextComponent e)
public ITextComponent getComponent()
public java.lang.String getMessage()
public java.lang.String getUsername()
public ServerPlayerEntity getPlayer()