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 TypeMethodDescriptionvoidregister(String commandName, TextCommandHandler handler) Registers a text command handler.voidunregister(String commandName) Unregisters a text command handler.
-
Method Details
-
register
Registers a text command handler.- Parameters:
commandName- the command name (without prefix)handler- the command handler
-
unregister
Unregisters a text command handler.- Parameters:
commandName- the command name to unregister
-