#How to read / send chat messages and commands?

7 messages · Page 1 of 1 (latest)

naive gulch
#

this is the guide for making custom commands it has possibly everything you will need for making a new command(from arguments to others)
https://wiki.fabricmc.net/tutorial:commands and it also include some guide on sending feedback and chat message

gritty thicket
#

!!chat

royal slateBOT
#

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

azure jolt
#

Lfully/qualified/name/of/Text; doesnt exist

#

the crash message will tell you why its crashing, though

gritty thicket
#

Lfully/qualified/name/of/Text should be the actual fully qualified name of the class and not the placeholder

#
  • you should be using mcdev (or some equivalent) to generate target strings