Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Brigadier

From SAS Gaming Wiki
Revision as of 11:03, 24 July 2026 by SyncBot (talk | contribs) (Sync: new page from Minecraft)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Template:Exclusive Template:Infobox program Brigadier is a Minecraft:command parser and dispatcher, designed and developed for Template:El,<ref>Template:Link</ref> mainly maintained by Minecraft:Dinnerbone.<ref>Template:Link</ref> It is the first library used by Java Edition that Minecraft:Mojang has released under an open-source license.<ref>Template:Tweet</ref>

Usage

Brigadier is used for parsing and executing string commands.

Features

Limitations and issues

Brigadier has various numbers of limitations while executing the command, such as the numeric limitations on integer data types such as Template:Command, Template:Command, and floating-point data types such as Template:Command, making many integer values parsed in the commands inaccessible.

Minecraft argument types

Template:Disclaimer More general documentation on brigadier and its use can be found at the github repository, however this is information specifically on the argument types added and used in Minecraft. While basic implementation of commands may vary by mod loader, these argument types are mostly consistent. Your chosen mod loader probably has its own documentation for how to actually register commands using Brigadier.

Argument types
Class name Description Example
Commands.literal A fixed keyword that must be typed exactly. /datapack list
StringArgumentType.greedyString Will match the longest possible string of letters (only works at the very end of a command). /say all of this will be in the greedy string
StringArgumentType.word Will match the longest string of letters without spaces. /tag @s add oneword
StringArgumentType.string Will match the longest string of letters without spaces, unless surrounded by quotation marks. Similar to greedyString, but can have more arguments afterwards. /datapack enable "multiple words" last
BoolArgumentType.bool Can only be true or false. /gamerule keepInventory true
IntegerArgumentType.integer A Java int. Must be a whole number. This argument can optionally have a minimum value, or a minimum and maximum value. /scoreboard players set @s objective 100
LongArgumentType.longArg A Java long. Must be a whole number. Similar to int, but can store much larger numbers. This argument can optionally have a minimum value, or a minimum and maximum value. Not used in any commands
FloatArgumentType.floatArg A Java float (6 digits of precision). Can have decimals. This argument can optionally have a minimum value, or a minimum and maximum value. /playsound minecraft:ambient.cave master @s ~ ~ ~ 1.23456
DoubleArgumentType.doubleArg A Java double (15 digits of precision). Can have decimals. This argument can optionally have a minimum value, or a minimum and maximum value. /attribute @s minecraft:generic.movement_speed base set 12.345678912345

(See more about Java ints, longs, floats, and doubles here)

History

Template:HistoryTable

Version history

Version Date Changes
1.0.15 September 26, 2018<ref>Template:Cite</ref>
  • Initial release
1.0.17 February 19, 2019<ref>Template:Cite</ref>
  • 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<ref>Template:Cite</ref>
  • Performance optimizations

Gallery

See also

References

Template:Reflist

Navigation

Template:Navbox Java Edition technical

Minecraft:fr:Brigadier Minecraft:ja:Brigadier Minecraft:pt:Brigadier Minecraft:zh:Brigadier