CmdChainScope

Scope used to append the continuation of one argument chain. Nested scopes share the same backing element list.

Types

Link copied to clipboard
fun interface ArgContinuation<T>

Properties

Link copied to clipboard
open override val path: String

Functions

Link copied to clipboard
fun <T : Any> argument(name: String, type: ArgumentType<T>, suggests: SuggestionProvider<ClientCommandSource>? = null, block: CmdChainScope.ArgContinuation<T>)

Appends a required argument and passes its typed handle into the continuation.

Link copied to clipboard
fun exec(handler: Command<ClientCommandSource>)

Declares the executable leaf of this chain.

Link copied to clipboard
fun execSuspend(allowParallel: Boolean = false, handler: KAsyncCommand.Handler<ClientCommandSource>)

Declares a suspending executable leaf of this chain.

Link copied to clipboard
fun <T : Any> optional(name: String, type: ArgumentType<T>, default: T, suggests: SuggestionProvider<ClientCommandSource>? = null, block: CmdChainScope.ArgContinuation<T>)

Appends an optional argument with a non-null default.

fun <T : Any> optional(name: String, type: ArgumentType<T>, default: Nothing? = null, suggests: SuggestionProvider<ClientCommandSource>? = null, block: CmdChainScope.ArgContinuation<T?>)

Appends an optional argument. Omitted values are resolved from the declared default; all following arguments must also be optional.

Link copied to clipboard
open fun t(key: String, vararg args: Any?): MutableComponent

Resolves key under the root command's namespace: only the first segment of path is used, so key must carry the subcommand path itself (e.g. "clear.noFriends" for .friend clear ->liquidbounce.command.friend.clear.noFriends).