Need help with a very simple plugin

Discussion in 'Plugin Development' started by foldagerdk, Jun 10, 2012.

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

    foldagerdk

    Hey!
    I got a plugin that has a bug that I can't seem to squash.
    When doing /tickleme the plugin is supposed to send a message saying "TICKLE TICKLE TICKLE!" and it does. So that works fine.
    But when it comes to the /tickle <player> it doesn't work.
    It's supposed to send a message to both sender and receiver saying that one got tickled by another.

    Here's my code:
    http://pastebin.com/gqVhdXEa
     
  2. Offline

    caldabeast

    What I would do to handle the players:
    Code:
    for(Player plr : Bukkit.matchPlayer(args[0])){
         plr.sendMessage("TICKLE!!!");
         sender.sendMessage("You tickled " + plr.getName());
    }
    
    Written on my phone, so might not be 100% accurate
     
  3. Offline

    foldagerdk

    I would really like to know what I did wrong with my code so I can learn something from it, but thanks anyways..

    Nevermind, I got the code all fine and working now!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 26, 2016
  4. Here I cleaned up your code and added some helpful comments. I see you have got it working but I had already started helping so might as well finish :p

    I put it up on pastie for you ;)

    http://pastie.org/4064018
     
Thread Status:
Not open for further replies.

Share This Page