此条目的(部分)内容需要翻译。
你可以帮助我们来翻译此条目,但请勿使用机器翻译。
此特性为Java版独有。
Brigadier
| Latest version | |
|---|---|
| GitHub repository | |
| Written in | |
| Author | |
| License |
MIT License |
“
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]
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.[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 storecan store the command result to block/entity NBT data or scoreboard
- Recursive command node redirection
/execute runredirects to the root node of the vanilla command dispatcher
History
Template:H Template:H Template:H
Template:H Template:H
References
- ↑ “Programmers: Play with Minecraft's Inner Workings!” – Minecraft.net
- ↑ Mojang/brigadier: Brigadier is a command parser & dispatcher, designed and developed for Minecraft: Java Edition. — GitHub。
- ↑ Contributors to Mojang/brigadier — GitHub。
- ↑ “We just pulled in our very first community contributed code into a Minecraft Java Edition official library. Woo! 🎉 Want to help out? The first library we've opened is our command engine - it's MIT licensed so you can freely use it in your own projects!” – @Dinnerbone
- ↑ Added copyright header, LICENSE, and README.md by Dinnerbone · Pull Request #8 · Mojang/brigadier ,来自boq。 Mojang/brigadier – GitHub。“I'd argue that most people identify command by first literal after root, so that would make "command" a sub-tree and not just path leading to leaf node. /bikeshedding”
- ↑ Inspecting a command — Mojang/brigadier – GitHub。
- ↑ Displaying usage info — Mojang/brigadier – GitHub。
- ↑ "Preparation for OSS :)" - Preparing for the open source software – Mojang/brigadier – GitHub
| October 25, 2014 | Dinnerbone mentions Brigadier in the comments on MC-10880. | ||||
|---|---|---|---|---|---|
| September 26, 2018 | Brigadier is open sourced the under MIT License.[8] | ||||
| 版本 | |||||||
|---|---|---|---|---|---|---|---|
| 开发周期 |
| ||||||
| 技术 |
| ||||||
| 多人游戏 | |||||||
| 游戏订制 | |||||||
