elBukkit / MagicLib

A utility library for Bukkit plugins, used by Magic and MagicWorlds
MIT License
3 stars 4 forks source link

[API, FIXED] Get Player's SkillPoints #6

Open zThana opened 7 years ago

zThana commented 7 years ago

Heey,

I'm trying to get the amount of sp a certain player has, but I have no clue how I'd do that using the API.

Could you help me out, please? ;P

NathanWolf commented 7 years ago

Does that mean you figured it out? 👍

zThana commented 7 years ago

Kinda.. I found the method but it isn't showing me any numbers...

NathanWolf commented 7 years ago

Yeah it should just be Mage.getSkillPoints, it would at least show zero. In-game you should see the amount as your XP level while holding a wand.

zThana commented 7 years ago

Not true. It doesn't return anything on my scoreboard, just leaves it empty.

NathanWolf commented 7 years ago

Not the scoreboard, the XP display- the number above your XP bar (mana bar while holding a wand). Magic doesn't use the scoreboard at all.

It should be there unless you've turned off SP or the SP display in your configs.

zThana commented 7 years ago

I've used the API to receive the amount of SP a player has, but it doesn't show up on the scoreboard, it simply returns nothing.

NathanWolf commented 7 years ago

What I am suggesting is that you look at your XP level while holding a wand to make sure you actually have some SP. If it shows zero, then you have zero SP and I'd expect that's what the API will return as well.

The API returns an int, so by "nothing" I'm assuming you mean "0" as it's literally impossible for that method to return nothing.

zThana commented 7 years ago

It's actually empty, nothing shows up

NathanWolf commented 7 years ago

I think you must be doing something wrong in the scoreboard display then... Mage.getSkillPoints returns an int, there's no way for it to be empty. An int will always be something, even if it's zero.

zThana commented 7 years ago

I understand that, I'll pm you my scoreboard class via Spigot

NathanWolf commented 7 years ago

Sure, I may not be much help there though, I've never used the scoreboard.

I'd suggest just printing the SP value to logs or chat for starters just to make sure you've got what you're expecting.