public class ServerChatEvent extends 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
.Event.HasResult, Event.Result
Constructor and Description |
---|
ServerChatEvent(EntityPlayerMP player,
java.lang.String message,
ITextComponent component) |
Modifier and Type | Method and Description |
---|---|
ITextComponent |
getComponent() |
java.lang.String |
getMessage() |
EntityPlayerMP |
getPlayer() |
java.lang.String |
getUsername() |
void |
setComponent(ITextComponent e) |
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult, setup
public ServerChatEvent(EntityPlayerMP 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 EntityPlayerMP getPlayer()