Skip to content

Wrapper for Minecraft Bedrock Dedicated Server to allow it to safely run as a Windows Service.

Notifications You must be signed in to change notification settings

kwilliams1987/minecraft-bedrock-service

Repository files navigation

Minecraft Bedrock Windows Service Wrapper

This project allows the bedrock_server.exe file to run safely as a background service on Windows systems.

Features

  • Safe handling of Shutdown and Stop conditions by passing the stop command to the service and waiting for it to quit.
  • Automatically call whitelist reload when whitelist.json is modified.
  • Automatically call permission reload when permissions.json is modified.
  • Automatically restart the server when server.properties is modified.
  • Automatically restart the server if it is unexpectedly killed.
  • Shutdown and restart include 30 sec (15 on Windows Shutdown) grace periods with server announcements.
    • System can detect if players are online and skips grace period if there are none.
  • Server output is saved to disk as bedrock_service.log.
  • bedrock_service.exe can also be run as a console application for troubleshooting purposes.
  • Automatic server backups with configurable schedule.
    • Backup interval starts at end of last backup.

Usage

  1. Place bedrock_service.exe in a directory (doesn't need to be the same place as bedrock_server.exe).

  2. Start bedrock_service.exe for testing.

    If bedrock_service.exe is not in the current working directory pass the --workingDirectory "directory\containing\bedrock_server" parameter.

    Example: .\bedrock_service.exe [--workingDirectory "directory\containing\bedrock_server"] [--executable "bedrock_server.exe"] [--logFileName "bedrock_service.log"] [--backupInterval "00:30:00"] [--backupDirectory "Backups"]

  3. Exit test mode with CTRL + X.=

  4. Trigger a backup with CTRL + B, cancel a running backup with CTRL + N.

  5. Create a new Windows Service entry:

    .\bedrock_service.exe --createService true [--workingDirectory "directory\containing\bedrock_server"] [--executable "bedrock_server.exe"] [--logFileName "bedrock_service.log"] [--backupInterval "00:30:00"] [--backupDirectory "Backups"]

Parameters

Parameter Default Value Description
--workingDirectory {Working Directory} Directory of server code, logs and backups.
--executable bedrock_server.exe Filename of server program.
--logFileName bedrock_service.log Filename of log output.
--backupInterval 00:30:00 Time between backups, 0 = disabled.
--backupDirectory Backups Place to store the backup files, as a subdirectory of workingDirectory