CmdLiteralScope

Root scope of a command declaration; receives the top-level nodes declared in the block of literal(...).

Argument chains are declared inline with argument/optional; each call opens a nested scope whose block declares the continuation, ending in exactly one executor (exec/execSuspend) per chain.

Properties

Link copied to clipboard
open override val path: String

Functions

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

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

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

Declares an executor directly on the literal: the handler runs when the input ends here. Use execSuspend for suspending handlers instead.

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

Declares a suspending executor directly on the literal, scheduled like CommandExecutor.executesSuspend (progress message and re-entrance guard included).

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun literal(name: String, aliases: List<String> = emptyList(), block: CmdLiteralScope.() -> Unit)

Declares a nested command literal. aliases are extra names registered as redirecting siblings under the same parent (e.g. .localconfig create for save).

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

Declares an optional argument with a non-null default and typed handle.

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

Declares a nullable optional argument and passes its typed handle into the continuation.

Link copied to clipboard
fun <T> CmdLiteralScope.pagedList(pageSize: Int = 8, header: () -> Component, items: () -> Collection<T>, eachRow: (index: Int, T) -> Component)

Adds a list [page] subcommand with the same paging UI as pagedQuery.

Link copied to clipboard
fun <T> CmdLiteralScope.pagedQuery(pageSize: Int = 8, header: () -> Component, items: () -> Collection<T>, eachRow: (index: Int, T) -> Component)

Adds the optional page argument and executor to this literal (e.g. .help [page]). For a listing that lives under list, use pagedList.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Gates execution of this command behind predicate.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
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).

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard