You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes I want to create ClickEvent to execute commands, and I don't want them show up in suggestions.
It's there a way to create hidden subcommands that will not show up on tab complete?
Expected code
newCommandAPICommand("system")
.withSubcommands(
newCommandAPICommand("reload")
.executes((CommandExecutor) (sender, args) -> sender
.sendMessage(Component
.text("Are you sure?")
.clickEvent(ClickEvent.runCommand("/system reload-confirm"))
)
),
newCommandAPICommand("reload-confirm")
.hidden(true) // this command will not show up in suggestions
.executes((CommandExecutor) (sender, args) -> Bukkit.getServer().reload())
).register();
Extra details
No response
The text was updated successfully, but these errors were encountered:
We already have a similar issue open: #409
A subcommand is converted to a literal value internally which in turn is basically suggested instantly when Brigadier sees one of them.
You may also want to look into the linked issue as @willkroboth explained it a bit better than I did here.
It's a bit jank, but it might work for this situation? StringArgument can have its suggestions controlled and, by default, it doesn't suggest anything.
Description
Sometimes I want to create
ClickEvent
to execute commands, and I don't want them show up in suggestions.It's there a way to create hidden subcommands that will not show up on tab complete?
Expected code
Extra details
No response
The text was updated successfully, but these errors were encountered: