Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-269732

Starting from version 1.19, commands with an extraneous space at the end are no longer functional when utilized in clickevents within books

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 22w19a, 1.20.4, 24w12a, 1.20.5 Release Candidate 2
    • None
    • Confirmed
    • (Unassigned)

      In versions prior to 1.19, commands with an additional space at the end functioned properly when employed in clickevents within books. However, as of 1.19, the command fails to execute, resulting in an error message, despite the command still functioning correctly when entered directly in the chat.

      Steps to test the bug

      1. Load a version before 1.19 (1.18.2)
      2. give @p written_book{title:"",author:"",pages:['[{"text":"With space in command\\n","clickEvent":{"action":"run_command","value":"/effect give @s minecraft:absorption 10 1 true "}},{"text":"without space in command\\n","clickEvent":{"action":"run_command","value":"/effect give @s minecraft:absorption 10 1 true"}},{"text":"Kill with space\\n","clickEvent":{"action":"run_command","value":"/kill "}},{"text":"Kill without space","clickEvent":{"action":"run_command","value":"/kill"}}]']} 1
      3. Click on all four clickevents in the book to test the commands and observe that they continue to function properly
      4. Update the world to the most recent version
      5. Attempt the clickevents once more

      Observation: Clickevents with an unnecessary space at the end no longer function.
      Expectation: Clickevents with an unnecessary space at the end should still work, as they did in previous versions.

      In newer versions, the command to obtain the book was altered due to changes in item storage. Use the following command to directly acquire the book without the need for an upgrade from an older version:

      /setblock ~ ~ ~ minecraft:chest[facing=north,type=single,waterlogged=false]{Items:[{Slot:0b,components:{"minecraft:written_book_content":{author:"",pages:[{raw:'{"clickEvent":{"action":"run_command","value":"/effect give @s minecraft:absorption 10 1 true "},"extra":[{"clickEvent":{"action":"run_command","value":"/effect give @s minecraft:absorption 10 1 true"},"text":"without space in command\\n"},{"clickEvent":{"action":"run_command","value":"/kill "},"text":"Kill with space\\n"},{"clickEvent":{"action":"run_command","value":"/kill"},"text":"Kill without space"}],"text":"With space in command\\n"}'}],resolved:1b,title:{raw:""}}},count:16,id:"minecraft:written_book"}]}

        1. clickevent_bug.mp4
          6.67 MB
        2. error.png
          error.png
          263 kB

            Unassigned Unassigned
            NoUser No User
            Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              CHK: