Interface ClientSendMessageEvents.AllowCommand

Enclosing class:
ClientSendMessageEvents
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface ClientSendMessageEvents.AllowCommand
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Called 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.
  • Method Details

    • allowSendCommandMessage

      boolean allowSendCommandMessage(String command)
      Called 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. Returning false prevents the command from being sent, and ClientSendMessageEvents.COMMAND_CANCELED will be triggered instead of ClientSendMessageEvents.MODIFY_COMMAND. The command string does not include a slash at the beginning.
      Parameters:
      command - the command that will be sent to the server, without a slash at the beginning.
      Returns:
      true if the command should be sent, otherwise false