mojira.dev
MC-200361

Unexpected error in parsing JSON component

As normal, when you let the game attempt to parse a JSON text component, such as the following:

tellraw @s []

It correctly recognises that the component is empty, and displays an error:

[media]

However, if you construct a component like the following:

tellraw @s ["foo",[]]

It does not notice that anything is wrong until execution - likely assuming that since one of the elements of the array is resolvable, the input is validated.

However, due to the nature of JSON components, any elements of a component array must be resolvable, including the arrays themselves - hence the following error:

[media]

This as-is looks quite strange and can be confusing to players who are new using commands, as the error is not immediately clear.

 To elaborate on this, if the second array becomes valid, then it passes with no issue:

[media]

 

 

 

Attachments

Comments 6

Hi! I can confirm the presence of this issue in release 1.16.3.

Can confirm in 21w03a.

Can confirm in 21w06a.

Can confirm in 1.19.

Can confirm in 1.19.3 and 23w06a

This issue was present in 1.20.2 but no longer occurs in 23w40a, therefore this problem has been fixed in 23w40a. I'm going to resolve this ticket as fixed. I've attached two screenshots to support my claims here.

[media][media]

SirSheepe

(Unassigned)

Confirmed

Commands

1.16.3, 21w03a, 21w06a, 1.19, 1.19.3, 1.19.4 Pre-release 1

23w40a

Retrieved