Solved [Help] Disabling /help

Discussion in 'Spigot Plugin Development' started by SwagiWagi, Jun 9, 2016.

  1. Hey guys!

    How do I edit/disable the /help//? commands?
  2. Upon command
    If command equals whatever
    • Agree Agree x 1
  3. I don't get it.
  4. Code (Text):
        public void onCommand(PlayerCommandPreprocessEvent e){
            if (e.getMessage().equalsIgnoreCase("/help")){
    • Useful Useful x 1
  5. The given answers will not work 100% of the time. There are outside factors that need to be considered and compensated for.

    First, equalsIgnoreCase("/help") is ignoring so many use cases it might as well not even be there at all. Like, what if I typed in /help bukkit or /help essentials. The command would still work and not get cancelled. You could change it to startsWith("/help") but then things like /HeLP and /heLp will still work. You will need to toLowerCase() on the message and then do startsWith("/help").

    But thats only one of the many issues that arise. I could easily type /minecraft:help to get the vanilla /help command. Or I can type /essentials:help to get the essentials version of the /help command. There are other plugins out there that also provide access to /help command, too. And most of them have their own set of aliases for it as well (/h /hlp etc).

    Many things need to be considered here to get the desired effect of cancelling help. However, I must state that cancelling help doesnt make much sense to me. It is a vital command to new users. But, to each their own. Just wanted to point out that to cancel a command takes more work than most people realize. ;)
    • Agree Agree x 4
  6. Thanks!
  7. i din't even think of that !