action bar + health management
This commit is contained in:
parent
39a1bb192f
commit
dd665fd455
4 changed files with 34 additions and 4 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue