Change No Permission Message

Discussion in 'Spigot Plugin Development' started by AllenF, May 12, 2016.

  1. Is there a way to create a plugin that will change the no permission message of every command. I would like commands to return "Unknown Command" whenever the player does not have permission so that it is unknown which plugins/commands the servers has.

    Thanks for your help.
     
  2. In PlayerCommandPreprocessEvent, you can check if the message starts with e.g. /test, cancel the event and send a custom message to the player :)
     
    • Like Like x 1
  3. That doesn't solve the problem :p

    Im looking to see if the player has permission to do an event. If they don't the failure message send is "Unknown Command" so that it looks like the command does not exist. If there was a noPermission Failure event, that would be ideal. But since there isn't, I'm looking for a work around.
     
  4. That message is hardwired in to most plugins
     
  5. So there isn't a way to do this?
     
  6. It's possible by manually testing each command and the permission
     
  7. So there isn't any systematic way that doesn't require manually imputing permissions?

    No Event called upon command failure?
     
  8. Theyre checking if they have the permission, and if not sending a hardwired message
     
  9. Again, Im aware of how commands work, I'm looking for a work around if one exists
     
  10. I'm afraid there's not a way to do this. As Joe said, each plugin checks for the permission on its own, and if the player does not have permission, sends their own message. If the plugins you use have language files, you could potentially change the message in there. Otherwise you're out of luck.
     
  11. You can try contacting the developer for a custom version if the lang doesn't exist.