mojira.dev
MCPE-231559

Conversions between string and number is no longer supported in JSON UI

Previously converting between a string and a number in a ui.json file would simply be multiplying by 1

Reproduce:

  • Create a resource pack with the file ui/hud_screen.json

    • With an element with “type”: “label” and “text”: “#text”

    • Gets the binding #player_score_sidebar

    • Set another binding (ex #score) to (#player_score_sidebar * 1)

    • Sets the binding #text to “(‘§z’ + #player_score_sidebar + #score)

    • Add the element to the root_panel using “modifications”

  • Add that resource pack to a new world

  • Run commands:

    • /scoreboard objectives add t dummy t

    • /scoreboard objectives setdisplay t sidebar

    • /scoreboard players set @s t 1

Observed:

Only 1 number appears in the label. (1)

Expected:

Both numbers are shown. (11)

Note:

Using comparisons (ex = ) with #score will fail.

The json file attached is the ui json used in the image

Attachments

Comments 0

No comments.

KYKY5435

(Unassigned)

Unconfirmed

iOS

1.21.130.27 Preview, 26.0.23/24 Preview

Retrieved