How to access my minecraft server console?

I've installed , configured and launched my first minecraft server using this guide :

And I have a few questions :

  • How can I access the server console ?
  • Is it possible to interact with the server console from an external program ? Running on javascript ( node ) or maybe even java ? If so , could you give me any useful resources to read ?

2 Answers

The server.jar file is meant to be launched via the command line or by an script (which normally opens a command prompt).

So, in order to get access to the console, you should launch it from the cmdline with the required arguments. The minimum is: "java -jar server.jar", although specifying a min memory size and max memory size is more than desirable in most cases.

As for interacting with it with an external program, there are many ways. First one that comes to mind is writing a Spigot plugin (that's the base of most Minecraft servers nowadays) that allows you to interface with your server. Another way would be by making a pipe (if using Linux) between the server process and your "external program" process. You could also launch the server directly from the other program with some language functions, like exec in C.

In unix there's a tool called "screen" which might help you. It's widely used in the Minecraft server community to keep servers running in the background.

1

I was a bit confused on this, but it turned out to be as simple as typing out the commands into the terminal running the java -jar server.jar command. So this terminal is not only for logs, you can also run the server commands in it like this:

Starting net.minecraft.server.Main
[12:55:26] [ServerMain/INFO]: Environment: authHost=' accountsHost=' sessionHost=' servicesHost=' name='PROD'
[12:55:27] [ServerMain/INFO]: Reloading ResourceManager: Default
[12:55:28] [Worker-Main-5/INFO]: Loaded 7 recipes
[12:55:28] [Worker-Main-5/INFO]: Loaded 1141 advancements
[12:55:30] [Server thread/INFO]: Starting minecraft server version 1.18.1
...
[12:55:45] [Worker-Main-6/INFO]: Preparing spawn area: 94%
[12:55:45] [Server thread/INFO]: Time elapsed: 13802 ms
[12:55:45] [Server thread/INFO]: Done (14.025s)! For help, type "help"
[12:57:23] [User Authenticator #1/INFO]: UUID of player Heikkuli is b8695316-7d23-4709-b5cd-d5f1b56b2665
[12:57:23] [Server thread/INFO]: Heikkuli[/***.***.**.**:*****] logged in with entity id 164 at (-336.69999998807907, 36.0, -405.2331521124616)
[12:57:23] [Server thread/INFO]: Heikkuli joined the game
op Heikkuli
[12:54:53] [Server thread/INFO]: Made Heikkuli a server operator

Or just type "help" to see available commands.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like