# Minecraft community adapter
# Requires a server-side mod that sends game state via webhook
# (e.g., GameStateIntegration mod or custom Fabric/Forge mod)
#
# Configure your mod to POST JSON to:
#   http://<WLED_IP>:8080/api/v1/game-integrations/<ID>/event

name: minecraft
game: Minecraft
protocol: webhook

mappings:
  - source_path: player.health
    event: health
    min: 0
    max: 20
    trigger: on_change

  - source_path: player.armor
    event: armor
    min: 0
    max: 20
    trigger: on_change

  - source_path: player.food_level
    event: energy
    min: 0
    max: 20
    trigger: on_change

  - source_path: player.experience_level
    event: speed
    min: 0
    max: 100
    trigger: on_change

  - source_path: player.deaths
    event: death
    trigger: on_increase
    min: 0
    max: 100

  - source_path: stats.kills
    event: kill
    trigger: on_increase
    min: 0
    max: 100

auth:
  type: header
  header: X-Minecraft-Auth

setup_instructions: |
  ## Minecraft Integration Setup

  This adapter requires a server-side mod that sends game state data as JSON.

  **Recommended mods:**
  - [GameStateIntegration](https://github.com/example/gsi-mod) (Fabric)
  - Custom Forge mod using `PlayerTickEvent`

  **Expected JSON format:**
  ```json
  {
    "player": {
      "health": 20.0,
      "armor": 10,
      "food_level": 18,
      "experience_level": 30
    },
    "stats": {
      "kills": 5
    }
  }
  ```

  Configure the mod to POST to the event endpoint with the auth token
  in the `X-Minecraft-Auth` header.
