mojira.dev
MC-266023

[Invalid/WAI] scoreboards of type "health" cannot be used as source in /scoreboard players operation

When using a function like this:

scoreboard objectives add health health
execute store result score @s health run data get entity @s Health

scoreboard players operation temp health = @s health

I get this error:

"scoreboard objective 'Health' is read-only"

However, this usage of the scoreboard is read only, so it is odd that this would be the error I get.

Comments 3

You're trying to set "health" for a scoreholder, that's what errors, not setting it to the "health" score of another.
scoreboard players operation temp dummy = @s health works fine.

Invalid/WAI.

oh I see, I suppose that makes sense. This is a good catch, thanks for pointing that out!

Some syntax must've changed between pre 1.20.X and now. Because I was facing a similar issue where I had:

scoreboard objectives add VDhealth health
execute store result score @s VDhealth run data get entity @s Health

This would give the read only error in the most recent version. To fix the issue, all I had to do was change the objective from health to dummy.

InQuognito

(Unassigned)

Unconfirmed

(Unassigned)

1.20.2

Retrieved