Class BrigadierSubCommandBuilder

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

public final class BrigadierSubCommandBuilder extends Object
A single literal node (and its optional arguments and nested literals) of a Brigadier command tree.

Instances are obtained through BrigadierCommandBuilder.literalSub(String).

  • Method Details

    • stringArg

      public BrigadierSubCommandBuilder stringArg(String name)
      Appends a free-form string argument.
      Parameters:
      name - the argument name
      Returns:
      this node, for chaining
    • greedyStringArg

      public BrigadierSubCommandBuilder greedyStringArg(String name)
      Appends a greedy string argument (consumes the remainder of the input).
      Parameters:
      name - the argument name
      Returns:
      this node, for chaining
    • intArg

      public BrigadierSubCommandBuilder intArg(String name)
      Appends an integer argument.
      Parameters:
      name - the argument name
      Returns:
      this node, for chaining
    • intArg

      public BrigadierSubCommandBuilder intArg(String name, int min, int max)
      Appends an integer argument restricted to the given range (inclusive).
      Parameters:
      name - the argument name
      min - the minimum allowed value
      max - the maximum allowed value
      Returns:
      this node, for chaining
    • literalSub

      public BrigadierSubCommandBuilder literalSub(String name)
      Appends a nested literal to this node.
      Parameters:
      name - the literal name
      Returns:
      the nested node
    • end

      Ends the current chain and returns the root BrigadierCommandBuilder.
      Returns:
      the root builder
    • endNested

      public BrigadierSubCommandBuilder endNested()
      Ends a nested literal and returns its parent node.
      Returns:
      the parent node