Class BrigadierCommandBuilder

java.lang.Object
me.tayebyassine.homestead.commands.brigadier.builder.BrigadierCommandBuilder

public final class BrigadierCommandBuilder extends Object
Fluent builder for a Brigadier command tree registered through Commodore.

This only improves tab-completion and argument validation on server software that supports Mojang Brigadier; actual command execution is still handled by the Bukkit CommandBuilder system.

  • Method Details

    • create

      public static BrigadierCommandBuilder create(String commandName)
      Starts a new Brigadier command tree for the given command name.
      Parameters:
      commandName - the command name
      Returns:
      the builder
    • literalSub

      public BrigadierSubCommandBuilder literalSub(String name)
      Appends a literal sub-command to the root node.
      Parameters:
      name - the literal name
      Returns:
      the sub-command node
    • register

      public void register(me.lucko.commodore.Commodore commodore)
      Builds the command tree and registers it with Commodore for the plugin command of commandName.
      Parameters:
      commodore - the Commodore instance