From 66fef835ebdd7bd54191edffdc999e36702e16e6 Mon Sep 17 00:00:00 2001 From: NK Date: Tue, 27 Dec 2022 19:45:06 +0000 Subject: [PATCH] health bar --- .../java/me/night/nullvalkyrie/ui/player/BelowNameManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/me/night/nullvalkyrie/ui/player/BelowNameManager.java b/src/main/java/me/night/nullvalkyrie/ui/player/BelowNameManager.java index f2b127d..61bfc95 100644 --- a/src/main/java/me/night/nullvalkyrie/ui/player/BelowNameManager.java +++ b/src/main/java/me/night/nullvalkyrie/ui/player/BelowNameManager.java @@ -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); }