CommandAPI icon indicating copy to clipboard operation
CommandAPI copied to clipboard

Default namespace is used even if a custom one is specified in CommandTree#register(JavaPlugin) | 1.21.8

Open Azimkin opened this issue 1 month ago • 2 comments

CommandAPI version

11.0.0

Minecraft version

1.21.4

Are you shading the CommandAPI?

No

What I did

  • I created a custom class that extends CommandTree and then added some nodes inside
    public static class ExampleCommand extends CommandTree {
        public ExampleCommand() {
            super("example");
            withPermission("example.command");
    
            then(new LiteralArgument("bye")
                    .executes(ctx -> {
                        ctx.sender().sendMessage("bye");
                    }));
    
            executes(ctx -> {
                ctx.sender().sendMessage("Hello");
            });
        }
    }
    
  • registered the command inside onEnable()
    @Override
    public void onEnable() {
        new ExampleCommand().register(this);
    }
    

What actually happened

Plugin ran and the command have been available, but namespaced version looked like /commandapi:example instead of testplugin:example

Image

What should have happened

The command shall be registered under my plugin's namespace testplugin instead of commandapi

Server logs and CommandAPI config

[22:50:59 INFO]: [TestPlugin] Enabling TestPlugin v0.1 [22:50:59 INFO]: [CommandAPI] Registering command /testplugin:example [22:50:59 INFO]: [CommandAPI] Registering command /testplugin:example bye<LiteralArgument> [22:50:59 INFO]: [CommandAPI] Enabling CommandAPI v11.0.0 [22:50:59 INFO]: [CommandAPI] Hooked into Paper ServerResourcesReloadedEvent

in logs everything seems to be okay

Other

No response

Azimkin avatar Dec 07 '25 21:12 Azimkin

Known issue, already fixed in snapshot builds.

DerEchtePilz avatar Dec 07 '25 21:12 DerEchtePilz

Ah, okay, didn't find it across other issues.

Azimkin avatar Dec 08 '25 00:12 Azimkin