ArgumentNode
Scope for building a required argument node. Extends LiteralNode with suggests.
Functions
Link copied to clipboard
Adds a boolean argument.
Link copied to clipboard
Registers the execution handler for this node. Returns Command.SINGLE_SUCCESS automatically.
fun <S, Sender> LiteralNode<S>.executes(platform: PlatformAdapter<S, Sender>, block: ExecuteScope<S>.(Sender, KContext<S>) -> Unit)
Link copied to clipboard
Registers an execution handler that returns a custom Brigadier result code.
fun <S, Sender> LiteralNode<S>.executesResult(platform: PlatformAdapter<S, Sender>, block: ExecuteScope<S>.(Sender, KContext<S>) -> Int)
Link copied to clipboard
Adds a greedy string argument that consumes all remaining input. @see KContext.greedyString
Link copied to clipboard
fun <S, Sender> LiteralNode<S>.requiresPermission(platform: PlatformAdapter<S, Sender>, permission: String)
Requires the source to have the given permission, checked via platform.
Link copied to clipboard
fun <S, Sender> LiteralNode<S>.requiresSender(platform: PlatformAdapter<S, Sender>, predicate: (Sender) -> Boolean)
Requires the platform sender to match a predicate (e.g. to check sender type).
Link copied to clipboard
Adds a quoted or single-word string argument.
Link copied to clipboard
fun <S, T> ArgumentNode<S, T>.suggests(provider: (KContext<S>, SuggestionsBuilder) -> CompletableFuture<Suggestions>)
Registers a dynamic suggestion provider for this argument.
Link copied to clipboard
Registers a fixed set of suggestion values for this argument.
Link copied to clipboard
Adds a single-word string argument. @see KContext.word