Interface ICommandRegistrationHandler


public interface ICommandRegistrationHandler
Handles registration of commands for the /ct main command.

All "root" and "sub" terms are re-defined in this context not to consider /ct as the actual root. In other words, registering a root command named foo will actually register a sub-command accessible through /ct foo; whereas registering a sub-command bar for the command baz leads to the sub-command being accessible through /ct baz bar.

Since:
9.1.0
  • Method Details

    • registerRootCommand

      void registerRootCommand(String commandId, net.minecraft.network.chat.MutableComponent description, ICommandRegistrationHandler.CommandBuilder builder)
      Registers a new root command with the given name and description.

      The given command will then be accessible at the root level, right after the /ct main command.

      Parameters:
      commandId - The name of the command. Conventionally, the string should be all lower-case and a single word if possible. Multiple words should be merged together with snake_case.
      description - A MutableComponent acting as the description of the command, used in /ct help to guide the user.
      builder - A ICommandRegistrationHandler.CommandBuilder used to create the actual command code.
      Since:
      9.1.0
    • registerSubCommand

      void registerSubCommand(String parentCommand, String commandId, net.minecraft.network.chat.MutableComponent description, ICommandRegistrationHandler.CommandBuilder builder)
      Registers a new sub command to the given parent with the specified name and description.

      The parent command must exist, otherwise an error on registration will occur.

      Parameters:
      parentCommand - The name of the parent command.
      commandId - The name of the sub-command. Conventionally, the string should be all lowercase and a single word if possible. Multiple words should be merged together with snake_case.
      description - A MutableComponent acting as the description of the command, used in /ct help to guide the user.
      builder - A ICommandRegistrationHandler.CommandBuilder used to create the actual command code.
      Since:
      9.1.0
    • registerDump

      void registerDump(String dumpId, net.minecraft.network.chat.MutableComponent description, ICommandRegistrationHandler.CommandBuilder builder)
      Registers a new command which can be used to dump brackets.

      This can be seen as the command equivalent to IBracketParserRegistrationHandler.DumperData, and the two components work in synergy with one another.

      Parameters:
      dumpId - The identifier that will be used to invoke this dump command.
      description - A MutableComponent acting as the description of the command, used in /ct help to guide the user.
      builder - A ICommandRegistrationHandler.CommandBuilder used to create the actual command code.
      Since:
      9.1.0