Skip to content

Command Syntax

What the console accepts on a line, and why.

FormMeaning
kick bobbare words
kick "big reason"quoted value, spaces preserved
kick 'big reason'single quotes work the same
--silentpresence flag
--reason=spamflag with a value
--reason="spam bot"quoted flag value
say hello\ worldbackslash escapes the next character

Picking players

Anywhere a command takes a player, you can name one, or use a selector.

SelectorMeans
@meyou
@alleveryone in the server
@otherseveryone 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 mix

Names 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 lets ban bob don't spam work while --reason="spam bot" still groups correctly.
  • A backslash makes the next character literal. There are no letter escapes, so \n is the letter n.
  • Flag values require =. --flag value is not supported, because without a command schema there is no way to tell a flag value from a positional argument.
  • Only --long flags exist. There is no -s short form, so setgravity -5 stays 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.

Released under the MIT Licence.