tutorial:commands
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
tutorial:commands [2019/07/29 15:20] – [ServerCommandSource] Neaten commenting i509vcb | tutorial:commands [2019/07/29 15:21] – [Some actual examples] Fix syntax errors i509vcb | ||
---|---|---|---|
Line 285: | Line 285: | ||
} | } | ||
- | public int broadcast(ServerCommandSource source, Formatting formatting, String message) { | + | public |
Text text = new LiteralText(message).formatting(formatting); | Text text = new LiteralText(message).formatting(formatting); | ||
Line 307: | Line 307: | ||
<code java> | <code java> | ||
- | public static | + | public static |
ServerCommandSource source = ctx.getSource(); | ServerCommandSource source = ctx.getSource(); | ||
Line 343: | Line 343: | ||
<code java> | <code java> | ||
- | public static | + | public static |
if(blockPos==null) { | if(blockPos==null) { | ||
Line 354: | Line 354: | ||
source.getMinecraftServer().getPlayerManager().broadcastChatMessage(new LiteralText(" | source.getMinecraftServer().getPlayerManager().broadcastChatMessage(new LiteralText(" | ||
source.getWorld().spawnEntity(tnt); | source.getWorld().spawnEntity(tnt); | ||
+ | return 1; | ||
} | } | ||
</ | </ |
tutorial/commands.txt · Last modified: 2024/02/23 14:22 by allen1210