PaperMC / Paper

The most widely used, high performance Minecraft server that aims to fix gameplay and mechanics inconsistencies
https://papermc.io/
Other
9.9k stars 2.29k forks source link

Aliases registered with the Brigadier Command API do not have priority over vanilla commands. #11035

Closed NamiUni closed 2 months ago

NamiUni commented 3 months ago

Expected behavior

Aliases should take precedence over vanilla commands for commands executed by the player or console.

Observed/Actual behavior

Commands executed by the player or console are executed with vanilla commands taking precedence over aliases.

Steps/models to reproduce

public final class PaperPluginExample extends JavaPlugin {
    @Override
    public void onEnable() {
        getLifecycleManager().registerEventHandler(LifecycleEvents.COMMANDS, event -> {
            final var command = Commands.literal("msg")
                    .executes(context -> {
                        context.getSource().getSender().sendMessage("test");
                        return Command.SINGLE_SUCCESS;
                    }).build();
            event.registrar().register(command, List.of("tell", "w"));
        });
    }
}

Plugin and Datapack List

[01:26:28 INFO]: Server Plugins (2): [01:26:28 INFO]: Paper Plugins: [01:26:28 INFO]: - PaperPluginExample [01:26:28 INFO]: Bukkit Plugins: [01:26:28 INFO]: - LuckPerms

Paper version

[01:27:06 INFO]: This server is running Paper version 1.21-46-master@2fa5e0e (2024-07-06T21:32:48Z) (Implementing API version 1.21-R0.1-SNAPSHOT) You are running the latest version Previous version: 1.21-44-8d91b85 (MC: 1.21)

Other

image

log https://pastes.dev/w0RfWFOgUN

This bug occurs even if the command is registered during bootstrapping. Also, this bug does not occur with BukkitCommandAPI. https://github.com/PaperMC/Paper/pull/11011 may have something to do with it.

quiquelhappy commented 3 months ago

we are having issues with this too. it is very annoying.

Emibergo02 commented 3 months ago

Me too

TheosisOfficial commented 2 months ago

Also experiencing this, would be great to have fixed soon!

NamiUni commented 2 months ago

Since it may be challenging to identify or fix the cause of the issue, please try not to put too much pressure on the developers. Thank you for your understanding. :)

Folas1337 commented 2 months ago

Since it may be challenging to identify or fix the cause of the issue, please try not to put too much pressure on the developers. Thank you for your understanding. :)

While I strongly agree with this point, I also think we should still show how much of an impact this is really having by respectfully stating that we're affected by it.

Definitely do not pressure the lovely devs who make this awesome software who should be praised for it BUT still respectfully say you're affected and would like to see this fixed. At least that's my opinion and I just wanted to share it :)

Technofied commented 2 months ago

We're experiencing this issue too. :(

jpenilla commented 2 months ago

Please test the build linked in PR #11186

Folas1337 commented 2 months ago

I tested it with Carbon and it seems to be working fine :) From my point of view, who was originally the one complaining and @NamiUni was the one who reproduced it and then reported it here, this is looking good but we can also get Nami to verify with the thing they created to be absolutely sure and then hopefully get this merged soon(ish) :)