🧱 Minecraft Server

This page documents the deployment, management, and version‑tracking workflows for Minecraft servers running in the environment. Both Bedrock Edition and Java Edition are supported through dedicated Ansible roles, with automated version‑scraping powered by Playwright.


🟩 Minecraft Bedrock Edition Server

Documentation for the active Bedrock server deployment, including version pinning, Ansible role usage, and automated version checks.

➡️ see: Minecraft Bedrock Edition Server


🟧 Minecraft Java Edition Server

Documentation for the Java Edition role, versioning model, manual version checks, and deployment workflow.

➡️ see: Minecraft Java Edition Server


🔍 Version Detection Using Playwright

Minecraft does not provide a public API for server version discovery. To automate version tracking, the homelab uses Playwright to scrape the official download pages for both editions.

ℹ️ NOTE The Playwright role which installs and configures Playwright is included in the version check playbooks.

🟩 Bedrock Edition Version Scraping

The Bedrock download page hides the Linux server link behind JavaScript‑rendered elements.
Playwright is required because:

Workflow:

  1. Playwright loads the Bedrock server download page
  2. Waits for the Linux download button to appear
  3. Extracts the .zip URL
  4. Parses the version from the filename
  5. Outputs the version for Ansible to consume

This is used by the get_bedrock_version.py helper script inside the bedrock_setup role.


🟧 Java Edition Version Scraping

The Java Edition page displays the version number in page text, not in the download URL. However, the version text is injected by client‑side JavaScript, so Playwright is still required.

Workflow:

  1. Playwright loads the Java server download page
  2. Waits for the version text (minecraft_server.X.Y.Z.jar) to appear
  3. Extracts the version using regex
  4. Outputs the version for Ansible

This is used by the get_minecraft_version.py helper script inside the minecraft_setup role.


⚙️ Configuring the Playwright Environment

Playwright must be installed and configured on the Ansible control node (or wherever the version‑check scripts run).

1. Install Python Dependencies

Inside your virtual environment:

pip install playwright
pip install requests

2. Install Playwright Browsers

Playwright requires browser binaries (Firefox is recommended for headless scraping):

playwright install firefox

This installs:

3. Verify Installation

Run:

python3 -c "from playwright.sync_api import sync_playwright; print('OK')"

Then test a simple script:

playwright install

4. Running Version‑Check Scripts

Bedrock:

python3 roles/bedrock_setup/files/get_bedrock_version.py

Java:

python3 roles/minecraft_setup/files/get_minecraft_version.py

Both scripts output only the version number, making them easy to integrate into Ansible workflows.


🧩 How Version Checks Integrate With Ansible

Bedrock Edition

Java Edition