It's me again.
This time I have the question how to write a message in Minecraft via Java Eclipse, e.g. Write via Eclipse Java in the Minecraft chat via an account "Hi"? Does jmd know about it and can tell me how to do it? I would be glad.
In addition, I have the question of how I can detect messages in Minecraft Chat, so if someone writes Hi, then Hi is automatically written back via a bot that is permanently online.
Which version?
Depends on where you want to install it. Basically, it would work like this:
for (Player all: Bukkit.getOnlinePlayers ()) {
all.sendMessage ( "…");
}
I'm not sure if you can send a message directly from another player, but I don't think so.
1.8.9 on a multiplayer server that is not mine
Enter "Packet" and see what auto-completion suggests. Look for a packet type with "chat" in the name.
This then added to minecraft.getMinecaft (). AddToSendQueue (…).
Here you just have to insert a string in the package. And then sends it. But then see for yourself.
https://wiki.vg/Protocol#Chat_Message_.28serverbound.29