Skip to content
Advertisement

how do i get the content of a chat message in minecraft?

I am coding a forge minecraft 1.12.2 mod and I need to know how do I get the contents of a chat message that someone sends in chat.

I am using the ServerChatEvent event to sence messages but I do not know how to get the actual content of the message itself.

Answer

To get the message you can use :

event.getMessage();

Also, if you want the full message (with style/actions/…) you can use :

event.getComponent()

More informations:

Advertisement