Interface ViaVersionCommand
public interface ViaVersionCommand
-
Method Summary
Modifier and TypeMethodDescription@Nullable ViaSubCommand
getSubCommand
(String name) Get subcommand instance by nameboolean
hasSubCommand
(String name) Check if a subcommand is registered.boolean
onCommand
(ViaCommandSender sender, String[] args) Executed when the Command sender executes the commandsonTabComplete
(ViaCommandSender sender, String[] args) Executed when the Command sender tab-completesvoid
registerSubCommand
(ViaSubCommand command) Register your own subcommand inside ViaVersionvoid
removeSubCommand
(String name) Removes a subcommand by name, can be used to unload default subcommands which are not supported on the platform.void
showHelp
(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: spacee
-
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
-