# Mechanix + Fabric Setup for Windows # Run in PowerShell: right-click this file -> "Run with PowerShell" $base = "https://citrohub.com" $mcDir = "$env:APPDATA\.minecraft" $vid = "fabric-loader-0.15.11-1.20.4" Write-Host "" Write-Host "=== Mechanix Installer for Windows ===" -ForegroundColor Cyan Write-Host "Setting up Fabric + Mechanix for Minecraft 1.20.4..." -ForegroundColor White Write-Host "" # 1 — Create version profile directory $verDir = "$mcDir\versions\$vid" New-Item -ItemType Directory -Force -Path $verDir | Out-Null # 2 — Download Fabric loader profile JSON Write-Host "[1/4] Downloading Fabric loader profile..." -ForegroundColor Yellow Invoke-WebRequest "$base/fabric-loader-profile.json" -OutFile "$verDir\$vid.json" -UseBasicParsing # 3 — Create mods folder and download mods Write-Host "[2/4] Creating mods folder..." -ForegroundColor Yellow $modsDir = "$mcDir\mods" New-Item -ItemType Directory -Force -Path $modsDir | Out-Null Write-Host "[3/4] Downloading Fabric API + Mechanix..." -ForegroundColor Yellow Invoke-WebRequest "$base/fabric-api.jar" -OutFile "$modsDir\fabric-api-0.96.0+1.20.4.jar" -UseBasicParsing Invoke-WebRequest "$base/mechanix.jar" -OutFile "$modsDir\mechanix-1.0.0.jar" -UseBasicParsing # 4 — Add Fabric profile to launcher_profiles.json Write-Host "[4/4] Registering Fabric profile in Minecraft Launcher..." -ForegroundColor Yellow $profilesPath = "$mcDir\launcher_profiles.json" if (Test-Path $profilesPath) { $json = Get-Content $profilesPath -Raw | ConvertFrom-Json $now = (Get-Date).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss.fffZ") $newProfile = [PSCustomObject]@{ created = $now icon = "Crafting_Table" lastUsed = $now lastVersionId = $vid name = "Mechanix (Fabric 1.20.4)" type = "custom" } $json.profiles | Add-Member -NotePropertyName "mechanix-fabric" -NotePropertyValue $newProfile -Force $json | ConvertTo-Json -Depth 20 | Set-Content $profilesPath -Encoding UTF8 Write-Host " Profile added!" -ForegroundColor Green } else { Write-Host " launcher_profiles.json not found — open the Minecraft Launcher once first, then re-run this script." -ForegroundColor Red } Write-Host "" Write-Host "=== Done! ===" -ForegroundColor Green Write-Host "Open the Minecraft Launcher, select 'Mechanix (Fabric 1.20.4)' from the profile dropdown, and click Play." -ForegroundColor Cyan Write-Host "" Read-Host "Press Enter to close"