EmoteCommands .java

net.minecraft.server.commands.EmoteCommands (class): members: register. strings: "action". imports: MessageArgument, ChatType, PlayerList, Commands.

net.minecraft.server.commandsclass22 linesserver873 B

API Surface (1)

void register(final CommandDispatcher<CommandSourceStack> dispatcher)

String literals (1)

"action"

Code Graph: Dependencies (5)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

EmoteCommands.java22 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.server.commands;
2
3
import com.mojang.brigadier.CommandDispatcher;
4
import net.minecraft.commands.CommandSourceStack;
5
import net.minecraft.commands.Commands;
6
import net.minecraft.commands.arguments.MessageArgument;
7
import net.minecraft.network.chat.ChatType;
8
import net.minecraft.server.players.PlayerList;
9
10
public class EmoteCommands {
11
	public static void register(final CommandDispatcher<CommandSourceStack> dispatcher) {
12
		dispatcher.register(Commands.literal("me").then(Commands.argument("action", MessageArgument.message()).executes(c -> {
13
			MessageArgument.resolveChatMessage(c, "action", message -> {
14
				CommandSourceStack source = c.getSource();
15
				PlayerList playerList = source.getServer().getPlayerList();
16
				playerList.broadcastChatMessage(message, source, ChatType.bind(ChatType.EMOTE_COMMAND, source));
17
			});
18
			return 1;
19
		})));
20
	}
21
}
22

Decompiled Minecraft 26.3 source of EmoteCommands (net/minecraft/server/commands/EmoteCommands.java) with Mojang official mappings, stored verbatim on the site.