Command Syntax
What the console accepts on a line, and why.
| Form | Meaning |
|---|---|
kick bob | bare words |
kick "big reason" | quoted value, spaces preserved |
kick 'big reason' | single quotes work the same |
--silent | presence flag |
--reason=spam | flag with a value |
--reason="spam bot" | quoted flag value |
say hello\ world | backslash escapes the next character |
Picking players
Anywhere a command takes a player, you can name one, or use a selector.
| Selector | Means |
|---|---|
@me | you |
@all | everyone in the server |
@others | everyone except you |
heal @me one player: yourself
speed @all 50 everyone
bring @others everyone but you
kick bob by name
kick bo a unique prefix is enough
speed bob,alice 50 a comma list
speed @others,bob 50 selectors and names mixNames match on username and display name, case-insensitively. An exact match always wins; a prefix works when it is unambiguous, and "al" is ambiguous tells you when it is not. Duplicates are dropped, so @all,@me still means everyone once.
@all and @others only work where a command takes several players. A command that acts on exactly one, such as goto and kick, rejects them and rejects comma lists too.
Rules worth knowing
- Quotes open a quoted section only at the start of a word or immediately after
=. That is what letsban bob don't spamwork while--reason="spam bot"still groups correctly. - A backslash makes the next character literal. There are no letter escapes, so
\nis the lettern. - Flag values require
=.--flag valueis not supported, because without a command schema there is no way to tell a flag value from a positional argument. - Only
--longflags exist. There is no-sshort form, sosetgravity -5stays a number. - An unterminated quote is a diagnostic, not a crash. The console keeps parsing while you type.
- Input longer than
Tokenizer.MaxInputLength(2000 characters) is refused outright rather than parsed. That is far above any real command while still bounding the work a hostile client can cause.
Under the hood
The tokenizer, parser and binder are three independent modules you can use directly. See the Parsing API. The client runs exactly the same code the server does, which is how the console underlines a bad argument without a round trip.