mojira.dev
MC-131636

One additional character at the end is allowed in JSON text components

This command:

/tellraw @s {"text":"a"}@

works, but it shouldn't. It outputs "a". Same with any other character at the end. But not two.

Linked issues

Attachments

Comments 14

Can confirm in 1.13-pre3.

Confirmed for 1.13.1.

Can confirm that this issue is still present in 20w51a.

Can confirm in 21w08b. Video attached.

Can confirm in 1.16.5.

4 more comments

The reason is when reading a JSON text component, the position of the end cursor is one more than expected.

The issue lies on the method with remapped name class_9010.method_55376 (
ParserUtils.getPos), which has an extra +1. In versions 1.20.2 and below, the issue lies on class_2561.class_2562.method_10880 (Component.Serializer.getPos).

Confirmed not to happen for 24w14a.

This is fixed since 24w10a

Can confirm fixed in 24w10a. The command is not accepted anymore.

FaRo1

(Unassigned)

Confirmed

Commands

Minecraft 1.13-pre2, Minecraft 1.13-pre3, Minecraft 1.13.1, Minecraft 1.13.2, Minecraft 18w48a, ..., 1.19.2, 1.19.3, 1.20.2, 1.20.3 Pre-Release 2, 1.20.3 Release Candidate 1

24w10a

Retrieved