EssentialsX

EssentialsX

2M Downloads

Option to disable Essentails Commands with colon (fallbacks)

TomLewis opened this issue ยท 11 comments

commented

I have custom settings on /back (cooldown and warmup) which I also have set for /eback and /return aliases, alas some players found that /essentials:back bypasses everything, and there's no way I can stop them using this?!
Same goes or things like /essentials:top
Can we please have an option to disable the use of these? I can't see any reason why a player would need to use these.

Edit: A reddit user pointed out that its possible to block these (with an example from the WorldGuard codebase)
Comment:
https://www.reddit.com/r/admincraft/comments/3zmp4n/how_to_block_plugincommand_bypassing_command/cyoi0rl

Code:
https://github.com/sk89q/WorldGuard/blob/master/worldguard-legacy/src/main/java/com/sk89q/worldguard/util/command/CommandFilter.java#L67

commented

That's minecraft. Though I'm not sure if the plugin prefix gets passed to the plugins or if that's left out by craftbukkit.

commented

The solution posted by Wizjany is what the plugin handling cooldowns would use if I'm reading this all correclty.

commented

@SupaHam that's not a solution that's a "duct tape fix" to something that should be dealt with by the plugin! @SupaHam read the comments by the WorldGuard developer.
This plugin has no control, I just want to disable essentials fallbacks.

commented

This is not possible with Essentials, as the fallbacks are handled by Bukkit. Use something like https://www.spigotmc.org/resources/bukkit-hidden-syntax-blocker.474/

I have no idea what Wizjany is referencing. There is no way to disable the prefixes short of replacing all our command handlers with a hacky PlayerCommandPreProcess and breaking autocomplete.

We can implement a fake command-not-found message with a PlayerCommandPreProcess handler, which is probably similar to what WG is doing. It does not make technical sense to refactor this to sk89q's command framework, which isn't native to Bukkit in the first place.

that's a "duct tape fix" to something

Wizjany's "solution" is the true duct-tape fix here.

commented

@FrozenBeard I don't understand your problem. You say you have custom settings - what plugin is giving you these settings? It would be the responsibility of that plugin to deal with it. As @vemacs said, why would we intentionally disable a useful bukkit feature?

commented

@AdamQpzm Good point I forgot to mention that! I opened a ticket a while ago to have specific cooldowns and warm ups for specific commands like /top and /back, it was never completed #70

So I have had to bodge together a fix for this using mycommand, to put on a cooldown and warmup on these commands that way as an alias for the command.

Im not asking for the essentails:back to be stripped, im asking for a way to disable players using this, there is no reason for them to need/use this at all when they have /back /eback /return already for the same command! the fact its a fallback means I cannot re-map this to disable it using another plugin or commands.yml.

commented

@FrozenBeard It is the responsibility of "mycommand" to fix this problem, not Essentials. The reason WorldGuard have this is because WorldGuard is used to block other commands - they do not block worldguard:command, and we should not block essentials:back.

commented

@AdamQpzm No, no its not. The Fallbacks are being leaked by EssentailsX not mycommand. There needs to be an option to toggle them.

commented

@FrozenBeard sigh No, it is not EssentialX. The fallbacks are introduced by CraftBukkit/Spigot. As I said last time, the reason WorldGuard has the code you linked is because WorldGuard has a feature to block commands in regions - if it didn't check for the fallbacks, people could bypass the disabled commands by using the fallbacks.

WorldGuard does not block worldguard:command by default. Nor does it have an option to do so. No plugin should.

commented

Commands prefixed with the plugin name, such as essentials:, is not introduced by the plugin itself, but by the CraftBukkit software. This fallback is intentional by Bukkit to allow users to specify which command they wish to execute when there are two of the same command (or alias) from two plugins.

As such, we have no control over these fallback commands. If you have a plugin that creates cooldowns for commands and specifying command 'back' doesn't apply the cooldown to /essentials:back, that is the fault of the cooldown plugin. They need to handle this properly themselves.

commented

Alright, Worth asking though, thanks guys.
What would be much much better is getting specific cool-downs and warm-ups fixed for specific commands as requested in #70
This would be absolutely superb.