Hello everyone! I am very new to developing with Forge (I am used to Bukkit/Spigot), and I was hoping someone could shed some light on how to change a player's nametag based on how much health they have. For instance:
public void onNameTag(AsyncPlayerReceiveNameTagEvent event) {
if (event.getPlayer().getHealth == 20.0f) {
event.setTag(player.getName() + " 20HP");
}else{
//other stuff
}
}
I want this to work on both servers, and local worlds. I don't believe I have to send packets, because I only want this to appear client-side. In theory, it should set the nametag above every player,who has full health, to display their original name + "20HP". I want to thank anyone who responds to this in advance.