EssentialsX

EssentialsX

2M Downloads

Disabled commands are not entirely disabled

TrademarkTM opened this issue ยท 6 comments

commented

Hello!
I'm using EssentialsX v2.0.1 for 1.11, but when I put a command in the disabled commands list, it is not entirely disabled. I'd like to totally remove it's functions.

Example: I disable /clear. But I can use /eclear, essentials:clear, and all the aliases assigned to this command. And to disable all the commands I need, I'd take a looong time to write all these down.

It would be nice to just put the main command (not the alias) and it disables all the aliases and whatever.

Thanks!

commented

I don't see why this should change. It would cause more problems for people who are used to the current way it works. Just add the aliases to the list.

commented

Would be a good idea, but other than that just add/remove the aliases to the list

commented

Aliases is part of solution. I'm more interested in completion cleanup :(

commented

Don't know write this as new issue or not, so i'll write here for now.
I'd like to be able to remove commands from /[tab] autocompletion list and all it's processing by plugin.

Example 1: i disable /xp.
Current: i see "/essentials:xp" at autocompletion; when i execute "/xp" or "/essentials:xp", nothing happens.
Desired: no "/essentials:xp" at autocompletion; when i execute "/xp" it executes "/minecraft:xp"; when i execute "/essentials:xp" server returns "unknown command".

Example 2: i disable /tpa.
Current: i see "/essentials:tpa" and "/tpa" at autocompletion; when i execute "/tpa" or "/essentials:tpa", nothing happens.
Desired: no "/essentials:tpa" or "/tpa" at autocompletion; when i execute "/tpa" or "/essentials:tpa" server returns "unknown command".

commented

@Bodudan Again, the best solution is to use Bukkit aliases in the server's commands.yml. It won't remove tab completion, but you can restore the vanilla /xp command and set the /tpa command to random letters to prevent it from running an actual command.

commented

Disabled commands aren't unregistered, as this would be messy and hacky. Rather, when Bukkit invokes EssentialsX's command handler, EssX checks whether a command is disabled, and if it is it simply does nothing. This means that disabled-commands can be modified in the config and reloaded with the rest of EssentialsX and have the updated list be honoured rather than the old one.

To remove them from tab completion would mean that Spigot would register EssX commands from the plugin.yml, but then we'd need to remove the commands from the command map again. We'd also then need to keep track of which ones were removed and readd them if the disabled commands list changes with a reload.

To me, this seems like a lot of effort for minimal gain. Spigot already inherits CraftBukkit's alias system, which can achieve everything you want it to (including nulling commands) if configured to.