Solved Watch for a command and do something.

Discussion in 'Plugin Development' started by chriztopia, Dec 3, 2012.

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

    chriztopia

    I want to watch for a command such as... if a player types /time day. I want to be able to pull day out and do something but not stop the command from working. such as if I type /time day it will still change the time to day but then my plugin will do an extra thing. such as sendmessage You changed the time to day! Just an example. I have tryed using the precommand but it is not catching the command.
     
  2. Offline

    ZeusAllMighty11

    Code:
    @EventHandler
    public void onPre(PlayerCommandPreProcessEvent e){
    Player sender = e.getPlayer();
     
        if(e.getMessage().startsWith("/time"){
            // was /time
        }
     
    }
    
    track args with string builder
     
    chriztopia likes this.
Thread Status:
Not open for further replies.

Share This Page