How do I create clickable text that executes a command?

Solution 1:

You can't do this in Bedrock Edition, only in Java Edition. Raw JSON text is much more limited in Bedrock Edition, so much so that you can't even change the color or other formatting using JSON tags (you should still be able to use formatting codes), much less use the interactive features that make tellraw so powerful in Java Edition.

Solution 2:

There might be a simple way

I haven't tested this out but it is an idea you can look into. If you place a sign down, type whatever you like with whatever color tags, then behind it, have a comparator facing outward behind the block holding the sign. Then have a commandblock on the output side of that comparator. You right-click on the sign as if you wanted to use it. The sign might emit change significant enough to be picked up by the comparator.


Hope this helps!