API 8 registered command client tab complete error

图片
The registered command can’t use. Why? Is op.

Code:

It looks to me that you have registered it because otherwise Minecraft would highlight it in red. It’s likely your DataSerializableValueParser that is rejecting things, after all, q is not a valid string representation of a data container.

QUERY is a sub command of ROOT.

Why DataSerializableValueParser reject the command?

Well, the query param should be optional. And I can execute.
The minecraft always saying the command arguments is wrong. But it can be executed normally
图片

Then mark it as optional on the command builder.

That’s not what you originally said. You said “The registered command can’t use”, which I took to mean that the command is failing. You’ve set your command parser to accept SNBT (EpicBanItem/DataSerializableValueParser.java at feature/api-8 · EpicBanItemTeam/EpicBanItem · GitHub) and q is not a valid completion for that. That is why.

The SNBT is param of QUERY. But the q is a alias of QUERY. Why is the param affect the q?

MB