health bar
This commit is contained in:
parent
ce5ad39302
commit
66fef835eb
1 changed files with 1 additions and 1 deletions
|
@ -7,7 +7,7 @@ import org.bukkit.scoreboard.*;
|
|||
public class BelowNameManager {
|
||||
public void setBelowName(Player player) {
|
||||
Scoreboard board = player.getScoreboard();
|
||||
Objective obj = board.registerNewObjective("HealthBar", Criteria.create("CustomHealth"), ChatColor.RED.toString() + player.getHealth() + "❤");
|
||||
Objective obj = board.registerNewObjective("HealthBar", Criteria.HEALTH, ChatColor.RED + "❤");
|
||||
obj.setDisplaySlot(DisplaySlot.BELOW_NAME);
|
||||
player.setScoreboard(board);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue