The `minecraft-bedrock-server` package provides a robust JavaScript API and a command-line interface (CLI) for programmatically managing Minecraft Bedrock Edition servers. It simplifies the process of downloading, starting, stopping, and configuring a Bedrock Dedicated Server instance. The package automatically fetches official server binaries directly from minecraft.net, supporting both Windows and Linux versions. As of its latest stable release, 1.5.2, the project demonstrates an active development cadence with frequent patch updates. Key differentiators include its dual CLI/API approach, direct integration with Minecraft's official download channels for server binaries, and flexible configuration options for `server.properties` directly via code or CLI arguments, making it suitable for automated server deployments or custom game launchers.
npm install minecraft-bedrock-serverVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to programmatically fetch the latest Minecraft Bedrock server version, create a dedicated server instance directory, and start the server with custom `server.properties` options. It uses environment variables for port configuration and logs the server's process ID upon successful startup.
Install `unzip` if on Linux (`sudo apt-get install unzip` or similar). Check the console output for specific errors related to binary execution or missing dependencies. Ensure the target directory for the server has write/execute permissions.
Always provide a unique and dedicated directory using the `path` option (e.g., `{ path: './servers/my-world-server' }`) for each server instance to ensure proper file isolation and management.Explicitly define the desired server version (e.g., `'1.20.72.01'`) when calling `startServer` if precision is required. Use `getLatestVersions()` to dynamically retrieve the most up-to-date information.
Ensure the directory where the server binary is downloaded (specified by the `path` option) has execute permissions. You might need to manually run `chmod +x <path_to_server_binary>` if the automatic download doesn't set it correctly on Linux/macOS.
Verify that `unzip` is installed on your system (for Linux/macOS). Check the console output during the `startServer` call for any download failures. Ensure the `path` option points to a writable directory where the binary can be extracted.
Specify an alternative port for the server using the `server-port` option in the server configuration object (e.g., `{ 'server-port': 25565 }`). Use system tools (like `netstat` or `lsof`) to identify and stop processes occupying the desired ports.No dependency data recorded yet.