# ============================================================ # Plom Mods Installer # Installs Fabric + mods for Minecraft 26.1.2 # https://mods.plom.one # ============================================================ $ErrorActionPreference = "Stop" $MC_VERSION = "26.1.2" $FABRIC_INSTALLER_VERSION = "1.1.1" Write-Host "" Write-Host "=================================" -ForegroundColor Cyan Write-Host " Plom Mods Installer" -ForegroundColor Cyan Write-Host " Minecraft $MC_VERSION + Fabric" -ForegroundColor Cyan Write-Host "=================================" -ForegroundColor Cyan Write-Host "" # ── Step 1: Find .minecraft ─────────────────────────────────────────────────── $mcDir = "$env:APPDATA\.minecraft" if (-not (Test-Path $mcDir)) { Write-Host "ERROR: .minecraft folder not found at $mcDir" -ForegroundColor Red Write-Host "Please open the Minecraft Launcher and log in first, then re-run." -ForegroundColor Yellow exit 1 } Write-Host "[1/4] .minecraft: $mcDir" -ForegroundColor Green # ── Step 2: Find Java ───────────────────────────────────────────────────────── Write-Host "[2/4] Finding Java..." -ForegroundColor Yellow $javaExe = $null # Prefer Minecraft's own bundled JRE (always present if you've launched the game) $runtimeDir = "$mcDir\runtime" if (Test-Path $runtimeDir) { $javaExe = Get-ChildItem -Path $runtimeDir -Filter "java.exe" -Recurse -ErrorAction SilentlyContinue | Sort-Object -Property FullName -Descending | Select-Object -First 1 -ExpandProperty FullName } # Fall back to whatever java is on PATH if (-not $javaExe) { $systemJava = Get-Command java -ErrorAction SilentlyContinue if ($systemJava) { $javaExe = $systemJava.Source } } if (-not $javaExe) { Write-Host "ERROR: Java not found." -ForegroundColor Red Write-Host "Please launch Minecraft $MC_VERSION at least once so it installs its bundled Java." -ForegroundColor Yellow exit 1 } Write-Host "[2/4] Java: $javaExe" -ForegroundColor Green # ── Step 3: Install Fabric ──────────────────────────────────────────────────── Write-Host "[3/4] Installing Fabric..." -ForegroundColor Yellow # Fabric installer (and mod file replacement) will fail if the game is running while (@(Get-Process -Name "javaw", "Minecraft", "MinecraftLauncher" -ErrorAction SilentlyContinue).Count -gt 0) { Write-Host "" Write-Host " Minecraft is currently running!" -ForegroundColor Red Write-Host " Please close the game and the Minecraft Launcher, then press Enter to continue." -ForegroundColor Yellow Read-Host " Press Enter when Minecraft is closed" } # Get latest Fabric loader version for this MC version $loaderData = Invoke-RestMethod "https://meta.fabricmc.net/v2/versions/loader/$MC_VERSION" $loaderVersion = $loaderData[0].loader.version Write-Host " Loader: $loaderVersion" # Download Fabric installer $installerUrl = "https://maven.fabricmc.net/net/fabricmc/fabric-installer/$FABRIC_INSTALLER_VERSION/fabric-installer-$FABRIC_INSTALLER_VERSION.jar" $installerJar = "$env:TEMP\fabric-installer-$FABRIC_INSTALLER_VERSION.jar" Write-Host " Downloading Fabric installer $FABRIC_INSTALLER_VERSION..." Invoke-WebRequest $installerUrl -OutFile $installerJar -UseBasicParsing # Run the installer (CLI mode - no GUI since we pass flags) Write-Host " Running installer (may take a moment if downloading game files)..." & $javaExe -jar $installerJar client -mcversion $MC_VERSION -loader $loaderVersion -dir $mcDir if ($LASTEXITCODE -ne 0) { Write-Host " Note: installer exited $LASTEXITCODE (Fabric may already be installed)" -ForegroundColor Yellow } Write-Host "[3/4] Fabric ready." -ForegroundColor Green # ── Step 4: Download Mods ───────────────────────────────────────────────────── Write-Host "[4/4] Downloading mods..." -ForegroundColor Yellow $modsDir = "$mcDir\mods" if (-not (Test-Path $modsDir)) { New-Item -ItemType Directory -Path $modsDir | Out-Null } # Prompt before clearing existing mods $oldJars = @(Get-ChildItem -Path $modsDir -Filter "*.jar" -ErrorAction SilentlyContinue) if ($oldJars.Count -gt 0) { Write-Host "" Write-Host " Found $($oldJars.Count) existing mod(s):" -ForegroundColor Yellow $oldJars | ForEach-Object { Write-Host " - $($_.Name)" } Write-Host "" $choice = Read-Host " Delete existing mods before installing? [Y/n]" if ($choice -eq "" -or $choice -match "^[Yy]") { Write-Host " Removing old mod file(s)..." $oldJars | Remove-Item -Force } else { Write-Host " Keeping existing mods (new mods will be added alongside them)." -ForegroundColor Cyan } Write-Host "" } # Modrinth project slugs / IDs $mods = @( "fabric-api", # Required by almost everything "sodium", # Performance - better rendering "lithium", # Performance - game logic optimizations "appleskin", # Shows food saturation info "chat-heads", # Player heads next to chat messages "fxxUqruK" # Voxy - long-distance rendering ) $gvParam = [uri]::EscapeDataString('["' + $MC_VERSION + '"]') $ldParam = [uri]::EscapeDataString('["fabric"]') foreach ($modId in $mods) { try { $apiUrl = "https://api.modrinth.com/v2/project/$modId/version?game_versions=$gvParam&loaders=$ldParam" $versions = Invoke-RestMethod $apiUrl if (-not $versions -or $versions.Count -eq 0) { Write-Host " [SKIP] No Fabric/$MC_VERSION release found for: $modId" -ForegroundColor Yellow continue } $file = $versions[0].files | Where-Object { $_.primary } | Select-Object -First 1 if (-not $file) { $file = $versions[0].files[0] } Write-Host " + $($file.filename)" Invoke-WebRequest $file.url -OutFile "$modsDir\$($file.filename)" -UseBasicParsing } catch { Write-Host " [FAIL] $modId`: $_" -ForegroundColor Red } } Write-Host "[4/4] Mods downloaded." -ForegroundColor Green # ── Done ────────────────────────────────────────────────────────────────────── Write-Host "" Write-Host "All done!" -ForegroundColor Green Write-Host "Open the Minecraft Launcher and select the Fabric profile to play:" -ForegroundColor White Write-Host " fabric-loader-$loaderVersion-$MC_VERSION" -ForegroundColor Cyan Write-Host ""