Class ClientChatEvent

java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.client.event.ClientChatEvent

public class ClientChatEvent extends net.minecraftforge.eventbus.api.Event
Fired when the client is about to send a chat message to the server.

This event is cancellable, and does not have a result. If the event is cancelled, the chat message will not be sent to the server.

This event is fired on the main Forge event bus, only on the logical client.

  • 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 final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the message that will be sent to the server, if the event is not cancelled.
    Returns the original message that was to be sent to the server.

    Methods inherited from class net.minecraftforge.eventbus.api.Event

    getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult

    Methods inherited from class java.lang.Object

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

    • originalMessage

      private final String originalMessage
  • Constructor Details

    • ClientChatEvent

      @Internal public ClientChatEvent(String message)
  • Method Details

    • getMessage

      public String getMessage()
      Returns the message that will be sent to the server, if the event is not cancelled.
      Returns:
      the message that will be sent to the server, if the event is not cancelled
    • getOriginalMessage

      public String getOriginalMessage()
      Returns the original message that was to be sent to the server.
      Returns:
      the original message that was to be sent to the server