#!/bin/bash

# Name of your Minecraft server JAR
JAR_NAME="paper-1.21.4-231.jar"
# Optional: Java arguments
JAVA_ARGS="-Xmx6G -Xms6G -jar"

# Loop forever
while true; do
    echo "Starting Minecraft server..."
    java $JAVA_ARGS $JAR_NAME nogui

    echo "Server crashed or stopped. Restarting in 5 seconds..."
    sleep 5
done
