# How Version Detection Works — ModpackChecker

**IMPORTANT: Read this section carefully before reporting that your server shows "up to date."**

---

## The Short Version

ModpackChecker learns your current version **the first time it runs**. It cannot look backwards in time. This means:

- **First run:** ModpackChecker sees your server is running ATM10 v6.6. It records "current version = 6.6."
- **Tomorrow:** CurseForge releases ATM10 v6.7. ModpackChecker sees latest = 6.7, stored current = 6.6. 🟠 Orange dot appears.
- **You update:** ModpackChecker sees latest = 6.7, current = 6.6 still stored. You manually trigger a check — it updates current to 6.7. 🟢 Green dot returns.

---

## Why Your Server Shows "Up To Date" On First Install

This is expected and correct. On the first run, ModpackChecker has no way to know what version you were running before it was installed. It assumes you are current. From that point forward, it watches for changes.

**If you know your server is already behind**, you can manually set the current version:

1. Go to Admin → Extensions → ModpackChecker
2. Click the server you want to update
3. Enter your current installed version in the "Current Version" field
4. Save — ModpackChecker will compare this against the latest and show the correct status

---

## How ModpackChecker Detects Your Modpack (No Egg Changes Required)

ModpackChecker uses a 3-step detection system. You do **not** need to modify your server eggs.

### Step 1: Installer Data (Automatic)
If your pack was installed using Pterodactyl's built-in modpack installer, ModpackChecker reads that data automatically. No configuration needed.

### Step 2: Egg Variables (Optional Override)
If you want to manually specify or override detection, set these startup variables:
- `MODPACK_PLATFORM` — curseforge, modrinth, ftb, or technic
- `MODPACK_ID` — the pack's project ID from the platform

### Step 3: File Detection (Fallback)
For servers not installed via the modpack installer, ModpackChecker attempts to read `manifest.json` (CurseForge) or `modrinth.index.json` (Modrinth) from the server root.

### Not Detected?
If none of the above work, the server shows as "Unconfigured." You can configure it manually in the admin panel.

---

## CurseForge API Key Required

CurseForge modpack monitoring requires a free API key from [console.curseforge.com](https://console.curseforge.com). 

- Apply for the **3rd Party API** access
- Approval typically takes 1-3 business days
- Enter your key in Admin → Extensions → ModpackChecker → CurseForge API Key

Modrinth, Technic, and FTB do not require an API key.

---

## Check Frequency

The background check runs on a cron schedule (default: daily at 4am). Professional tier users can configure 6-hour or 12-hour intervals.

**To run an immediate check:**
```bash
php artisan modpackchecker:check
```

Or use the "Check Now" button in the admin panel (if available).

---

## Dashboard Badges vs Console Widget

| Feature | What It Shows |
|---------|--------------|
| Dashboard badge 🟠 | Update available (orange dot next to server name) |
| Dashboard badge 🟢 | Up to date (green dot) |
| Console widget | Current version, latest version, last checked timestamp |
| No badge | Server not configured or not yet checked |

---

*ModpackChecker by Firefrost Gaming — firefrostgaming.com/discord for support*
