SeedCommand .java

net.minecraft.server.commands.SeedCommand (class): members: register. strings: "commands.seed.success", "seed". imports: ComponentUtils, CommandDispatcher.

net.minecraft.server.commandsclass21 linesserver859 B

API Surface (1)

void register(final CommandDispatcher<CommandSourceStack> dispatcher, final boolean checkPermissions)

String literals (2)

"seed"
"commands.seed.success"

Code Graph: Dependencies (4)

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

Full Source

SeedCommand.java21 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.network.chat.Component;
7
import net.minecraft.network.chat.ComponentUtils;
8
9
public class SeedCommand {
10
	public static void register(final CommandDispatcher<CommandSourceStack> dispatcher, final boolean checkPermissions) {
11
		dispatcher.register(
12
			Commands.literal("seed").requires(Commands.hasPermission(checkPermissions ? Commands.LEVEL_GAMEMASTERS : Commands.LEVEL_ALL)).executes(c -> {
13
				long seed = c.getSource().getLevel().getSeed();
14
				Component seedText = ComponentUtils.copyOnClickText(String.valueOf(seed));
15
				c.getSource().sendSuccess(() -> Component.translatable("commands.seed.success", seedText), false);
16
				return (int)seed;
17
			})
18
		);
19
	}
20
}
21

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