Skip to content

Commands

Command trees, arguments, suggestions and reading an invocation.

Type Kind Description
Arg class Factories for the argument types of the vanilla command engine.
ArgType class The type of a command argument: what the client’s command tree shows (parser id + properties) and what the server parses.
AsyncSuggestionProvider delegate An asynchronous suggestion provider (the list is produced off the tick thread, e.g.
Command class Entry point for building command trees: Command.Literal("home").Then(Command.Argument("name", Arg.Word()).Executes(...)).
CommandContext class The parsed invocation of a command: the source and the argument values.
CommandExecutor delegate A command executor: runs the command and returns its result (vanilla semantics: the number /execute store sees; 1 = success).
CommandFailure class Thrown by an executor to fail the command with a message (red text, no stack trace in the log).
CommandHandler delegate A flat command body (Commands.Register("name", ctx => ...)): reads CommandContext.Args and may set CommandContext.Result.
CommandNode class A node of a command tree under construction: a literal word or a typed argument, with children, an executor, requirements and suggestions.
CommandRegistry class Command registration, scoped to a plugin (plugin.Commands).
CommandSource class Who runs a command: a player or the console, with a permission level, a position and a dimension.
DetachedCommand class What a command needed, copied out of a CommandContext so that it can be used after the executor returned (CommandContext.Detach).
RegisteredCommand class A command registered through CommandRegistry.
SuggestionContext class What an asynchronous suggestion provider gets: a copy of the request (the native command context does not outlive the call that started the provider).
SuggestionProvider delegate A suggestion provider: fills the builder with completions for the argument being typed.
SuggestionsBuilder class Collects the suggestions of one argument.