mojira.dev
MC-272479

Scoreboard display name with keybind text component behave weirdly after changing said keybind

Scoreboards display name that contains "keybind" JSON text component doesn't update after keybind is changed, and it appear offcentered if new keybinds name has different length than the old one

 

Name only updates after:

reentering world, changing name with command, reloading resource packs

 

To reproduce:

  1. /scoreboard objectives add scores health "Name"

  2. /scoreboard objectives setdisplay sidebar scores

  3. /scoreboard objectives modify scores displayname {"keybind":"key.swapOffhand"}

  4. Change "Swap Item With Offhand" keybind to a different one that name is longer/shorter

  5. Observe scoreboard

Attachments

Comments 2

Can confirm in 1.21 Pre-Release 2.
Seems like the "Button [num]" keybind translation strings are aligned from their left-most side on the scoreboard sidebar, and the singular letter strings (such as; F, G, etc) are centered in the middle of the scoreboard sidebar. When the keybind itself is updated from a singular letter to the button, the text changes its alignment. It may be expected that the text itself would not update without a reload, considering lang files are considered assets.

Can confirm in 1.21 Pre-Release 2 too.

samswi

(Unassigned)

Community Consensus

Platform

Low

Commands, Text

1.20.6, 24w21b, 1.21 Pre-Release 2, 1.21.1, 24w35a, 1.21.8 Release Candidate 1

Retrieved