Class ClientSendMessageEvents

java.lang.Object
net.fabricmc.fabric.api.client.message.v1.ClientSendMessageEvents

public final class ClientSendMessageEvents extends Object
Contains client-side events triggered when sending messages.
  • Field Details

    • ALLOW_CHAT

      public static final Event<ClientSendMessageEvents.AllowChat> ALLOW_CHAT
      An event triggered when the client is about to send a chat message, typically from a client GUI. Mods can use this to block the message.

      If a listener returned false, the message will not be sent, the remaining listeners will not be called (if any), and CHAT_CANCELED will be triggered instead of MODIFY_CHAT.

    • ALLOW_COMMAND

      public static final Event<ClientSendMessageEvents.AllowCommand> ALLOW_COMMAND
      An event triggered when the client is about to send a command, which is whenever the player executes a command including client commands registered with fabric-command-api. Mods can use this to block the message. The command string does not include a slash at the beginning.

      If a listener returned false, the command will not be sent, the remaining listeners will not be called (if any), and COMMAND_CANCELED will be triggered instead of MODIFY_COMMAND.

    • MODIFY_CHAT

      public static final Event<ClientSendMessageEvents.ModifyChat> MODIFY_CHAT
      An event triggered when the client sends a chat message, typically from a client GUI. Is not called when chat messages are blocked. Mods can use this to modify the message. Use CHAT if not modifying the message.
    • MODIFY_COMMAND

      public static final Event<ClientSendMessageEvents.ModifyCommand> MODIFY_COMMAND
      An event triggered when the client sends a command, which is whenever the player executes a command including client commands registered with fabric-command-api. Is not called when command messages are blocked. The command string does not include a slash at the beginning. Mods can use this to modify the command. Use COMMAND if not modifying the command.
    • CHAT

      public static final Event<ClientSendMessageEvents.Chat> CHAT
      An event triggered when the client sends a chat message, typically from a client GUI. Is not called when chat messages are blocked. Mods can use this to listen to the message.
    • COMMAND

      public static final Event<ClientSendMessageEvents.Command> COMMAND
      An event triggered when the client sends a command, which is whenever the player executes a command including client commands registered with fabric-command-api. Is not called when command messages are blocked. The command string does not include a slash at the beginning. Mods can use this to listen to the command.
    • CHAT_CANCELED

      public static final Event<ClientSendMessageEvents.ChatCanceled> CHAT_CANCELED
      An event triggered when sending a chat message is canceled with ALLOW_CHAT.
    • COMMAND_CANCELED

      public static final Event<ClientSendMessageEvents.CommandCanceled> COMMAND_CANCELED
      An event triggered when sending a command is canceled with ALLOW_COMMAND. The command string does not include a slash at the beginning.