Interface CommandResult.Builder

    • Method Detail

      • result

        CommandResult.Builder result​(int result)
        Sets an integer value that indicates the states of the command.
        • A positive value indicates successful execution,
        • Zero (generally) indicates the command didn't fulfil its task, though that is not necessarily an error condition.
        • A negative value is undefined in the API, if returned, the effects are implementation specific.
        Parameters:
        result - The integer result to set
        Returns:
        This builder, for chaining
      • error

        CommandResult.Builder error​(@Nullable Component errorMessage)
        Sets the built result to report an error, with an optional error message.

        If this is set, then the command parser will send this message to the command invoker. Otherwise, the parser will report an unknown exception.

        Parameters:
        errorMessage - The message to send to the user.
        Returns:
        This builder, for chaining