# ============================================================ # 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" $RAM_MAX_GB = 12 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" # Skip if this exact Fabric version is already installed $fabricVersionDir = "$mcDir\versions\fabric-loader-$loaderVersion-$MC_VERSION" if (Test-Path $fabricVersionDir) { Write-Host " Already installed, skipping." -ForegroundColor Cyan } else { # 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 " Warning: installer exited with code $LASTEXITCODE" -ForegroundColor Yellow } } # Patch the launcher profile to use more RAM $profilesPath = "$mcDir\launcher_profiles.json" if (Test-Path $profilesPath) { $profiles = Get-Content $profilesPath -Raw | ConvertFrom-Json $profileKey = $profiles.profiles.PSObject.Properties.Name | Where-Object { $_ -like "*fabric-loader*$MC_VERSION*" } | Select-Object -First 1 if ($profileKey) { $current = $profiles.profiles.$profileKey.javaArgs $updated = $current -replace '-Xmx\d+[GgMm]', "-Xmx${RAM_MAX_GB}G" if ($updated -notmatch '-Xmx') { $updated = "-Xmx${RAM_MAX_GB}G $updated" } $profiles.profiles.$profileKey.javaArgs = $updated # Write without BOM — the Fabric installer's JSON parser rejects files that start with a BOM $utf8NoBom = New-Object System.Text.UTF8Encoding $false [System.IO.File]::WriteAllText($profilesPath, ($profiles | ConvertTo-Json -Depth 20), $utf8NoBom) Write-Host " RAM: set to ${RAM_MAX_GB}GB (was: $current)" } else { Write-Host " Could not find Fabric launcher profile to patch RAM." -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 } # Modrinth project slugs / IDs $mods = @( "appleskin", # Shows food saturation info "chat-heads", # Player heads next to chat messages "cloth-config", # Config library required by many mods "fabric-api", # Required by almost everything "iris", # Shader support "lithium", # Performance - game logic optimizations "modmenu", # In-game mod list and config UI "sodium", # Performance - better rendering "fxxUqruK" # Voxy - long-distance rendering ) $gvParam = [uri]::EscapeDataString('["' + $MC_VERSION + '"]') $ldParam = [uri]::EscapeDataString('["fabric"]') # Resolve mod metadata from Modrinth first so we can show what will be installed Write-Host " Resolving mods..." -ForegroundColor Yellow # Batch-fetch project titles (one call for all mods) $projectTitles = @{} try { $idsParam = [uri]::EscapeDataString(($mods | ConvertTo-Json -Compress)) $projects = Invoke-RestMethod "https://api.modrinth.com/v2/projects?ids=$idsParam" $projects | ForEach-Object { $projectTitles[$_.id] = $_.title; $projectTitles[$_.slug] = $_.title } } catch {} $modQueue = @() 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] } $displayName = if ($projectTitles[$modId]) { $projectTitles[$modId] } else { $modId } $modQueue += [PSCustomObject]@{ Name = $displayName; File = $file } } catch { Write-Host " [FAIL] $modId`: $_" -ForegroundColor Red } } Write-Host "" Write-Host " Will install $($modQueue.Count) mod(s):" -ForegroundColor Cyan $modQueue | ForEach-Object { Write-Host " - $($_.Name)" } Write-Host "" # Prompt before clearing existing mods $oldJars = @(Get-ChildItem -Path $modsDir -Filter "*.jar" -ErrorAction SilentlyContinue) if ($oldJars.Count -gt 0) { Write-Host " Found $($oldJars.Count) existing mod(s) in mods folder:" -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 "" } # Download $installedMods = @() foreach ($mod in $modQueue) { try { Invoke-WebRequest $mod.File.url -OutFile "$modsDir\$($mod.File.filename)" -UseBasicParsing $installedMods += $mod.Name } catch { Write-Host " [FAIL] $($mod.Name)`: $_" -ForegroundColor Red } } Write-Host "[4/4] Mods downloaded." -ForegroundColor Green # ── Done ────────────────────────────────────────────────────────────────────── Write-Host "" Write-Host "All done!" -ForegroundColor Green Write-Host "" Write-Host "Installed mods:" -ForegroundColor White $installedMods | ForEach-Object { Write-Host " - $_" -ForegroundColor Cyan } Write-Host "" 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 ""