#Help with porting

4 messages · Page 1 of 1 (latest)

misty ledge
#

im trying to port my mod from 1.20.1 to 1.21.3 and ive got every single thing done, except this. I cannot for the life of me figure out the new way to do this, any help would be appreciated.

onyx flume
#

!!chat

twin totemBOT
#

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(...);

misty ledge
#

thanks so much