Minecraft Server Console Basic World Management

Published on January 14, 2022 at 6:43 am by LEW

Minecraft ImageIntroduction

In a previous series of posts, we built a rather simple Debian Minecraft server. After the initial setup, you may find the random world that was created not to your liking for any number of reasons. A task you might want to perform at this point is to generate a new Minecraft world.

Since the server has no GUI, nor did we install any third party management software, this is a task that will need to be performed from the command line. So we will walk through the process, in this post, of saving an existing world, setting a seed for world creation, actually creating a new world, and if desired, deleting a world.

Note on Debian Server Build Login

In the previous build, we did not give the minecraft account a password, to prevent direct login. It was pointed out that you can not su to this account from a normal user account without a password. However you can su to the account from the root account without a password.

If you are working directly on the server, this is not much of a problem, as you can log in as root. However if you are running headless, openssh is not going to let you log in as root. This means logging in as a normal user, su to root, then su to minecraft account.

If this seems to much, you can assign your minecraft account a password and log directly into it via open ssh. Just make sure it is a secure password. This can be done by issuing the passwd command when logged in as root.

passwd minecraft

Now you should be able to log into the minecraft account from your ssh program.

Setting World Creation Parameters

When lodged in as the minecraft user, do a “cd ~” to make sure you are in the minecraft home directory, then do a “ls -al” to list all the files in the home directory. Scan through the files for one called server.properties. Open this file in your favorite text editor (nano or vi on default Debian install).

Inside the server.properties file you will find a number of name value pairs that control various server aspects. If a particular parameter pair mentioned here does not exist, simply create it on a new line within the file.

Our first pair we want to look for is level-seed. This is the seed used as the basis for generating a minecraft world. If you do an internet search, you can find literally thousands of seeds for various minecraft versions, and a description of the world they will create.

For example, let us say you want to to use the seed 123456789. The line in the file would be as follows.

level-seed=123456789

Other parameters you might want to adjust might be level-name, gamemode and difficulty.

Generating a New World

If you list your initial minecraft directory, you will note a folder called world. This contains the originally generated world. If you are planning to generate a new world, you can either rename the folder, delete the folder, or change the level-name parameter in the server.properties file. Then the next time minecraft runs, and does not find a folder matching level-name, it will generate a new world.

For our first example, we will rename the folder by moving it with the mv command.

mv world world.old

The next example is removing the folder with the rm command, using the recursive option.

rm -R world

A quick note on entering and exiting Screen

If you remember, we setup screen to run the Minecraft Server in. Quickly, to open the screen instance where the server is running you type “screen -r“. To detach the screen instance you type “Ctrl A” then “Ctrl D”.

The reason you might want to do this is you can use the /stop command from the minecraft server console to stop the server, instead of rebooting.

Conclusion

This post covered the basic process of creating a new customized Minecraft world from the command line.

Add New Comment

Your email address will not be published. Required fields are marked *