Interface CommandRegistry

All Superinterfaces:
Registry

public interface CommandRegistry extends Registry
Registry for managing command registration and Brigadier integration. Provides methods to register, unregister, and configure commands with Brigadier support.

Command registration example:

CommandRegistry registry = flectonePulse.get(CommandRegistry.class);

registry.registerCommand(manager ->
    manager.commandBuilder("mycommand")
        .permission("myplugin.command")
        .handler(context -> {
            FPlayer player = context.sender();
            player.sendMessage("Command executed!");
        })
);
Since:
0.8.0
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Initializes the command manager and registers exception handlers.
    void
    registerCommand(Function<org.incendo.cloud.CommandManager<FPlayer>, org.incendo.cloud.Command.Builder<FPlayer>> builder)
    Registers a new command using the provided builder function.
    void
    Unregisters a command by its name.

    Methods inherited from interface Registry

    onDisable, onEnable
  • Method Details

    • init

      void init()
      Initializes the command manager and registers exception handlers.
    • registerCommand

      void registerCommand(Function<org.incendo.cloud.CommandManager<FPlayer>, org.incendo.cloud.Command.Builder<FPlayer>> builder)
      Registers a new command using the provided builder function.
      Parameters:
      builder - function that creates a command builder using the CommandManager
    • unregisterCommand

      void unregisterCommand(String name)
      Unregisters a command by its name.
      Parameters:
      name - the name of the command to unregister