package los.numeros.command; import com.mojang.brigadier.CommandDispatcher; import com.mojang.brigadier.context.CommandContext; import com.mojang.brigadier.exceptions.CommandSyntaxException; import los.numeros.HidersAndDiggers.Main; import net.minecraft.server.command.CommandManager; import net.minecraft.server.command.ServerCommandSource; public class HidersAndDiggersCommand { public static void register(CommandDispatcher dispatcher, boolean dedicated) { dispatcher.register(CommandManager.literal("hiders") .then(CommandManager.literal("start").executes(HidersAndDiggersCommand::run))); } public static int run(CommandContext ctx) throws CommandSyntaxException { /* get the minecraft server object */ ServerCommandSource source = ctx.getSource(); /* pass in the minecraft server object and start it */ new Main(source, 1); return 0; } }