Skip to content

Instantly share code, notes, and snippets.

@chand1012
Created May 16, 2017 02:08
Show Gist options
  • Save chand1012/9dc06fb4d70e38489b2a75c53f8ddac2 to your computer and use it in GitHub Desktop.
Save chand1012/9dc06fb4d70e38489b2a75c53f8ddac2 to your computer and use it in GitHub Desktop.
My batch script for my modded Minecraft server
:: this is the file that handles the server for my modded Minecraft on my 6-core PC
:: ParallelGCThreads can be changed to accomodate any number of cores, just give it the number of threads needed
:: if you are hosting a vanilla server, change forge.jar to the name of the Minecraft server jar
:: change Xmx to the amount of RAM your computer has
:: change 'world3' to the name of your Minecraft world to backup the world automatically
:: lines 10, 13-15 have to do with automatic restart on crash
@echo off
color 0a
title MWServer
:a
java -server -Xmx7G -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSIncrementalPacing -XX:ParallelGCThreads=6 -XX:+AggressiveOpts -jar forge.jar nogui
xcopy C:\Users\chizz\Desktop\MWServer\world3 C:\Users\chizz\Desktop\MWServer\backup\world3 /i /r /s /y
echo You have 10 seconds to Ctrl-C the server before restart!
ping localhost -n 10 > nul
goto a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment