-
-
Notifications
You must be signed in to change notification settings - Fork 74
/help: withFullDescription duplicates usage with entries after unregistering and re-registering command #685
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
CommandAPI version
11.1.0
Minecraft version
1.21.11
Are you shading the CommandAPI?
No
What I did
public final class Plugin extends JavaPlugin {
@Override
public void onEnable() {
new CommandAPICommand("register")
.executes((sender, args) -> {
registerCmd();
})
.register();
new CommandAPICommand("unregister")
.executes((sender, args) -> {
CommandAPI.unregister("testcmd123");
})
.register();
}
private void registerCmd() {
new CommandAPICommand("testcmd123")
.withFullDescription("this is a simple full demo description")
.executes((sender, args) -> {
getLogger().info("testcmd123 executed!");
})
.register();
}
@Override
public void onDisable() {
}
}Using this sample plugin, I performed the following steps:
- started the server
- ran the command
/register - ran the command
/help testcmd123 - ran the command
/unregister
- ran the command
/register - ran the command
/help testcmd123 - ran the command
/unregister
I repeated these steps several times.
What actually happened
The command usage starts duplicating the usage lines based on how many times I repeat this.
This was after the first register + /help:
After the second register (after unregister), it looked like this:
After the third iteration, it looked like this:
This does not happen with withShortDescription, only with withFullDescription.
What should have happened
Well, it shouldn’t do that. It should not append the list, and it should look like this even after N times:
Server logs and CommandAPI config
No response
Other
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working