Experience setting bug

Discussion in 'Plugin Development' started by elementalgodz11, Jan 25, 2014.

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

    elementalgodz11

    I am trying to set players exp by the size of a HashMap, however it does not seem to work and shows this glitch;

    http://prntscr.com/2mkwwe

    Here is what I have used, I don't see why it doesn't work

    Code:java
    1. float exp = 30 / lmsers.size();
    2.  
    3. p.setExp(exp);


    Thanks
     
  2. Offline

    Mmarz11

  3. Offline

    WhatAaCow

    elementalgodz11 setExp() is maximum 1F means: 0F = empty experience bar -> 1F = full bar. if you want with procent:

    float xp = 0.01F*procent;
    player.setExp(xp);
     
  4. Offline

    elementalgodz11

  5. Offline

    fish_boss

    I think I am experiencing a similar visual glitch, where the experience bar still shows a higher level than it is set at. I am trying to decrement experience points and it is taking the experience as it should until the bar is completely empty. It still shows the same number but if I get experience orbs they do not show up on the bar (I assume because it is still lower than the amount of levels shown). I think I may try to update the level number manually.
     
Thread Status:
Not open for further replies.

Share This Page