Hi, does anyone know how I can take the message that a player is typing in the chat but without having it sent?
You can't. Before the message is sent, no information will be passed to the server, so there is no way of achieving what you want to do
That is indeed possible (obviously only after the player has sent the message). You would have to listen to the PlayerChatEvent. There you can get the message and do whatever you want to do with it, especially sending it only to you and not other players.
Oh, you're one of those: Code (Java): if (PlayerChatEvent.getHandlerList().getRegisteredListeners().length != 0) { // Evil plugins still listening to deprecated event (NMS source, PlayerConnection class)