Disable player commands

Discussion in 'Plugin Development' started by Rabrg, Jul 2, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    Rabrg

    How would I disable player commands? I've thought about using the onCommand boolean but that doesn't get invoked unless the the command is registered within the plugin.
     
  2. Offline

    Rocoty

    Listen for PlayerCommandPreprocessEvent and cancel it.
     
  3. Offline

    Rabrg

    That gets invoked for all commands and not just the ones registered?
     
  4. Offline

    Rocoty

    When a listener listens for a PlayerCommandPreprocessEvent, it listens for the event that is called whenever a player performs a command, any command, from any plugin (including CraftBukkit itself).
     
    Rabrg likes this.
  5. Offline

    Rabrg

    Thanks.
     
    Rocoty likes this.
  6. Offline

    Rocoty

    You're welcome
     
Thread Status:
Not open for further replies.

Share This Page