ServerAlarmClock ServerAlarmClock is the perfect wake-up call for your Minecraft server! Ever tried to join a server that's still fast asleep? With ServerAlarmClock, your server will automatically start up when someone attempts to join, ensuring no one has to wait too long for the fun to begin.
Features
Automatic Server Start: Your server will automatically boot up when a player attempts to join a stopped or sleeping server.
Custom Messages: Send players fun and customizable messages while they wait for the server to start.
Easy Configuration: Simple setup with a lightweight, no-hassle config.
Command # reload your plugin config(serveralarmclock.reload)
/sac reload
Download the ServerAlarmClock.jar file and place it in your BungeeCord plugins folder.
Configure the Flags:
Open the config.yml file located in the ServerAlarmClock folder.
Under the flags section, specify the paths to the flag files for each of your servers. These flags will be used to trigger the server startup.
Setup the Server Startup Script:
You need to create or modify your server startup script to include the logic for checking the flag file. The example of a Linux shell script is provided at the end of this passage.
Start the Server:
Once everything is configured, reload the plugin using /sac reload. The plugin will now monitor server connections and start the target server when a player attempts to join a server that is currently stopped.
Enjoy!
Code (Text):
#!/bin/bash
# Server directory
SERVER_DIR="your/server/path"
# Path to the flag file
FLAG_FILE="your/flag/file/path/example.flag"
# Change to the server directory
cd "$SERVER_DIR" || { echo "Failed to change directory to $SERVER_DIR"; exit 1; }
while true
do
# Check if the flag file exists
if [ -f "$FLAG_FILE" ]; then
echo "Minecraft Server is Starting"
# Start the server
java -jar server.jar
# Remove the flag file
rm -f "$FLAG_FILE"
echo "Minecraft Server has Stopped"
else
sleep 1
fi
done
Code (Text):
@echo off
REM Server directory
set SERVER_DIR=your\server\path
REM Path to the flag file
set FLAG_FILE=your\flag\file\path\example.flag
REM Change to the server directory
cd /d "%SERVER_DIR%"
if %errorlevel% neq 0 (
echo Failed to change directory to %SERVER_DIR%
exit /b 1
)
:loop
REM Check if the flag file exists
if exist "%FLAG_FILE%" (
echo Minecraft Server is Starting
REM Start the server
java -jar server.jar
REM Remove the flag file
del /f "%FLAG_FILE%"
echo Minecraft Server has Stopped
) else (
timeout /t 1 /nobreak >nul
)