diff --git a/minecraft-server/start-minecraft.sh b/minecraft-server/start-minecraft.sh index ac990468..1667265c 100755 --- a/minecraft-server/start-minecraft.sh +++ b/minecraft-server/start-minecraft.sh @@ -503,12 +503,17 @@ if [ "$TYPE" = "SPIGOT" ]; then fi fi -if [[ $CONSOLE = false ]]; then - EXTRA_ARGS=--noconsole -else - EXTRA_ARGS="" +EXTRA_ARGS="" +# Optional disable console +if [[ ${CONSOLE} = false || ${CONSOLE} = FALSE ]]; then + EXTRA_ARGS+="--noconsole" fi +# Optional disable GUI for headless servers +if [[ ${GUI} = false || ${GUI} = FALSE ]]; then + EXTRA_ARGS="${EXTRA_ARGS} nogui" +fi + # put these prior JVM_OPTS at the end to give any memory settings there higher precedence echo "Setting initial memory to ${INIT_MEMORY:-${MEMORY}} and max to ${MAX_MEMORY:-${MEMORY}}" JVM_OPTS="-Xms${INIT_MEMORY:-${MEMORY}} -Xmx${MAX_MEMORY:-${MEMORY}} ${JVM_OPTS}"