action bar + health management

This commit is contained in:
unurled 2024-03-14 17:40:09 +01:00
parent 39a1bb192f
commit dd665fd455
Signed by: unurled
GPG key ID: FDBC9CBE1F82423F
4 changed files with 34 additions and 4 deletions

View file

@ -50,10 +50,12 @@ public class SRPlayerUtils {
}
public static void updateActionBar(@NotNull Player p, @NotNull SRPlayer sr) {
double health = sr.getAttribute(Attribute.HEALTH);
double maxHealth = sr.getAttribute(Attribute.HEALTH);
double health = sr.getHealth();
double mana = sr.getAttribute(Attribute.MANA);
net.kyori.adventure.text.Component text = comp("<red>❤ " + health + " <blue>❈ " + mana);
net.kyori.adventure.text.Component text =
comp("<red>❤ " + health + "/" + maxHealth + " <blue>❈ " + mana);
p.sendActionBar(text);
}
}