blob: 874ee79510e0db48d8558aba224156b9888c5a31 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
package los.numeros.command;
import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.context.CommandContext;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import net.minecraft.server.command.CommandManager;
import net.minecraft.server.command.ServerCommandSource;
public class TestCommand {
public static void
register(CommandDispatcher<ServerCommandSource> dispatcher, boolean dedicated)
{
dispatcher.register(CommandManager.literal("test")
.then(CommandManager.literal("foo").executes(TestCommand::run)));
}
public static int
run(CommandContext<ServerCommandSource> ctx) throws CommandSyntaxException
{
System.out.println("printing something");
return 0;
}
}
|