I need help with sending messages from clients.

Started by CN_SKY on

Topic category: General discussion

Joined May 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I need help with sending messages from clients.

I want to design a mod to replace user chat,I use the following code to accomplish this task:
import net.minecraftforge.fml.client.FMLClientHandler;
import net.minecraft.client.Minecraft;
Minecraft mcclint =FMLClientHandler.instance().getClient();
mcclint.player.sendChatMessage("Test Message");
But it only works in single mode,When I use it in multiplayer mode, it doesn't work.
This mod is only installed on the client side. I don't think it's necessary to install mod on the server if you want to simulate user chat.
Please help me. Thank you very much.

Joined May 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I have been working for it…
Mon, 05/20/2019 - 08:03

I have been working for it for three days. Please help me. Thank you very much.