Solved How to get player message from AsyncChatEvent?

Anddar

New member
Jul 21, 2022
2
0
1
AsyncChatEvent is the event that is fired when a player sends a message in chat, I'm having a hard time figuring out how I can acquire the player's message that was sent. e.message() returns a @NotNull Component but there is no associated method with it that will retrieve the player's message. The reason I'm trying to get this to work is that AsyncPlayerChatEvent is deprecated and I'm trying to switch over, AsyncPlayerChatEvent had a quite easy way of acquiring the message and that was just using e.getMessage(). If anyone can help me out with this issue that would be greatly appreciated, maybe I'm overlooking something super simple I just can't seem to figure it out. Thanks.
 

D3it7i

New member
Jul 20, 2022
5
0
1
The above link is for reference
You can get the message sent by the player from e.message() using LegacyComponentSerializer