Interface Command

    • Method Detail

      • canExecute

        boolean canExecute​(CommandCause cause)
        Test whether this command can probably be executed given this Cause.

        If implementations are unsure if the command can be executed by the source, true should be returned. Return values of this method may be used to determine whether this command is listed in command listings.

        Parameters:
        cause - The Cause to check
        Returns:
        Whether this command will execute
      • shortDescription

        java.util.Optional<Component> shortDescription​(CommandCause cause)
        Gets a short one-line description of this command.

        The help system may display the description in the command list, or in any other function that displays a command list. It is therefore recommended that any description here is kept very short.

        Parameters:
        cause - The CommandCause of the help request
        Returns:
        A description
        See Also:
        CommandRegistrar.shortDescription(CommandCause, CommandMapping)
      • extendedDescription

        java.util.Optional<Component> extendedDescription​(CommandCause cause)
        Gets a longer formatted help message about this command.

        The help system may display this description when displaying details about this specific command. It should not contain the description provided by shortDescription(CommandCause).

        Parameters:
        cause - The Cause of the help request
        Returns:
        A description
      • usage

        Component usage​(CommandCause cause)
        Gets the usage string of this command.

        A usage string may look like [<world>] <var1> <var2>.

        The string must not contain the command alias.

        Parameters:
        cause - The Cause of the help request
        Returns:
        A usage string