Unofficial Command Syntax

I figured I should post this somewhere, so I stop reposting it. Also, I didn’t feel like this would fit the #guides category because this is just an unofficial format for commands that I made.

Currently, this is v2. v1 is available here:

Argument Modifiers

[Specifier][Command] [Required Arg<Arg Type>] (Optional Arg)[Default Value] {Repeatable Args}
There are three types of argument modifiers:

  • Brackets([]) makes something required, the command would fail if unspecified. Any arguments not inside modifiers default to required arg.
  • Parentheses(()) make something optional, and the command won’t error if unspecified.
  • Curly Brackets({}) makes something repeatable. Brackets can follow optional arguments, acting as a default value.
  • Angle Brackets(<>) defines the type of the preceding argument. These don’t work on repeatable args. These can be omitted and will default to text unless it implies a number in which it defaults to int.

The specifier will always be / unless specified otherwise. For simplicity, the specifier is interchangeable with a slash(/).

Hybrid arguments can be formed by placing arguments modifiers inside others like so: {[Mob Name] (Amount)}

A pipe or vertical bar(|) provides alternative values for the argument modifier.
{[ID]|[Name]} is very different from {[ID]}|{[Name]}. The former is either IDs OR names. The latter is either ALL IDs OR ALL Names.

Argument Types

Text

Text is just text: it can be Toxikarp, Golden Shower, ‘S’ Statue, anything. However, if your text contains spaces, you will have to put it in quotes like this: "'S' Statue"

Numbers

Integers

Integers can be negative or positive and are ≥-2147483648 and a max of ≤2147483647. Integers can’t have decimal values, -1 and 4 are valid, but -2.4 isn’t. The term Integer is interchangeable with int.

Int defaults to 32-bit integers. 8-bit ints are ≥-128 to ≤127, 16-bit ints are ≥-32768 to ≤32767, and 64-bit ints are ≥-9223372036854775808 to ≤9223372036854775807.

Int also defaults to signed, meaning they can have signs, either positive or negative. Unsigned ints can only be positive. All unsigned ints have a min of 0. 8-bit ints are ≤255, 16-bit ints are ≤65535, 32-bit ints are ≤4294967295, and 64-bit ints are ≤18446744073709551615. Unsigned can be shortened to the letter u, creating uint.

Ints default to base-10(Decimal), there’s also base-2(Binary), base-8(Octal), base-16(Hexadecimal or Hex), and many others. But I’ll only be using Base-16, mostly for color codes.

Decimals

Decimals are ints, but with one difference: they can have fractional parts. They can’t use the prefixes ints use for complicated reasons.

4 Likes

I didn’t create the syntax itself. I saw the use of brackets and parentheses as required/optional, and I liked it. Over time I added onto it with curly brackets

3 Likes

Here’s a command I made up :
/breaksyntax [(how many times to break syntax)]

2 Likes