Class ClientChatEvent


  • public class ClientChatEvent
    extends net.minecraftforge.eventbus.api.Event
    ClientChatEvent is fired whenever the client is about to send a chat message or command to the server.
    This event is fired via ForgeEventFactory.onClientSendMessage(String), which is executed by GuiScreen#sendChatMessage(String, boolean)

    message contains the message that will be sent to the server. This can be changed by mods.
    originalMessage contains the original message that was going to be sent to the server. This cannot be changed by mods.

    This event is Cancelable.
    If this event is canceled, the chat message or command is never sent to the server.

    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

      Fields 
      Modifier and Type Field Description
      private java.lang.String message  
      private java.lang.String originalMessage  
    • Constructor Summary

      Constructors 
      Constructor Description
      ClientChatEvent​(java.lang.String message)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getMessage()  
      java.lang.String getOriginalMessage()  
      void setMessage​(java.lang.String message)  
      • Methods inherited from class net.minecraftforge.eventbus.api.Event

        getListenerList, getParentListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult, setup
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • message

        private java.lang.String message
      • originalMessage

        private final java.lang.String originalMessage
    • Constructor Detail

      • ClientChatEvent

        public ClientChatEvent​(java.lang.String message)
    • Method Detail

      • getMessage

        public java.lang.String getMessage()
      • setMessage

        public void setMessage​(java.lang.String message)
      • getOriginalMessage

        public java.lang.String getOriginalMessage()