Details
-
Bug
-
Resolution: Unresolved
-
None
-
1.16.3, 1.17.1
-
None
-
Confirmed
-
(Unassigned)
Description
The bug
As mentioned in the title, non-op players can run op commands from signs (using "run_command" "clickEvent") but not from written books (also using the "run_command" "clickEvent" mechanic). If that's not a bug, it's definitely inconsistent. IMO players should be able to run op commands from books as well. Makes the life of map makers much easier.
How to reproduce
- Create a new world with cheats disabled
- Open the world to LAN with cheats enabled
- Give yourself a written book with a "run_command" clickEvent:
/give @s written_book{title:MC-201807,author:Author,pages:['{"text":"Test","clickEvent":{"action":"run_command","value":"/give @s stone"}}']}
- Close and reopen the world
- Open the book and click on the word "Test"
→The command fails (you are not given a block of stone)
- Open the world to LAN again with cheats enabled
- Open the book and click on the word "Test"
→The command runs successfully (you are given a block of stone)
Note
In the above example, if "/give @s stone" is replaced with "not a command", by clicking "Test", "not a command" will be written in the chat, as if the player wrote it, which explains the above behaviour. It doesn't really execute a command, it writes in the chat instead. Signs don't do the same, so by clicking this sign :
/give @p minecraft:oak_sign{BlockEntityTag:{Text1:'{"text":"","clickEvent":{"action":"run_command","value":"not a command"}}',Text2:'{"text":"Test"}'}}
, nothing will happen.