mojira.dev
MC-181673

Removing formatting symbol in book doesn't remove color character

When editing books containing the formatting character '§' followed by a formatting code, only one of them is removed (see in the screenshot, where I pressed delete in the second line and it left he 'r' reset formatting code).

Use the following command and right click the placed sign to reproduce the issue:

/setblock ~ ~1 ~ minecraft:oak_sign{front_text:{messages:['{"text":"Click me","clickEvent":{"action":"run_command","value":"/give @s minecraft:writable_book[minecraft:writable_book_content={pages:[\\"\\u00a7nVery cool text\\n\\u00a7r \\u00a7\\u00a7\\u00a7\\u00a7 hi\\n\\u00a75more\\n\\u00a7etext\\"]}]"}}', '""', '""', '""']}}

 

In older version, it would be:

/setblock ~ ~ ~ oak_sign{Text1:"{\"text\":\"Click me\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/give @p writable_book{pages:[\\\"\\u00a7nVery cool text\\n\\u00a7r \\u00a7\\u00a7\\u00a7\\u00a7 hi\\n\\u00a75more\\n\\u00a7etext\\\"]}\"}}"}

 

(This can also be reproduced without extra commands by having a book with the formatting character in a 1.13 world by copy-pasting text into it, and upgrading/opening that world with a 1.14+ client.)

What can be observed:

  • removing the '§' character doesn't remove the character setting the color afterward (and seemingly makes it pop into existence)

  • removing the color character doesn't remove the formatting character (and seemingly makes it pop into existence)

Linked issues

Attachments

Comments 2

Ceresjanin123

This command doesn't work anymore as of 24w36a so I cannot reproduce this.
Could you provide updated reproduction steps?

Nassim Jahnke

Added an updated command, valid in 1.21.1

Nassim Jahnke

(Unassigned)

Confirmed

UI

1.15.2, 20w18a, 1.16 Pre-release 2, 1.21.1

Retrieved