Subcommand Class
Introduction
The Subcommand abstract class is the base for custom subcommands registered through the Subcommands interface.
Subclasses implement execute and onTabComplete.
Constructors
Subcommand(String label, boolean hidden, String permission)
Parameters:
label- The name of the subcommand, used as/polar <label>.hidden-trueto hide the subcommand from the/polar helplisting.permission- The permission required to run the subcommand, ornullfor none.
Subcommand(String label)
Description:
Creates a visible subcommand with no permission requirement.
Parameters:
label- The name of the subcommand.
Abstract Methods
execute
Description:
Called when the subcommand is run.
Parameters:
sender- The User who ran the command.label- The label the command was invoked with.args- The arguments following the label.
onTabComplete
Description:
Called to provide tab completion suggestions.
Parameters:
sender- The User requesting completions.args- The arguments typed so far.
Returns:
A list of suggestions. May be empty.
Getters
getLabel
Returns:
The label of the subcommand.
isHidden
Returns:
true if the subcommand is hidden from the help listing.
getPermission
Returns:
The required permission, or null if none is required.