Receiving Player Inputs

Discussion in 'Plugin Development' started by DeathJockey, Aug 9, 2011.

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

    DeathJockey

    I am wandering what code is required to receive player inputs?
     
  2. Offline

    Warpdrive

    There isn't really a specific way to grab the user's input, instead you could send the user a message like:
    "How many blocks in a 6x6x6 cube? Please respond with: /answer <answer>"
    Then have onCommand pick up the answer command...
     
  3. Spout exposes the keyboard AFAIK.
     
  4. Offline

    DeathJockey

    Oh, so I am kind of new to Java, how does onCommand work (I mean the code)
     
  5. Offline

    Warpdrive

    I have no clue on how to use Spout :D. onCommand is a boolean return function in the JavaPlugin class. onCommand takes several parameters such as a sender, command, arguements, etc. To check if the player has entered the command you are looking for, you would see if the command string equals 'answer' or another command you are looking for. I'd suggest looking at some simple bukkit plugin tutorials (Adamki11s tutorial) if you have no idea what onCommand is....
     
Thread Status:
Not open for further replies.

Share This Page