If MS Paint Can Get an RCE, Your 300-Mod Minecraft Server Can Get Worse
A practical guide to running a 250–350 mod Minecraft server: profile lag with spark, tune JVM flags and heap size, choose the right platform, and restart nightly.
If MS Paint Can Get an RCE, Your 300-Mod Minecraft Server Can Get Worse
The top of Hacker News this week included CVE-2026-83844: remote code execution in MS Paint. MS Paint. A program whose entire feature set is "draw a slightly wobbly line." If that's on the list of things that can hand an attacker a shell, then my little Forge server running 312 jar files — half of them maintained by one person in their spare time, last updated eleven months ago — is not exactly sitting pretty.
That's the thing about running a large modpack for other people: you inherit every mod author's threat model, every plugin's memory leak, and every "works on my machine" config default. And unlike the MS Paint CVE, there's no Patch Tuesday for create-1.20.1-0.5.1.f.jar.
The same HN front page had two other stories that stuck with me. Anthropic's Claude Code sending users' email addresses to websites is a reminder that software does things you didn't explicitly ask for, and you only find out when someone audits it. And Salon shutting down is the ongoing story of the open web getting smaller and more hostile. Self-hosting is the countermove to both — but self-hosting means you own the ops. Including the ugly parts.
So this isn't a "10 tips to boost your TPS" listicle. It's what I've actually learned running a 250–350 mod pack for a small community on a single bare-metal box, and what I'd tell someone about to do the same.
Profile first, or you're just guessing
The single biggest mistake I see in modded server threads is people pasting Aikar's flags into a startup script without ever checking what's actually eating their tick budget. You end up throwing a 12 GB heap at a problem that's actually a single misconfigured mod spawning 40,000 chickens in one chunk.
Install spark on the server — it's available for Forge, NeoForge, and Fabric, and it's the closest thing modded Minecraft has to a real profiler. Then, while the server is lagging, run:
/spark profiler start --timeout 120
Wait for players to complain about the exact thing they always complain about, then let it finish (or /spark profiler stop early). You get a link to a web viewer that breaks down tick time by mod, by class, by call stack. This is the part that actually matters: it tells you whether your problem is entity AI, chunk generation, block entity ticking, or GC pauses.
My first profile on a pack I thought was "just heavy" showed 38% of tick time in a single mob-spawning mod's pathfinding. Disabling one config option in that mod's server config — reducing the max pack size — cut tick time by a third. No JVM tuning involved.
/spark tps and /spark tickmonitor --threshold 100% are also worth knowing; the latter logs every tick that exceeds its budget, which is how you correlate "lag spike" with "the moment someone walked into the nether hub."
The JVM is maybe 40% of the fight
I'm going to be honest: Aikar's flags are still the sane default for modded servers in 2026, and most people running "custom" flag sets are copying something from a 2019 Reddit thread. Here's the startup script I actually use, annotated:
#!/usr/bin/env bash
# /srv/minecraft/packs/atm10/start.sh
set -euo pipefail
JAVA=/usr/lib/jvm/java-21-openjdk-amd64/bin/java
PACK=/srv/minecraft/packs/atm10
MEM=12G # 16 GB box, ~4 GB left for OS, page cache, and off-heap
exec "$JAVA" \
-Xms$MEM -Xmx$MEM \
-XX:+UseG1GC -XX:+ParallelRefProcEnabled \
-XX:MaxGCPauseMillis=200 \
-XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC \
-XX:+AlwaysPreTouch \
-XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 \
-XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 \
-XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 \
-XX:InitiatingHeapOccupancyPercent=15 \
-XX:G1MixedGCLiveThresholdPercent=90 \
-XX:G1RSetUpdatingPauseTimePercent=5 \
-XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem \
-XX:MaxTenuringThreshold=1 \
-Dusing.aikars.flags=https://mcflags.emc.gs \
-Daikars.new.flags=true \
-jar "$PACK/forge-1.21.1-52.0.20-shim.jar" nogui
Three things worth calling out:
Xms equals Xmx. For a server that runs 24/7, resizing the heap is worse than just allocating it. AlwaysPreTouch forces the pages to be committed at startup, which makes boot slower but removes a class of first-hour stutter.
Don't give the JVM all your RAM. Modpacks leak. Off-heap allocations (Netty buffers, native libs, JNI) live outside -Xmx, and if the OS starts swapping your server, the tick loop will feel like molasses. On a 16 GB box, 12 GB heap is already aggressive.
If you're on a 32 GB+ heap with Java 21, generational ZGC is worth a benchmark. I've measured it beating G1 on large-heap packs with frequent minor collections, and losing to G1 on smaller heaps. Don't cargo-cult my result — run /spark tps for 20 minutes each way and decide. Aikar's flags are tuned for G1; if you go ZGC you can drop most of them.
Also: restart nightly. Not because Java needs it, but because modpacks accumulate state — loaded chunks, leaked entity references, growing lists in mods that never got audited. A 4 a.m. restart via systemd timer fixed more "server gets laggy after 20 hours" complaints for me than any flag tweak.
The table I wish someone had shown me
Picking your server platform is the highest-leverage decision, and the "best" answer depends on what your pack actually is. Here's how the options shake out for large packs:
| Platform | Mod support | Plugin support | Performance | When I'd use it |
|---|---|---|---|---|
| Vanilla | none | none | baseline | Never, for a modpack |
| Paper / Purpur | none | full Bukkit/Spigot | best in class | Big plugin-driven servers; not modpacks |
| Fabric + perf mods | full (Fabric) | limited (via server-side) | very good | Packs built on Fabric; best perf-to-mod ratio |
| Forge | full (Forge) | none natively | mediocre, tuning helps | Legacy packs; most 1.12–1.20 modpacks |
| NeoForge | full (NeoForge) | none natively | better than Forge | Modern packs on 1.20.2+; the sane Forge successor |
| Hybrid (Arclight, Mohist) | partial | partial | unpredictable | Last resort only — I've had worlds corrupt |
The hybrid row is the one people get wrong. Yes, running Forge mods and Bukkit plugins sounds great. In practice, hybrid loaders break on large packs in ways that are hard to debug and occasionally catastrophic — block entities desyncing, chunk corruption on crash. If someone tells you "just use Mohist for your 300-mod pack," walk away.
For a large pack in 2026, my default is NeoForge if the pack supports it, Fabric + performance mods if the pack is Fabric-native, and Forge only when the pack's mod list pins me there. Paper is fantastic — for servers that aren't running mods.
Cut load at the config layer before you buy more RAM
The second-highest-leverage move is reducing what the server has to simulate. This is boring and it works:
view-distance=6(down from 10) inserver.properties. This is the single biggest CPU saving available. Players will complain for a day and then forget.simulation-distance=4. Entities outside this radius don't tick. On a big pack, this is often worth more than a hardware upgrade.entity-cramming=24or lower. Farms that pack 100 chickens into one block are a classic TPS killer.sync-chunk-writes=falseon NVMe. Small risk on hard crash; noticeable improvement on chunk-heavy servers. I run it and keep good backups.- For Forge/NeoForge,
config/forge-server.toml: setremoveErroringEntities=trueandremoveErroringBlockEntities=true. One broken mod's misbehaving entity won't drag the whole tick loop down. - Watchdog:
max-tick-time=-1is the pragmatic setting for big packs. Yes, it means a truly hung server won't auto-restart — pair it with an external health check instead. Blindly disabling it without monitoring is how you get a "server's down" message three hours later.
Pregen your world. Please.
The most common cause of "the server freezes when someone explores" is on-demand chunk generation. A large modpack generates expensive chunks — biome decoration, structure placement, mod-specific worldgen. Generating them while players are online is brutal.
Use Chunky to pre-generate the area you care about before you open the server to the public:
/chunky world minecraft:overworld
/chunky radius 3000
/chunky start
A 3000-block radius is 6,000 blocks across — that's ~36 million blocks, or roughly 560,000 chunks. On my box that took most of a weekend, throttled so it didn't melt the CPU. It's the best-spent weekend of server admin I've ever had. Set chunky.yml to pause generation when players are online, and let it grind overnight.
Storage, backups, and the supply-chain lesson
The Salon shutdown and the Claude Code telemetry story both point at the same thing: the stuff you depend on can change or disappear without asking you. Your modpack has 300 dependencies from a handful of platforms, and any one of them can yank a version, change a license, or push a bad update.
Concretely:
- Pin mod versions and checksum your jars. Don't let an auto-updater touch a working pack. I keep a
mods.sha256file next to the pack and verify it after any manual change. If a jar's hash doesn't match what I approved, the server doesn't start. - Run as an unprivileged user, in a dedicated directory, with no outbound network access except to Mojang's auth endpoints. Mods that "phone home" for analytics or update checks are common — and, per the Claude Code issue, not always honest about what they send.
- Don't expose RCON to the internet. The number of modded servers I've seen with port 25575 open and password
minecraftis genuinely upsetting. Bind RCON to localhost and use SSH tunnels. Speaking of which, the sshole tool that hit the front page this week is a good reminder to think about how you're granting shell access — keys and certificates, not shared passwords. - Backups, tested. I use restic to a separate disk plus an offsite bucket, with a nightly
systemdtimer. The world folder is ~40 GB for my pack; deduplication makes the incremental cost trivial. I've written about the automation side of this in The Pragmatic Self-Hosted Home Lab — the same patterns apply directly to a game server. - Monitor the box, not just the server. A
node_exporter+ Prometheus + Grafana setup watching CPU, memory, disk I/O, and JVM heap has caught more problems before players noticed than any in-game plugin. My stack for that is in A Pragmatic Self-Hosted DevOps Stack for the Homelab, and it works fine pointed at a Minecraft host.
One caveat on backups: if you're running a hybrid loader or a pack with a lot of worldgen mods, test your restores. I once restored a world and discovered that removing a structure mod left orphaned block entity data that crashed the server on load. Backups you haven't restored from are just optimism.
What I'd actually do next
If you're about to spin up a big modpack for other people, here's the order I'd do things in:
- Pick the right platform — NeoForge or Fabric-native, not a hybrid. This decision constrains everything else.
- Pre-generate the world with Chunky before you invite anyone. Overnight, throttled.
- Set
view-distance=6andsimulation-distance=4. Do this before you tune the JVM. It's free. - Apply Aikar's flags with a heap that leaves 3–4 GB for the OS. Restart nightly via timer.
- Profile with spark the first time someone complains. Don't guess.
- Pin and checksum your mods, run as an unprivileged user, close your RCON port, and set up tested backups with restic.
None of this is glamorous. It's the same discipline as building a pragmatic homelab: know what you're running, reduce the attack surface, automate the boring parts, and test the things you're betting on. MS Paint getting a CVE didn't change that. It just made the case more vividly.
Recommended tools & services
Disclosure: some links below are affiliate links. If you buy through them I may earn a commission at no extra cost to you. I only list tools I actually run.
| Tool | Why it is here | |
|---|---|---|
| Amazon - SSDs & NVMe | Boot drives and storage for your homelab | Visit |
| Amazon - Mini PCs | Low-power always-on nodes (ProDesk, EliteDesk, N100 boxes) | Visit |
| Amazon - PC Components | CPUs, RAM and cases for a build | Visit |
| Amazon - GPUs | Consumer GPUs for local inference (16GB VRAM is the sweet spot) | Visit |
| Amazon - RAM & Memory | More RAM is the cheapest upgrade for VMs and containers | Visit |
| Wasabi | Flat-rate hot storage, no egress fees | Visit |