Autorestart Minecraft server with start.sh (screen) when entering / stop or / restart or when the server crashes, Linux / Debian 10 Minecraft Server, Java 11?

De
- in Servers
2

Hello guys maybe someone can help me. I didn't find anything useful on the Internet. I have a Minecraft server on a Debian 10 server. I installed Java 11 there. I would like to be able to restart the server by command (and as it is in the question), since it currently only stops when / restart is entered in Minecraft or the console.

Current start.sh:

screen -S schmartsurvival java -Xmx16G -Xms8G -jar paper-44.jar nogui

I found something:

However, this does not work. The comments from the video say it is because of the Java version, but I don't want to change it. Here is the script I tried: http://dev-minecraft.de/projekt/restart-skript/

Sw

Minecraft works with java 8 so you should change the version. Why don't you want that?

De

Minecraft also runs on Java 11. So for me the server is running all the time. There are also mods that run better on Java 11. I just don't want to change.