Minecraft - How do you make a command block respond to chat? [duplicate]

Is it possible to make a command block respond to something being said in the chat? Or even better - make it respond to a message - /msg or /tell. I want to say something in the chat and then a comparator next to the block emits a redstone signal. Is this possible?


Solution 1:

No.

Command blocks can't respond to arbitrary text.

For OP players you can add a custom gamerule that they can set, but that's not completely arbitrary text, only works with OP permissions and will get removed in 1.13.

You can use tellraw with a clickable text, that's probably the best option for you, even though it's not what you asked for. Search for tellraw in the Minecraft wiki, there you can see the syntax and there's a link to the JSON format.