Problem about check command's arguments

Discussion in 'Plugin Development' started by mewsf, Aug 25, 2014.

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

    mewsf

    I'm trying to check a command's arguments before it's going to be performed like"/give xxx xxx" if its be in line with my requirements, but i only find "PlayerCommandPreprocessEvent " , i think it would only detect the players' actions, but i also want to do this on command blocks. Ideas?thx.
     
  2. Offline

    TheMcScavenger

    You are indeed looking for the PlayerCommandPreprocessEvent, and you're right about the fact that this won't detect Command Block commands. It also won't detect commands executed in console.
     
  3. Offline

    TheOddPuff

    Server executed commands commands can be caught via the ServerCommandEvent. I don't think you can catch commands executed by command blocks.
     
  4. Offline

    GriffinPvP

    There's also the ServerCommandEvent, which fires when the console executes a command, I'm not sure if it fires when command blocks do.
     
  5. Offline

    mewsf

    But it seems that it can't be cancelled.
     
  6. Offline

    TheOddPuff

    mewsf Yes, you cannot cancel it.
     
  7. Offline

    mewsf

    bump.
     
  8. Offline

    Necrodoom

Thread Status:
Not open for further replies.

Share This Page