Getting an argument from PlayerCommandPreprocessEvent

Discussion in 'Spigot Plugin Development' started by Justin393, Jun 6, 2015.

  1. So basically, I want to intercept the /ban command and teleport a player somewhere, kill them, causing their inventory to drop allowing anyone to get it. So how would I get arguments from the Event? Or is there a simpler way to do this that I'm missing?

    EDIT: Also, how exactly does PlayerCommandPreprocessEvent#getMessage() work? Does it stop checking after the initial command? For example, if I want to block the command /me would just doing event.getMessage("me") work? Or would that not work correctly?
     
  2. So i know I am missing something here, and i just did not read it, but why don't you use the onCommand() method and get the arguements from there?
     
  3. I want a different plugin to handle the bans, I just want to intercept it and do something before they're kicked, and then let the other plugin handle it.
     
  4. oh i see! Oki, thanks for more information xD