Solved ServerCommandEvent for dispatchCommand()?

Discussion in 'Plugin Development' started by ron975, Apr 17, 2013.

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

    ron975

    Is there any way I can process a ServerCommandEvent if I do
    Code:
    dispatchCommand(getConsoleSender(),"command here");

    EDIT:
    Figured it out:
    Code:
     
    ServerCommandEvent commandEvent = new ServerCommandEvent(instance.getServer().getConsoleSender(),command);
    plugin.getServer().getPluginManager().callEvent(commandEvent);
    plugin.getServer().dispatchCommand(commandEvent.getSender(), commandEvent.getCommand());
    
     
Thread Status:
Not open for further replies.

Share This Page