Mod command trees: command.set-tree and set-suggestions, typed parse, colouring and completion from one tree (API 19)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -106,6 +106,13 @@ What real mods need next, in the order modpacks and servers need it:
|
||||
|
||||
## Changelog
|
||||
|
||||
- API level 19 (AirDef fork, capability `command`): `set-tree` gives a client mod's command a tree of subcommands
|
||||
(literals), typed words (`word`, `choice`, `integer` and `number` with bounds, `names` from a list, `block-pos`),
|
||||
optional branches (`runs`), the rest of the line (`text`) and `key=value` options; `set-suggestions` sets the list a
|
||||
`names` node suggests from. The chat box colours the line, shows the error and completes the next word before
|
||||
Enter, and a line that does not parse never reaches the mod; one that does gets the line as it was typed. The
|
||||
plain `registration.commands` name stays the free-text fallback. SDK `tree::{Tree, Node, Value, Opt}`: `register`,
|
||||
`parse`, `complete`, `usage` from the same nodes.
|
||||
- API 0.3: typed server commands: `registration.commands` lists each command's arguments (`argument-kind`: word,
|
||||
text, integer, number, boolean, player, block-pos), sent in players' command trees and parsed by the server;
|
||||
`command` gets their values. SDK `Registration::command_with`, `Argument`, `Args`.
|
||||
|
||||
Reference in New Issue
Block a user