Brigadier

"I'm so proud of that name! Brigadier is the name of the command engine that Minecraft uses."

- Dinnerbone

Brigadier is a command parser and dispatcher, designed and developed for, mainly maintained by Dinnerbone. It is the first library used by Java Edition that Mojang has released under an open-source license.

Usage
Brigadier is used for parsing and executing string commands.

Features

 * Define command nodes with argument or literal branches
 * All the commands available in Java Edition are actually the literal branches available for the root command nodes instead of the actual executed commands.
 * Modify/fork command source in command contexts
 * may modify the command source to be multiple when multiple entities are selected
 * Active inspection on command parsing
 * Listing all possible commands from current command node
 * Handle command result real-time on execution success/failure
 * can store the command result to block/entity NBT data or scoreboard
 * Recursive command node redirection
 * redirects to the root node of the vanilla command dispatcher

Limitations
Brigadier and the older command library (before Java Edition 1.13 snapshot 17w45a) is not reliable as the hack-mastering-like library (like Java source code modifications for cheats-only usage or future hard-coded command library). Brigadier has some limitations for some commands like, resulting in execution failure, but the further future command libraries other than Brigadier will be worked even further functionally without any limitations.

Due to the bug in Brigadier, command suggestions reports "Incorrect argument" with a trailing whitespace without suggestions (MC-165562), and command syntax checks unnecessary whitespaces (i.e. extraneous whitespaces and trailing whitespaces), etc. In fact, the leading whitespaces, extraneous slashes, and whitespaces between commands (e.g.,  ,  ) should also be ignored before command names, if these issues are fixed.

In some commands (mostly like, ), Brigadier still use 32-bit IEEE floating-point for certain arguments redundantly, which can cause the great numeric imprecision and range limitations.

For the further future command library other than Brigadier, the command syntax should use a punctuation marks like semicolon for executing multiple commands at once, commas  for separating command arguments rather than whitespaces, and so on. In fact, the command library must be case-sensitive, especially for defining similar variables with different capitalization and the player names.