NodeBuilder

DSL builder for a CommandNode: declare static choices, dynamic completions and an executes body.

Functions

Link copied to clipboard
fun choice(value: String)

Adds a literal completion value with no further arguments.

fun choice(value: String, block: NodeBuilder.() -> Unit)

Adds a literal completion value with a nested sub-tree built by block.

Link copied to clipboard
fun dynamic(provider: (CommandSender) -> List<String>)

Adds a runtime-computed set of completions from provider.

fun dynamic(provider: (CommandSender) -> List<String>, block: NodeBuilder.() -> Unit)

Adds runtime completions from provider with a nested sub-tree (for the next argument) via block.

Link copied to clipboard
fun executes(block: CommandSender.(Array<out String>) -> Unit)

Sets the executor run when the command ends at this node; receiver is the sender, param the args.