Solved Exp bar scaling

Discussion in 'Plugin Development' started by bennie3211, Dec 3, 2014.

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

    bennie3211

    Hello Bukkit,

    I've a question about a plugin that I'm making. I need to scale/edit the exp bar so it can work as a loading bar. I don't know how to get the experience that's needed to fill the full bar, and the minimum experience to make the bar empty at level X. Because the exp bar will work different from +- level 17

    Someone who knows how to?
     
  2. Offline

    Darkpicasa

  3. Darkpicasa I'm not sure what you mean - the OP would like to know how to fill up a certain percentage of the experience bar - the linked method does exactly that :p
     
  4. Offline

    bennie3211

    AdamQpzm AdamQpzm But does that depend on the level the player is? So if the player is level 0 and i do .setExp(0.9F) will give fill the same percentage as someone who's level 50 with .setExp(0.9F)?
     
  5. bennie3211 It's independent of the level - 0.9 will set them to 90% of the experience required for the next level (and, by extension, the experience bar) regardless of whether they're level 1 or 100 :)
     
  6. Offline

    DeadlyScone

    The experience bar is a float value that ranges from 0f to 1f(0f being empty and 1f full) just call the setExp() method and set it according

    Fyi: I believe 0.053 = 1 small bar.
     
Thread Status:
Not open for further replies.

Share This Page