Mana with exp bar

Discussion in 'Plugin Development' started by EpicCraft21, Jan 30, 2015.

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

    EpicCraft21

    Hi guys, I'm currently working on a mana plugin that shows how much mana you have using the exp bar.
    I don't know how to make it regenerate every few seconds, how to set the maximum so the mana can reach a cap, or how to remove some exp (say when a player casts a spell and it uses up some mana).

    Sorry, I cannot post my code here as I am on an IPad, I will get back to that as soon as possible.
    If I have not explained very well or you need anything, I will be happy to correct my mistakes, and thanks again to anyone if they can help me.
     
  2. Offline

    guitargun

    Simple you can work with percentages since the xp in the bar works with floats (I think or in int alone)
    Get the percentage value of the max. Then with regenerating get how much percent it regenerates

    Or

    If the level stays the same you can use a standard value an add that to the current xp
    It is basic stuff as mentioned in the post before me
     
  3. Offline

    EpicCraft21

    I don't really work around with EXP that much, I'm not asking for a code, but could you send me the link for the bukkit APIDocs for this particular piece?

    Man, what I just said made no sense.


    EDIT: Nevermid, I found it here. http://jd.bukkit.org/rb/apidocs/org/bukkit/entity/Player.html#getExp()

    Darn it, I know I double posted. Can anyone change that?
     
    Last edited by a moderator: Jan 31, 2015
  4. Offline

    eyamaz

    sure!
     
Thread Status:
Not open for further replies.

Share This Page