Help fast!

Discussion in 'Plugin Development' started by 55razvan55, Apr 4, 2014.

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

    55razvan55

    Hey, I need help with a plugin, bassically I am changing a player's nametag color using TagAPI and then I want to have a scoreboard displaying the player's health under the name, but it always displays 0 if the player's nametag's colored.

    Ideas?
     
  2. Offline

    Rocoty

    Code!
     
  3. Offline

    jthort

  4. Offline

    55razvan55

  5. Offline

    jthort

    55razvan55 Then as he said
     
  6. Offline

    55razvan55

    Lol ...
     
  7. Offline

    Rocoty

    55razvan55 Let me elaborate

    Show us what you've got so far.
    Post code -> quicker help
     
  8. Offline

    55razvan55

    Code:java
    1. for(Player online : Bukkit.getOnlinePlayers()) {
    2. online.setScoreboard(board);
    3. Score score = objective.getScore(online);
    4. score.setScore((int) ((Damageable)online).getHealth());
    5. }

    That's the part which sets the score.

    And as in any other plugin using TagAPI I'm just changing the name color by adding a ChatColor at the begging, but if the name's colored the health will stay at 0, while if it's not it will update correctly.
     
  9. Just curious, why are you using Damageable on a player object?
     
  10. Offline

    55razvan55

    Cause getHealth() for a player is too ambigous.
     
  11. Offline

    55razvan55

Thread Status:
Not open for further replies.

Share This Page