If you set up a sign with a click event - run_command, the command will not be run by the user who clicked the sign, but by the sign itself.
setblock ~ ~1 ~ standing_sign 0 replace {Text1:"{text:\"\",clickEvent:{action:run_command,value:\"setblock ~1 ~ ~ stone\"}}"}
-> if you click the sign, the player should run the command, thus the stone should be place beside the player
-X Instead it runs the command from the perspective of the sign, thus the stone is placed next to the sign
In the screenshot you can see the problem.
Camparison between run_command from book and sign
Tellraw and books with click events + run_command work as assumed, no problems
Linked issues
is duplicated by 1
Attachments
Comments 3
Yeah there was a brace missing at the end, but I just didn't copy paste that.
Was right in the commandblock.
If intended or not, the big problem with that behaviour is, that if the player thould run the command,
you need to "exucute @p" and a lot of commands wont work with that.
For example, you want to put up a sign, when you right click it,
it is supposed run the "/help" command for the player. That won't work (maybe that is a bug?)
So the problem i see is, that you will only be able to "sudo" the player, not actually allow him to run the command.
If you think ahead to bukkit servers, where you have custom commands, they won't work unless the player really runs that command
What I also recognized was. if you run the command "say hi" be the sign, the player who clicked the sign will affected. [Player: hi]
But what I wrote above, if you want to run commands like "help" it won't affect the player, instead the sign runs the command.
So yeah, either of that just isn't right.
Probably intended, as signs are blocks; books and chat are not, and thus need an entity on which to run. A /execute command can be used to target players.