Get messages from Player.sendMessage()

If I set a Player’s MessageChannel to a custom message channel, and something like a command sends that player a message, why doesn’t that message come through in MessageChannelEvent?

Am I listening to the right event?

When a plugin call sendMessage() it directly send a message to the player without any interaction with his MessageChannel. When the player cause a message (ex: join the game) or send a message in the chat, his MessageChannel is retrieved to know who will be able to see the message.

Calling sendMessage() do not throw any event.

MessageChannels can have multiple recipients so it really wouldn’t make too much sense since #sendMessage() only sends a message to a single player.

Adding a PlayerReceiveMessageEvent or something more generic that is throw when we call sendMessage() to the API can be interesting.


I will submit an issue, thanks for everyone’s help.