Essentials icon indicating copy to clipboard operation
Essentials copied to clipboard

Option to disable Essentails Commands with colon (fallbacks)

Open TomLewis opened this issue 10 years ago • 11 comments

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

TomLewis avatar Jan 06 '16 21:01 TomLewis

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.

drtshock avatar Jan 06 '16 21:01 drtshock

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

SupaHam avatar Jan 07 '16 04:01 SupaHam

@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.

TomLewis avatar Jan 07 '16 15:01 TomLewis

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.

vemacs avatar Jan 07 '16 15:01 vemacs

@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?

AllieQpzm avatar Jan 07 '16 16:01 AllieQpzm

@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.

TomLewis avatar Jan 09 '16 14:01 TomLewis

@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.

AllieQpzm avatar Jan 09 '16 16:01 AllieQpzm

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

TomLewis avatar Jan 16 '16 12:01 TomLewis

@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.

AllieQpzm avatar Jan 16 '16 14:01 AllieQpzm

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.

SupaHam avatar Jan 16 '16 14:01 SupaHam

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.

TomLewis avatar Jan 16 '16 16:01 TomLewis