diff --git a/minecraft-server/Dockerfile b/minecraft-server/Dockerfile index 41d23067..fe28bd34 100644 --- a/minecraft-server/Dockerfile +++ b/minecraft-server/Dockerfile @@ -40,4 +40,4 @@ ENV UID=1000 GID=1000 \ MOTD="A Minecraft Server Powered by Docker" \ JVM_OPTS="-Xmx1024M -Xms1024M" \ TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED LEVEL=world PVP=true DIFFICULTY=easy \ - LEVEL_TYPE=DEFAULT GENERATOR_SETTINGS= WORLD= MODPACK= ONLINE_MODE=TRUE + LEVEL_TYPE=DEFAULT GENERATOR_SETTINGS= WORLD= MODPACK= ONLINE_MODE=TRUE CONSOLE=true diff --git a/minecraft-server/start-minecraft.sh b/minecraft-server/start-minecraft.sh index afd0d0f1..8a97584e 100755 --- a/minecraft-server/start-minecraft.sh +++ b/minecraft-server/start-minecraft.sh @@ -441,10 +441,16 @@ if [ "$TYPE" = "SPIGOT" ]; then fi fi +if [[ $CONSOLE = false ]]; then + EXTRA_ARGS=--noconsole +else + EXTRA_ARGS="" +fi + # If we have a bootstrap.txt file... feed that in to the server stdin if [ -f /data/bootstrap.txt ]; then - exec java $JVM_OPTS -jar $SERVER "$@" < /data/bootstrap.txt + exec java $JVM_OPTS -jar $SERVER "$@" $EXTRA_ARGS < /data/bootstrap.txt else exec java $JVM_OPTS -jar $SERVER "$@" fi