Interface ViaVersionCommand
public interface ViaVersionCommand
-
Method Summary
Modifier and TypeMethodDescription@Nullable ViaSubCommandgetSubCommand(String name) Get subcommand instance by namebooleanhasSubCommand(String name) Check if a subcommand is registered.booleanonCommand(ViaCommandSender sender, String[] args) Executed when the Command sender executes the commandsonTabComplete(ViaCommandSender sender, String[] args) Executed when the Command sender tab-completesvoidregisterSubCommand(ViaSubCommand command) Register your own subcommand inside ViaVersionvoidremoveSubCommand(String name) Removes a subcommand by name, can be used to unload default subcommands which are not supported on the platform.voidshowHelp(ViaCommandSender sender)
-
Method Details
-
registerSubCommand
Register your own subcommand inside ViaVersion- Parameters:
command- Your own SubCommand instance to handle it.- Throws:
IllegalArgumentException- throws an exception when the subcommand already exists or if it's not valid, example: space
-
removeSubCommand
Removes a subcommand by name, can be used to unload default subcommands which are not supported on the platform.- Parameters:
name- Subcommand name
-
hasSubCommand
Check if a subcommand is registered.- Parameters:
name- Subcommand name- Returns:
- true if it exists
-
getSubCommand
Get subcommand instance by name- Parameters:
name- subcommand name- Returns:
- ViaSubCommand instance
-
onCommand
Executed when the Command sender executes the commands- Parameters:
sender- Sender objectargs- arguments provided- Returns:
- was successful
-
onTabComplete
Executed when the Command sender tab-completes- Parameters:
sender- Sender objectargs- arguments provided- Returns:
- was successful
-
showHelp
-