Interface ExecuteCommandEvent.Pre

All Superinterfaces:
Cancellable, Event, ExecuteCommandEvent
Enclosing interface:
ExecuteCommandEvent

public static interface ExecuteCommandEvent.Pre extends ExecuteCommandEvent, Cancellable
Fired before the command is executed.
  • Method Details

    • setCommand

      void setCommand(String command)
      Sets the command as a string, without any sort of command prefix.

      For example, if the message was /example bob 3 -f, then the command would be example.

      Parameters:
      command - The command
    • setArguments

      void setArguments(String arguments)
      Sets the arguments as a string.

      For example, if the message was /example bob 3 -f, then the arguments would be bob 3 -f.

      Parameters:
      arguments - The arguments
    • result

      The result of the command.

      If set, this indicates cancellation of the command.

      Returns:
      The result of the command, if set.
    • setResult

      void setResult(@Nullable CommandResult result)
      Sets the result of the command.
      Parameters:
      result - The result of the command
    • isCancelled

      boolean isCancelled()
      If true, the command will not run and the CommandResult given by result() will be returned.
      Specified by:
      isCancelled in interface Cancellable
      Returns:
      The cancellation status of the event.
    • setCancelled

      void setCancelled(boolean cancel)
      Sets whether the command will run. If the command is cancelled using this method, an appropriate CommandResult will be set (and returned from result()).
      Specified by:
      setCancelled in interface Cancellable
      Parameters:
      cancel - The new cancelled state