[SPIGOT-1725] Secondary Scoreboard Health Objective not displaying Created: 03/Mar/16  Updated: 12/Mar/16  Resolved: 12/Mar/16

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: belboz Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: 1.9, health, scoreboard
Environment:

This server is running CraftBukkit version git-Spigot-dd155ed-3e3516e (MC: 1.9) (Implementing API version 1.9-R0.1-SNAPSHOT)


Attachments: Java Source File sample.java    
Plugin: My own plugin

 Description   

So in 1.8 I was creating a scoreboard for mods that shows player health in the tablist and that works fine. (normal players have a separate scoreboard generated by the built in minecraft scoreboard commands).

This is how I do it for the mods.

Objective health = board.registerNewObjective("showhealth", "health");
health.setDisplaySlot(DisplaySlot.PLAYER_LIST);

It doesn't show the hearts on the tablist. They seem to register as each player at zero health. (which if I change it to display under the players names, it says 0 health).

The scoreboard for normal players has the objective set like this from command line

scoreboard objectives add health health
scoreboard objectives setdisplay list health

That scoreboard works fine for the players shows hearts and updates accordingly.

I don't know if something has changed in 1.9 in regards to health, but I thought that the health method would automatically pull players health and keep the tablist updated. It does at least in 1.8 and it does for the scoreboard generated with the command line scoreboard command.

When the scoreboard is first initialized you can see the 10 hearts flash and they go away.



 Comments   
Comment by belboz [ 12/Mar/16 ]

Confirmed that this is fixed now!

Comment by belboz [ 12/Mar/16 ]

I believe this bug report is valid. No matter what I do, the "second" scoreboard doesn't work.

I suspect maybe you did a getMainScoreboard() to get the current scoreboard and then using registerNewObjective() you add the health to it and used displayslot to set it to the player_list.

This works fine. But it is working with the mainscoreboard. Not a new one.

But if you use getNewScoreboard() and try adding the health to that board and setting that board to a player it does not work. It shows the space where the hearts would be, but it does not show the actual hearts.

Comment by belboz [ 03/Mar/16 ]

Also I do set all players health to max health at start, and even after taking damage or anything the mod scoreboard health never updates.

The space is there in the tablist for all the hearts, but I assume the health method objective for whatever reason sees their health as zero and never updates

Comment by belboz [ 03/Mar/16 ]

Sorry for marking this build tools. I thought I had it set to spigot. Not sure if I can change that or someone else can

Generated at Fri Apr 11 16:00:47 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.