Interface CommandRegister


public interface CommandRegister
Interface for programmatic text command registration and unregistration.

Preferred approach: Use the @TextCommand annotation on methods in your @Plugin class. Commands defined via annotations are automatically registered on enable and unregistered on disable.

This interface is used internally by the core and is available for plugins that need dynamic command registration at runtime.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    register(String commandName, TextCommandHandler handler)
    Registers a text command handler.
    void
    unregister(String commandName)
    Unregisters a text command handler.
  • Method Details

    • register

      void register(String commandName, TextCommandHandler handler)
      Registers a text command handler.
      Parameters:
      commandName - the command name (without prefix)
      handler - the command handler
    • unregister

      void unregister(String commandName)
      Unregisters a text command handler.
      Parameters:
      commandName - the command name to unregister