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
Modifier and Type | Field and Description |
---|---|
private ITextComponent |
component |
private java.lang.String |
message |
private EntityPlayerMP |
player |
private java.lang.String |
username |
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
private final java.lang.String message
private final java.lang.String username
private final EntityPlayerMP player
private ITextComponent component
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()