Skip to content

Useful minecraft scripts for hosting with Paper server

License

Notifications You must be signed in to change notification settings

jogerj/minecraft-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

minecraft-scripts

Useful minecraft scripts for hosting with Paper server

start.sh

Setup

Make sure screen is installed (e.g. on Ubuntu sudo apt-get install screen, see guide for others)

  1. screen -S "minecraft"
  2. screen -ls to list all screens
  3. Change MC and MC_UPDATE variables when appropriate (paper.jar, server.jar, spigot.jar, etc.). Use absolute path if you want to run with cron.
  4. (Optional) if you want to update your server jar, just save as filename determined by MC_UPDATE variable and call restart in console; or stop the server and then run ./start.sh
  5. (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

Tuning java args (Advanced)

Consult guide on Aikar's flags.

updater.py

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)

backup.sh

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.

Configuration

  1. In your server.properties file make sure rcon is enabled
enable-rcon=true
rcon.port=25575
rcon.password=YOUR_PASSWORD_HERE
  1. Change the variables in backup.sh to your configuration. If you installed mcrcon, run whereis mcrcon to find your MCRCON_PATH, otherwise if you downloaded pre-compiled binaries you need to specify its path.
  2. (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

About

Useful minecraft scripts for hosting with Paper server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published