Hearts in tab

Discussion in 'Spigot Plugin Development' started by SteveBob, May 22, 2016.

  1. I run my minigames on 1.8.

    I'm wondering, how do I get the 1.7 style hearts on tab? By that I mean the numbers, not the actual red hearts. Hypixel still has the number hearts and are on 1.8, so I know it's possible.

    Probably a very easily solution. Any help?
     
  2. Something like this?
    Code (Text):
    for(Player p : Bukkit.getOnlinePlayers()){
            p.setPlayerListName(ChatColor.AQUA + p.getName() + " : "
                    + p.getHealth() + ChatColor.RED + "♥");
    }
    or if you have players in a arraylist
    Code (Text):
    for(Player p : gamePlayer){
            p.setPlayerListName(ChatColor.AQUA + p.getName() + " : "
                    + p.getHealth() + ChatColor.RED + "♥");
    }
    I know I shouldn't be spoon feeding, but i'm feeling nice tonight <3. You can just remove the heart Alt-code if you want, I just added it just in case you decide to use it.