User Tools

Site Tools


tutorial:commands

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
tutorial:commands [2021/01/07 11:13] – fix misplaced ) in requires example juuztutorial:commands [2021/03/05 00:15] – [Some example commands examples] solidblock
Line 425: Line 425:
  
 public static int broadcast(ServerCommandSource source, Formatting formatting, String message) { public static int broadcast(ServerCommandSource source, Formatting formatting, String message) {
-    final Text text = new LiteralText(message).formatting(formatting);+    final Text text = new LiteralText(message).formatted(formatting);
  
-    source.getMinecraftServer().getPlayerManager().broadcastChatMessage(text, false);+    source.getMinecraftServer().getPlayerManager().broadcastChatMessage(text, MessageType.CHAT, source.getPlayer().getUuid());
     return Command.SINGLE_SUCCESS; // Success     return Command.SINGLE_SUCCESS; // Success
 } }
tutorial/commands.txt · Last modified: 2024/02/23 14:22 by allen1210