Brigadier

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 and issues ==
Brigadier has various numbers of limitations while executing the command, such as the numeric limitations on integer data types such as , , and floating-point data types such as , making many integer values parsed in the commands inaccessible.
Since 1.15, whenever the chat cursor is positioned at the start of a node after a whitespace character, command suggestion will say "Incorrect argument for command at position " instead of displaying the command suggestions, especially the command arguments that requires numbers or strings before parsing and the trailing spaces beyond the command argument list.
== History ==
=== Version history ===
Version	Date 	Changes
1.0.15 	September 26, 2018	
*Initial release
1.0.17 	February 19, 2019 	
*Allow single quotes in strings
*Added long argument
*Implement calculation of suggestions for any text position
*No longer depend on Guava
1.0.18 	July 16, 2021 	
*Peformance optimizations
== Gallery ==
execute graph.svg|The command tree, which utilizes an overwhelming amount of the brigadier features.
tag graph.svg|The command tree, showing the difference between actual executed commands (red nodes) versus the first literal after the root (the "tag" box)
msg graph.svg|The command tree, showing that aliases have been implemented by brigadier's command node redirection functionality (dashed lines)
== References ==
fr:Brigadier
pt:Brigadier
zh:Brigadier