The idea is a new parameter for the @ player selectors (@a, @p, ...).
text: Player who says the text in between the quotation marks
text_word: Player who's text contains the text in between the quotation marks, if blank it tests for any speaking
text_begin: Player who text starts with the text between the quotation marks, if blank it tests for any speaking
chat: Replace "text" with chat to "chat" only chat
command: Replace "text" with "command" to test only commands
_case: If added to the end of "text" (after word/begin), it requires text to be case sensitive.
_hide: If added to the end of "text" (after word/begin/case), it stops the command from activating or the chat from sending.
Now some of you are asking "What is the point of this?". I will list some example uses:
A door that opens when you say the magic word.
A server censor list, to stop chat with certain words.
Custom server commands in vanilla Minecraft.
Stop players from using certain commands.
Location: Where to look for the text
-word: Tests for text anywhere
-exact: Tests for exact text
-begin: Tests for text only at the beginning
Source: Where the chat comes from
-chat: Checks chat for text
-command: Checks commands for text
-both: Checks all output for text
Case: If true, case sensitive
Display: If true the command/chat message should go through (command run/chat said)
Command: Optional command to run, is run at the location of the player who typed the chat
/testforchat "Hello" word chat false true give @p minecraft:apple
Gives any player who says Hello an apple
/testforchat "/notch" text command true false tp @p Notch