#client mixing help
14 messages · Page 1 of 1 (latest)
You should probably modify them in the Chat window
look for the Chat Widget and modify it there
Unless you mean something else
I tried the ClientPlayNetworkHandler class but I don't know how to overwrite the packet
And since it's a string and not a text obj I cannot use formatting for it
do you want to do this in the client?
I'm unsure. Since I'm making it for me and a group of friends I assume doing this in the server would be the best. I would cancel the message and send it as a system message but I was wondering if there was a way to just modify the message itself
how are you sending the message from the server?
I would just do a for loop for every players n use the sendmessage function. It's pretty janky I'm sure
!!chat
To send a message from server to all clients: MinecraftServer server = ...; server.getPlayerManager().broadcast(...); (In 1.19+ there are several overloads; check the javadoc for details. If unsure, use broadcast(Text, boolean).)
To send a message from server to specific client: ServerPlayerEntity player = ...; player.sendMessage(...);
To send a message from client to server: MinecraftClient.getInstance().player.networkHandler.sendChatMessage(...); (In 1.19.2 and below, omit .networkHandler.)
To add a message to HUD on client: MinecraftClient.getInstance().inGameHud.getChatHud().addMessage(...);