4

I’ve recently set up a 1.15.2 Minecraft server for my friends and I using my raspberry pi 4 model b as the host. Of course, this isn’t the fastest option, so I wanted to make some changes to the server. However, when I try to edit the server.properties file, nothing changes on the server. I’m making sure to stop the server, edit it and then save, and then launch it back up, but none of the edits are actually appearing. The same thing happens if I try to add a server icon. I followed this tutorial to set it up.

I’ve looked in many different places but all I’m really getting is “make sure your server isn’t open and you save the file.” No one else seems to have this problem.

In the picture I have here, I have the max players set to 10, yet it still says that the max players is 20 when I connect to it on my laptop.

Files on my raspberry pi

How the server appears on my laptop

9
  • I created a docker image, followed the guide, and got the expected results. The guide is fine. Your minecraft server's working directory is somehow misconfigured, because the files, a normal server would generate, aren't there. This might also be caused by your minecraft server not having the permission to write to this folder.
    – Andruida
    Commented May 31, 2020 at 1:30
  • I thought this might be the problem, as the files seem strangely placed. It didn’t make sense to me that the server.properties file was in the general minecraft folder, not in a folder for the server. But do you know a way I can fix this? Should I rearrange the files to make them correct? Or is there a way I could copy all of the data from this world and redo the tutorial, and bring the data of the old server into the new one? I don’t think my friends would want to start over... Commented Jun 1, 2020 at 22:23
  • Were you successful in finding the actual working directory of the server? If so, you should move the files (world folders, config files, server executable) in a single folder, and make that folder the working directory, and it should work fine. If you didn't find your world save folders, you could try and use the find command. For example: find / -name world* -type d should list every folder that has a name starting with "world".
    – Andruida
    Commented Jun 2, 2020 at 23:18
  • Just for reference, these files were generated after following the tutorial and running the server for a minute: imgur.com/sfM0jau
    – Andruida
    Commented Jun 2, 2020 at 23:26
  • Okay, I did some looking around, and somehow, a bunch of the files are in my /home/pi directory. (I don’t know how it got there or how I was looking over it). Should I move these to the /home/pi/minecraft folder? drive.google.com/file/d/1wuFvVeE9XHhnZMDjQ6ETr3BUm_PQj2oY I’m still not sure which “world” folder stores the data, as 5 different options show up... I’m thinking it’s this one though... drive.google.com/file/d/1qI94XaiJ5X_y92YxRhB6WWmJ25cIbEJT/… Thanks for helping me. Commented Jun 4, 2020 at 1:39

1 Answer 1

0

With the additional info from the comments, I think, I can provide you with a walkthrough to your issue.

  1. Stop and disable your minecraft server, and clean-up the config files, if it's configured to start on boot. (I'm assuming you followed the tutorial all the way through). You can do this by using the following commands.
sudo systemctl stop minecraftserver
sudo systemctl disable minecraftserver
sudo rm /lib/systemd/system/minecraftserver.service
sudo systemctl daemon-reload
  1. Backup your world data, because we are going to purge the non-functional server.
    In your setup, world data is found in three folders: /home/pi/world, /home/pi/world_nether and /home/pi/world_the_end.
cd /home/pi
mkdir mc_world_backup
cp -r world world_nether world_the_end mc_world_backup/
  1. Now that your save is in safety, you have to clean-up (move or delete) the remains of the old server. Based on your screenshot, this is the list of files and folders, that have to be cleaned-up.
  • logs/

  • plugins/

  • world/

  • world_nether/

  • world_the_end/

  • banned-ips.json

  • banned-players.json

  • bukkit.yml

  • commands.yml

  • eula.txt

  • help.yml

  • ops.json

  • permissions.yml

  • server.properties

  • spigot.yml

  • usercache.json

  • whitelist.json

    Note: You shouldn't delete the minecraft folder.

    If you want to delete these files, you can use the following command:

rm -rf logs/ plugins/ world/ world_nether/ world_the_end/ banned-ips.json banned-players.json bukkit.yml commands.yml eula.txt help.yml ops.json permissions.yml server.properties spigot.yml usercache.json whitelist.json
  1. Start a new directory and place the server executable and an eula.txt file in that folder. This will be the server's directory from now on.
mkdir mcserver
cd mcserver
cp /home/pi/minecraft/spigot-1.15.2.jar .
echo "eula=true" > eula.txt
  1. Create a run script and start your server from the terminal.
echo "java -Xms512M -Xmx1008M -jar spigot-1.15.2.jar nogui" > run.sh
chmod 755 run.sh
./run.sh

Note: This isn't the most optimalized command to start your server, but this will work. If you want to run your server in the most optimalized way, you should copy and paste this to your run.sh file

java -Xms512M -Xmx1008M -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=100 -XX:+DisableExplicitGC -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=50 -XX:G1MaxNewSizePercent=80 -XX:G1MixedGCLiveThresholdPercent=35 -XX:+AlwaysPreTouch -XX:+ParallelRefProcEnabled -Dusing.aikars.flags=mcflags.emc.gs -jar spigot-1.15.2.jar nogui
  1. Test your server. Connect to it, and see if it loads properly. If everything works fine, shut down your server by entering stop, and proceed to the next step.

  2. Import your world saves. Delete the freshly generated folders world, world_nether and world_the_end, and replace them with your folders, that we backed up in step 2.

rm world world_nether world_the_end
cp -r ../mc_world_backup/* .
  1. Change the server.properties file as you wish.

  2. Test again your results. If you've done everything correctly, by this point you should have a perfectly functional minecraft server with your old maps.

Now if you wan't to start your server, you have to cd into the mcserver directory, and start your server with the ./run.sh command.

cd /home/pi/mcserver
./run.sh

Optionally you could configure linux to automatically start the server for you at start-up. (Based on the tutorial you linked, with minor changes)

Create and open /lib/systemd/system/minecraftserver.service file with a text editor. You could use nano for this, as it comes preinstalled.

sudo nano /lib/systemd/system/minecraftserver.service

Enter the following text into the editor.

[Unit]
Description=Minecraft Spigot Server
[Service]
User=pi
Group=pi
Restart=on-abort
WorkingDirectory=/home/pi/mcserver/
ExecStart=/usr/bin/env bash run.sh
[Install]
WantedBy=multi-user.target

Save this file using the Ctrl + X keyboard shortcut, and then press the y and Enter keys when prompted.

Now you should enable and start your server.

sudo systemctl enable minecraftserver
sudo systemctl start minecraftserver

And done! Your Minecraft server should start with your Raspberry Pi.


Troubleshooting

You can check the status of your server with the following command, to see if it's even running, and to see the latest few lines of log.

sudo systemctl status minecraftserver

The Raspberry Pi isn't too powerful, so your server might take some time to start. If you can't connect to it after a reboot, check the status and give it up to 15 minutes to fully start up.

Your server logs will be saved to /home/pi/mcserver/logs folder. Here you'll find every error message your server outputs, and you could ask a separate question about them.

If you are on a local network, between restarts, your device's IP might have changed, if you can't connect with "unreachable" error messages, you might want to check out the IP of your Pi with:

sudo hostname -I
10
  • Thank you so much for having a nice written out tutorial for me to follow, as I am not too great at doing this myself. I was following exactly what you did, however, I still cannot connect to my server once I run it. It seems to start up completely fine, with no errors, just like it did before. It had been telling me that the build was outdated, so I followed the link it gave me to update it. spigotmc.org/wiki/buildtools/#latest I went to the /home/pi/minecraft directory to do this, and it said it updated fine, but when I start the server, it still says it is outdated. Commented Jun 7, 2020 at 20:11
  • It also seems that there are still files in my /home/pi directory that aren't supposed to be there, as I probably did not provide a good screenshot. Also, it seems that the mcserver file is not generating all the files it should. You can see the screenshots of the different directories here: (drive.google.com/drive/folders/…) I'm not quite sure why I cannot connect. In the past, I could use my pi's internal or external ip to connect to the server, and when I use either, it seems to take a long time to try and connect, but eventually does not. Commented Jun 7, 2020 at 20:18
  • By your screenshots everything is normal. In the /home/pi directory the files that stayed aren't minecraft files. Most of them are config files for different software. The outdated build message isn't an issue either. But if you are rebuilding the spigot-1.15.2.jar file, you should copy it over to the mcserver folder, and overwrite the existing one. Could you provide a server log, or a screenshot of the server running in the terminal? Your server is ready and running, when you see this: [Server thread/INFO]: Done (***.***s)! For help, type "help" (with time instead of stars)
    – Andruida
    Commented Jun 7, 2020 at 21:35
  • Here are the screenshots for the server log, I'm sorry if it's a lot, but I wanted to include everything. (drive.google.com/drive/folders/…) Everything looks normal to me, this is how it usually starts up. However, when I try to use the external ip of my pi to connect to the server, it gives me the error: io.netty.channel.AbstractChannel$AnnotatedSocketException: Network is unreachable: If I connect using the raspberry pi's internal ip, it returns: io.netty.channel.ConnectTimeoutException: connectiontimed out: Commented Jun 8, 2020 at 14:56
  • Also, one more thing I should mention is that when I tried to stop my server around the same time I asked this question, it had errors about not being able to save chunks. However, in the end, it stopped, and said that all of the chunks were saved. I don’t see how this could effect how I cannot connect to the server, but I think it’s important to provide all of the information because I have no idea why it is not working. Thank you so much for your help. Commented Jun 8, 2020 at 15:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.