PlayerCommandPreProcessEvent

Discussion in 'Plugin Development' started by Cryices, Nov 2, 2013.

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

    Cryices

    Hey, is there any way I could get this event to also work for console, I mean, I'm using this to create a command (don't ask, its easier for what I'm doing please). Don't say its only for players, I'm looking for a solution lol.

    Forgot to mention, I also need a way to get the player, and to get the message (like with PlayerCommandPreProcessEvent)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 5, 2016
  2. Offline

    sgavster

    Cryices use oncommand..
    PHP:
    public boolean onCommand(CommandSender senderCommand cmdString commandLabelString[] args) {
    if(
    cmd.getName().equalsIgnoreCase("consolecommand") {
    if(
    sender instanceof ConsoleCommandSender) {
    //do stuff
    }
    }
    }
     
  3. Offline

    finalblade1234

    Well, you could use onCommand(). there is no other way to implement commands in the console.
    EDIT: sgavster beat me to it
     
    sgavster likes this.
  4. Offline

    Cryices


    Gee, really? Well I tried that, but i'm trying to find an easier way, because i already tried ServerCommandEvent. But if its what it comes too, I will use a command


    fine :! I'll use a command! Darnit!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 5, 2016
  5. Offline

    finalblade1234

    Alright, if you need any help with it ask me =)
     
Thread Status:
Not open for further replies.

Share This Page