Brigadier

"Minecraft tells Brigadier: "These are the things that players can do. Tell me once the player's trying to do this." So when a user types in chat, that goes through Brigadier. Brigadier splits it up, it error checks it, it tries to be as helpful as it can. You’ve also got this lovely pop-up window when you're typing that can suggest what the next bit might be."

- Tom Stone

Brigadier is an open source library for using commands in Java Edition. It is mainly maintained by Dinnerbone.

Usage
Brigadier is used by the Minecraft game 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