-
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
- Load a version before 1.19 (1.18.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
- Click on all four clickevents in the book to test the commands and observe that they continue to function properly
- Update the world to the most recent version
- 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"}]}