EssentialsX

EssentialsX

2M Downloads

Commands from other plugins don't take priority over Essentials' commands on 1.19.4

fuwko opened this issue · 2 comments

commented

Type of bug

Compatibility issue

/ess dump all output

https://essentialsx.net/dump.html?id=e2a083bb43e0ec52d28443d4b33a7be4

Error log (if applicable)

No response

Bug description

According to the description that disabled-commands provides in the configuration file, commands from other plugins should take priority over EssentialsX's commands. However, when running on 1.19.4 (not sure about 1.20.1), this doesn't seem to be happening:

# Disabling commands here will prevent Essentials handling the command, this will not affect command conflicts.
# You should not have to disable commands used in other plugins, they will automatically get priority.
# See http://wiki.bukkit.org/Commands.yml#aliases to map commands to other plugins.
disabled-commands:
#  - nick
#  - clear

Using an alias of the /ping command that our plugin registers (/cping in this case) works just fine (and it always should since it is an alias), but using /ping doesn't. The message set on messages_es.properties is the same one that appears when using /ping and a log by Essentials always appears when using it, so it definitely has to be EssentialsX:

pong=§e¡PONG\!

Not to mention the only results containing ping when running ? from the console are by EssentialsX and our plugin. The full output of the command can be seen in the dump generated by /ess dump all.

I initially assumed the bug was because of how our command library registers commands (we're not required to register them in the plugin.yml file), but the weird thing here is that it works just fine on 1.12.2.

The command library we use is open-source and the code is available here. It registers commands like this (which also seems to be the same way that aikar's command framework does it):

https://github.com/TriumphTeam/triumph-cmds/blob/5a1cb339c950ec8aa08328f4979146513bce06e8/minecraft/bukkit/src/main/java/dev/triumphteam/cmd/bukkit/BukkitCommandManager.java#L159-L171

Steps to reproduce

  1. Run a 1.19.4 server with EssentialsX
  2. Add a plugin that should override an EssentialsX command
  3. Try to run the new plugin's command

Expected behaviour

EssentialsX should not override the new plugin's command

Actual behaviour

EssentialsX overrides the command registered by the new plugin

commented

What does the plugin.yml entry look like for your ping command?

commented

Register the command within your plugin.yml file or add it to the disabled commands section in our config. EssentialsX isn't going to check for alternative commands on EVERY command execution and you're registering your command after Essentials looks for alternatives