Skip to content

Instantly share code, notes, and snippets.

@LukeHuckman
Last active February 25, 2023 21:07
Show Gist options
  • Save LukeHuckman/57fb14b22cddf0c284d2557ad7af9ba7 to your computer and use it in GitHub Desktop.
Save LukeHuckman/57fb14b22cddf0c284d2557ad7af9ba7 to your computer and use it in GitHub Desktop.
Minecraft server startup script for Paper using Aikar's flags
#!/bin/bash
serverpath="" #Server directory goes here
#Check if the server is already running
if $(screen -list | grep -q minecraftserver); then
exec screen -x minecraftserver
else
#Start the server in a screen
if [ -z "$STY" ]; then
screen -mdS minecraftserver /bin/bash -c "
cd $serverpath
exec java -jar -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -Xms6G -Xmx6G paper.jar -nogui"
fi
fi
@Mcawesome2288
Copy link

hi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment