mojira.dev
MC-307983

Attempting to `/execute store` into a read-only objective throws an unexpected error

The bug

Read-only scoreboard objectives (with criteria health, xp, food, air, or armor) cannot be modified. When you attempt to modify them with /scoreboard, the error is: “Scoreboard objective ‘whatever’ is read-only.” However, when you attempt to modify them with /execute store, the error is: “An unexpected error occurred while trying to execute that command.”

How to reproduce

  1. /scoreboard objectives add health health

  2. /execute store result score @s health run return 10

Expected result

Error: “Scoreboard objective ‘health’ is read-only”

Observed result

Error: “An unexpected error occurred while trying to execute that command”

Linked issues

Comments 0

No comments.

tryashtar

(Unassigned)

Confirmed

Platform

Normal

Commands

26.1.2, 26.2 Snapshot 6

Retrieved