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.void
registerCommand
(@NotNull Command command, @NotNull Plugin plugin) Registers a BukkitCommand
to the internal command map.void
unregisterCommand
(@NotNull Command command) Unregisters a BukkitCommand
from the internal command map.
-
Method Details
-
unregisterCommand
Unregisters a BukkitCommand
from 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
- theCommand
to unregister from the command map
-
registerCommand
Registers a BukkitCommand
to 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
Command
instances.
-