Server Task Scheduler

  • For dedicated servers, there is a new task scheduler available which allows you to set up custom tasks which will be executed after a given amount of time (or at fixed times). You can also react to certain events (e.g. if a player connects or if a player dies). The scheduler allows you to execute various commands, including messages (both chat and yell messages), server-related tasks (restart, shutdown etc), world-related tasks (change weather or time of day) and even http requests.


    The dedicated server is already shipped with an example scheduler file called "scheduler.txt", which is located in the server directory (if it's missing, just create a new "scheduler.txt" file in the server directory). If you modify this file, you either have to restart the server or execute the "reloadscheduler" command to apply the changes to the server.


    Every line in the "scheduler.txt" file is treated individually - this means you can add one command per line. Every command starts with an "@" character, followed by the trigger and the actual command. Example: @15m /say This is a test message! - this executes the /say command every 15 minutes (defined by the 15m).

    Lines with a "##" prefix are just comments and have no effect on the server. Example: ##This line has no effect


    You can either define time intervals (examples: "@10m" for every 10 minutes, "@40m" for every 40 minutes, "@1h" for every hour, "@2h30m" for every 2.5 hours), time offsets (e.g. "@+10m" to execute a command once after 10 minutes, "@+1h" to execute a command once after 1 hour, "@+12h" to execute a command once after 12 hours) or fixed times (e.g. "@12:00" to execute a command once at 12:00 pm system time, "@16:30" to execute it at 4:30 pm etc).



    You can also access a few built-in variables, which are always available. This covers the current player count (accessible via %playercount%) and every server option defined in the "server.properties" file (e.g. %serveroption.server.shortname% or %serveroption.world.seed%).


    Apart from times, you can also react to certain events (every event also has a set of built-in variables). Currently the scheduler supports following events:


    Event name
    Parameters Description
    @OnPlayerConnect %name% (name of player)
    Called whenever a player connects to the server
    @OnPlayerDisconnect %name% (name of player) Called whenever a player disconnects from the server
    @OnPlayerSpawn %name% (name of player) Called when a player spawns on the server (i.e. right after the loading screen)
    @OnPlayerRespawn %name% (name of player) Called when a player respawns (after death)
    @OnPlayerDeath %name% (name of player) Called when a player dies (unless he was killed by another player or npc)
    @OnPlayerKilledPlayer %name% (name of player who died), %killer% (name of killer), %item% (item that was used)
    Called when a player was killed by another player
    @OnPlayerKilledNpc %name% (name of player who killed the npc), %npc% (npc that died), %item% (item that was used) Called when a player kills an npc
    @OnNpcKilledPlayer %name% (name of player who died), %npc% (name of killer npc)
    Called when an npc kills a player
    @OnWeatherChange %weather% (name of new weather type), %oldweather% (previously set weather type) Called when the weather changes (either naturally or via command)




    The upcoming RCON tool will have access to the scheduler. It can be used to modify or set up new tasks.

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!