Newbie needs quick help

Discussion in 'Plugin Development' started by antondubek2, Feb 26, 2015.

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

    antondubek2

    I have just started learning the concepts of java and now trying to apply them into the world of plugins to try get some practice. I was trying to play around with teleporting a player to a random set of co-ordinates (something I thought would be simple) but after trying numerous ways of doing it and tutorials still no luck. Can anyone point out whatI'm doing wrong it would be much appreciated.

    Java code : http://pastebin.com/5NpqjBwV
    plugin.yml : http://pastebin.com/fuz9ekqv

    I may be well off track or may be something small but any help would be great. The first command works fine, the second goes through, I get no error in console just nothing happens

    Thanks
    Anton
     
  2. Offline

    Konato_K

    @antondubek2 All the commands are run in the onCommand method, you can't create a "onCommand1" or any other method to handle this.

    Put all your commands in the onCommand, just use an else if to check for the second one.

    Alternatively you can create a new class (that implements CommandExecutor) and set the Executor of the command.

    I suggest reading this http://wiki.bukkit.org/Plugin_Tutorial#Commands
     
  3. Offline

    teej107

  4. Offline

    antondubek2

    Much appreciated all
     
Thread Status:
Not open for further replies.

Share This Page