Whenever a player dies, everyone online is instantaneously switched to spectator mode for 90 sec. Then, automatically, the server is shut down, a backup of the deleted world is created and a new seed is generated, playable within ~5 min.
Provided with some scripts for a discord bot and a python script to extract statistics across all backup files.
A linux machine with Python3
, cron
and JAVA
. See Troubleshooting section for hardcoded things to change in the code.
Then:
-
Need Spigot (worked with 1.16.5) to create the server
-
Need Skript pluggin to trigger the
hardcore.sk
script when someone dies -
Put in cron with
crontab -e
:*/1 * * * * $(which python3) /path/to/mc/minecraft.py check >> /path/to/mc/cron.log
- It checks every minute if the server is still running. If not, a backup is created, the world is deleted and a new seed is generated.
-
ScriptBot (worked with 1.2) for cool discord integration
eventhandler.java
inserver\plugins\ScriptBot\scripts
displays cool messages on death for example.
Bonus: Other cool bot to show in status how many players connected:
âš Hardcoded things to change:
-
- l.22 : path to
mc/server
- l.29 : path to
mc/backup
- l.22 : path to
-
- l.28 : path to
mc
- l.28 : path to
-
- l.7 : discord bot-token
-
bot.getTextChannelById
: discord channel ID
âš Important to add a whitelist to use getStatistics.py
.
âš If JAVA problems: need to have this JAVA version for Spigot to work:
java -version
sudo apt-get install openjdk-8-jdk
Should see and pick this version with sudo update-alternatives --config java
:
2 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 manual mode
minecraft.py
arranged from:
https://github.com/tschuy/minecraft-server-control