Class ClientChatEvent

java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.client.event.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 Screen.sendMessage(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 String
     
    private String
     
  • Constructor Summary

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

    Modifier and Type
    Method
    Description
     
     
    void
    setMessage​(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 Details

    • message

      private String message
    • originalMessage

      private final String originalMessage
  • Constructor Details

    • ClientChatEvent

      public ClientChatEvent(String message)
  • Method Details

    • getMessage

      public String getMessage()
    • setMessage

      public void setMessage(String message)
    • getOriginalMessage

      public String getOriginalMessage()