Interface CommandMapModifier
This interface provides version-specific implementations for registering and unregistering commands directly with Bukkit's command system, bypassing the standard plugin.yml registration process.
This is particularly useful for dynamic command registration at runtime or for plugins that need fine-grained control over command management.
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the internal command map containing all known commands.voidregisterCommand(@NotNull Command command, @NotNull Plugin plugin) Registers a BukkitCommandto the internal command map.voidunregisterCommand(@NotNull Command command) Unregisters a BukkitCommandfrom the internal command map.
-
Method Details
-
unregisterCommand
Unregisters a BukkitCommandfrom the internal command map.This removes the command from the server's command registry, making it no longer available for execution by players or console. The command will be completely removed from the known commands map.
- Parameters:
command- theCommandto unregister from the command map
-
registerCommand
Registers a BukkitCommandto the internal command map.This adds the command to the server's command registry, making it available for execution. The command will be associated with the specified plugin for ownership tracking.
-
getKnownCommands
Retrieves the internal command map containing all known commands.This provides direct access to Bukkit's internal command registry, allowing inspection of all registered commands. The returned map maps command names to their corresponding
Commandinstances.
-