Interface ViaVersionCommand


public interface ViaVersionCommand
  • Method Details

    • registerSubCommand

      void registerSubCommand(ViaSubCommand command)
      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

      void removeSubCommand(String name)
      Removes a subcommand by name, can be used to unload default subcommands which are not supported on the platform.
      Parameters:
      name - Subcommand name
    • hasSubCommand

      boolean hasSubCommand(String name)
      Check if a subcommand is registered.
      Parameters:
      name - Subcommand name
      Returns:
      true if it exists
    • getSubCommand

      @Nullable ViaSubCommand getSubCommand(String name)
      Get subcommand instance by name
      Parameters:
      name - subcommand name
      Returns:
      ViaSubCommand instance
    • onCommand

      boolean onCommand(ViaCommandSender sender, String[] args)
      Executed when the Command sender executes the commands
      Parameters:
      sender - Sender object
      args - arguments provided
      Returns:
      was successful
    • onTabComplete

      List<String> onTabComplete(ViaCommandSender sender, String[] args)
      Executed when the Command sender tab-completes
      Parameters:
      sender - Sender object
      args - arguments provided
      Returns:
      was successful
    • showHelp

      void showHelp(ViaCommandSender sender)