Interface DMSubCommand
public interface DMSubCommand
The interface needed to create a subcommand for the DialogueMaster command.
Implement this interface and add it to the
DMSubCommandRegistry
to create your own subcommand.-
Method Summary
Modifier and TypeMethodDescriptionvoid
This is called when the subcommand is executed.The description of the subcommand.getName()
The name of the subcommand.getTabCompletion
(org.bukkit.command.Command command, org.bukkit.command.CommandSender sender, String[] args) This is called when the subcommand is tab completed.getUsage()
The usage of the subcommand.
-
Method Details
-
getName
String getName()The name of the subcommand. The subcommand will also be called with this name. It must be unique. -
getDescription
String getDescription()The description of the subcommand. -
getUsage
String getUsage()The usage of the subcommand. Please use the official command syntax for this. Here's an example: /dm example <necessary variable> [optional variable] -
execute
void execute(org.bukkit.command.Command command, org.bukkit.command.CommandSender sender, String[] args) This is called when the subcommand is executed.- Parameters:
command
- The command that executed the subcommand.sender
- The sender of the command.args
- The arguments of the subcommand.
-
getTabCompletion
List<String> getTabCompletion(org.bukkit.command.Command command, org.bukkit.command.CommandSender sender, String[] args) throws IllegalArgumentException This is called when the subcommand is tab completed. The list will get alphabetically sorted.- Parameters:
command
- the command that executed the subcommand.sender
- the sender of the command.args
- the arguments of the subcommand.- Returns:
- the list of tab completions currently available.
- Throws:
IllegalArgumentException
-