Useful minecraft scripts for hosting with Paper server
Make sure screen
is installed (e.g. on Ubuntu sudo apt-get install screen
, see guide for others)
screen -S "minecraft"
screen -ls
to list all screens- Change
MC
andMC_UPDATE
variables when appropriate (paper.jar
,server.jar
,spigot.jar
, etc.). Use absolute path if you want to run with cron. - (Optional) if you want to update your server jar, just save as filename determined by
MC_UPDATE
variable and callrestart
in console; or stop the server and then run./start.sh
- (Optional) In case your machine reboots, edit crontab with
crontab -e
and add@reboot /path/to/start.sh > /dev/null 2>&1
. Your server will automatically start again (only use if you have automated backup running)
Ctrl+A then D to detach from screen
screen -x
or screen -r <screen_id>
to bring back console
Consult guide on Aikar's flags.
This python script automatically fetches the latest build of Paper. DO NOT AUTOMATE THIS WITH A SCHEDULER! Don't make the updater replace your jar files directly, it is a very bad practice! Only run this script when you want to update. Always have a backup of your previous jar file.
Put in same directory as minecraft and run ./updater.py
or with your python3 interpreter. Change the version number in the VERSION
variable to your desire. This updater also supports Waterfall, just change the PROJECT
variable.
Can be used in conjunction with start.sh.
Tested on Windows (Python 3.9) and RHEL 7 (Python 3.6)
This script allows you to backup your minecraft installation. It will delete backups older than 1 week. To use, you will need to install mcrcon.
- In your
server.properties
file make sure rcon is enabled
enable-rcon=true
rcon.port=25575
rcon.password=YOUR_PASSWORD_HERE
- Change the variables in
backup.sh
to your configuration. If you installed mcrcon, runwhereis mcrcon
to find yourMCRCON_PATH
, otherwise if you downloaded pre-compiled binaries you need to specify its path. - (Optional) To schedule a daily backup, run
crontab -e
and add@daily /path/to/backup.sh > /dev/null 2>&1
. If you want more frequent backups, see crontab-generator for custom options
Credits: katznboyz1