Minecraft Json sendMessage is not working?

ly
1

I'm just starting with the Minecraft client programming and wondering why if I want to send a (JSON) message my Minecraft crashes.

Error code:

The game crashed while updating screen events
Error: com.google.gson.JsonParseException: Do not know how to turn {"text -": "The test has been activated"} into a Component

The whole thing plays in the following code:

Can someone help me there?

Lo

Take this method:

public static void sendClientMessage (String message) {
Minecraft.getMinecraft (). IngameGUI.getChatGUI (). PrintChatMessage (new ChatComponentText (message));
}