DSLCommandNode

interface DSLCommandNode<S>

Functions

alias
Link copied to clipboard
abstract fun alias(alias: String)

Adds and Alias which can be used instead of the name of the Literal

argument
Link copied to clipboard
abstract fun <T> argument(name: String, type: ArgumentType<T>, setupBlock: DSLCommandNode<S>.() -> Unit)

adds an argument node

executes
Link copied to clipboard
abstract fun executes(executed: suspend S.(context: CommandContext<S>) -> Int)

this will be executed if the currend command is called

literal
Link copied to clipboard
abstract fun literal(name: String, setupBlock: DSLCommandNode<S>.() -> Unit)

adds an Literal (non argument/subcommand) node

require
Link copied to clipboard
abstract fun require(onCheck: suspend S.() -> Boolean)

This will be called to check is there something required runs on each request false -> command will be hidden true(default) -> command will show normally

suggest
Link copied to clipboard
abstract fun suggest(onSuggest: SuggestionsBuilder.(context: CommandContext<S>) -> Unit)

adds an Suggestion provider will run an each suggestion request

Properties

builder
Link copied to clipboard
abstract val builder: ArgumentBuilder<S, *>

Just the brigadier builder

node
Link copied to clipboard
abstract val node: CommandNode<S>

Returns the brigardier node (only works after setup f.e on command execute)

Extensions

runs
Link copied to clipboard
fun <T> DSLCommandNode<T>.runs(executed: suspend T.(context: CommandContext<T>) -> Unit)

Like executes but always return 0, so there is no need to return.

Sources

jvm source
Link copied to clipboard