The bug
Read-only scoreboard objectives are only initialized when the value they are tracking changes. Expected would be that they initialize on creation.
Affected objective criteria
air
armor
food
health
level
xp
How to reproduce
Create a scoreboard objective of the type
xp
/scoreboard objectives add xp xp
Check if a value is set by displaying the objective on the sidebar or trying to get the score
/scoreboard objectives setdisplay sidebar xp
/scoreboard players get @s xp
→ ❌ No value is set
Update your xp points
/xp add @s 1
Repeat step 2
→ ✔ Now a value is set
Linked issues
is duplicated by
Attachments
Comments

Can confirm in 20w51a.
Can confirm in 21w03a.
Can confirm in 21w05b.
Can confirm in 21w06a.
Can confirm in 21w07a.
Can confirm in 21w08b. Video attached.
Can confirm in 21w11a.
Can confirm in 21w17a.
Can confirm in 1.17.1.
Can confirm in 1.18.1.
Can confirm in 1.18.2.
Can confirm in 1.19.
Can confirm in 1.19.2.

Can confirm in 1.21 Pre-Release 2.
Pretty sure there was already a report about that but I can't find it right now.