Is there a way to override commands of an other plugins? Removing the commands from the other plugin.yml doesn't work, since it sets an executor.
What? I remove 3 commands from Essentials in my plugin by removing them from plugin.yml... And if I am correct, Essentials uses executors...
I haven't actually tried this, but you could try using onCommandPreprocess to check for the command, and cancel the event if the command is used. I'd assume that would work, but I've only used Preprocess for commands not registered in another plugin's yml... E: I could have sworn removing commands from yml when executors (as opposed to just onCommand) are used causes NPEs, but I may be wrong...
Don't know, I'm tryin to override the WorldEdit superpickaxe commands. Removed them from the plugin.yml and saw no effect. But to listen for the commands with the preprocessor, cancle them and call my ommands sound like a good idea by now. EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Yeah that's how my plugin disables them, but some people report it not working, not everyone though, so I do not know what to think.
Found a solution: Since WorldEdit doesn't care about a cancelled event, I set the command to "dummy": Code: public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) { if (!event.isCancelled()) { String msg = event.getMessage().toLowerCase(); if (msg.equals("//") || msg.equals("/,")) { event.setMessage("dummy"); event.setCancelled(true); getServer().dispatchCommand(event.getPlayer(), "spa"); } } } EDIT: Thanks for the hint with the command preprocessor
Oh, so THAT's why some plugins still do the command, they use preprocess too and do not care about cancelled