Minecraft Wiki

除另有声明,转载时均必须注明出处若簡繁轉換出錯,請以遊戲內為準请勇于扩充与修正内容有兴趣逛逛我们的微博沟通交流,欢迎到社区专页需要协助,请在告示板留言

了解更多

Minecraft Wiki
Advertisement
Ic translate
此条目的(部分)内容需要翻译。

你可以帮助我们来翻译此条目,但请勿使用机器翻译

Information icon
此特性为Java版独有。
Brigadier
最新版本

1.0.17

GitHub仓库

brigadier

编写语言

Java

开发作者

Mojang AB

授权协议

MIT协议

Dinnerbone-twitter

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

——Dinnerbone评论于Brigadier[1]

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

用途

Brigadier is used for parsing and executing string commands.

特性

  • 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.[5]
  • Modify/fork command source in command contexts
    • /execute as <target selector> may modify the command source to be multiple when multiple entities are selected
  • Active inspection on command parsing[6]
  • Listing all possible commands from current command node[7]
  • Handle command result real-time on execution success/failure
    • /execute store can store the command result to block/entity NBT data or scoreboard
  • Recursive command node redirection
    • /execute run redirects to the root node of the vanilla command dispatcher

历史

October 25, 2014Dinnerbone mentions Brigadier in the comments on MC-10880.
July 27, 2017Dinnerbone discloses a non-obfuscated command parser library called "brigadier".
Java版
1.1317w45aCommands are now handled with Brigadier.
Minecraft introduces Brigadier as a dependency.
September 26, 2018Brigadier is open sourced the under MIT License.[8]
1.1419w08aAllows single quotes for strings in commands.[9]


参考

Advertisement