Solved PlayerPoints API issues

Discussion in 'Plugin Development' started by OTF Catastrophe, Dec 16, 2016.

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

    OTF Catastrophe

    So I've been trying to work out how to use PlayerPoints API and I was trying to make a plugin that makes ranks depending on how many points a player has. I made a thread asking if anyone could make it but no one has replied yet so I figured i should give it a try until I get a reply from someone. The issue I'm having is trying to get the players points. So my classes are as follows,

    Main: http://pastebin.com/KLYvvymC
    ChatEvent: http://pastebin.com/ft5mPi6F

    So for the Main class I know I have some unimplemented methods but that'll come in the future when I need it. In the ChatEvent class I have one method that simply just sends the player a message with how many points they have, if they have less than 100 points. This isn't going to go into the final code but I used it just to test and see if getting the int from the players points would actually work but it doesn't. When I try to talk in chat it doesn't send me a message at all if I have the "balance" int within a message. Also if I try making it into a command just to send the player a message with the balance in it, it says theres an Internal Error and it throws an NPE inside of console. Can anyone help me understand a little bit on how to use the API?
     
  2. Offline

    Zombie_Striker

    1. don't log your own plugin.
    2. You never initialize PlayerPoints.
    3. You never call "setUpChat".
     
  3. Offline

    OTF Catastrophe

    1. Slightly confused what you mean by this.
    2. EDIT: Found what I did wrong, all fixed thank you. :)
    3. Like I said, there's methods that I haven't initialized yet. But that'll be used in the future.
     
    Last edited: Dec 16, 2016
  4. Offline

    Zombie_Striker

    Code:
             System.out.print("SkylandSWRanks has been enabled!");
    This is logging your plugin. Bukkit already prints this out. There is no reason to display this message twice. You should delete this line.
     
  5. Offline

    OTF Catastrophe

    Ahh alrighty thank you I just looked at my console and saw that aha. Issue is all fixed, thanks again. :)
     
Thread Status:
Not open for further replies.

Share This Page