explaingit

kuohsuanlo/chunkguardagent

Analysis updated 2026-05-18

19JavaAudience · ops devopsComplexity · 4/5Setup · moderate

TLDR

A Java agent for Minecraft Paper/Folia servers that blocks blank, load-failed chunks from overwriting good saved world data during low memory.

Mindmap

mindmap
  root((repo))
    What it does
      Prevent chunk corruption
      Skip bad writes
    Tech stack
      Java
      Bytecode instrumentation
    Use cases
      Protect server worlds
      Survive OOM crashes
    Audience
      Server admins
      Ops teams

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Protect a Minecraft server's world data from corruption during memory pressure or crashes.

USE CASE 2

Run it in shadow mode first to log would-be blocks without changing server behavior.

USE CASE 3

Recover mislabeled chunk data that is actually still intact instead of losing it.

USE CASE 4

Avoid a regenerated empty area silently overwriting a long-inhabited real chunk.

What is it built with?

JavaPaperFoliaBytecode instrumentation

How does it compare?

kuohsuanlo/chunkguardagentcheburnetik/autoconnector_for_telegramgetactivity/easypermissions
Stars191919
LanguageJavaJavaJava
Last pushed2026-01-10
MaintenanceQuiet
Setup difficultymoderateeasyeasy
Complexity4/52/52/5
Audienceops devopsgeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires a Paper or Folia Minecraft server and adding a -javaagent startup flag, a shadow trial mode is recommended before enabling it for real.

No license file is mentioned, so reuse terms are unclear.

In plain English

ChunkGuardAgent is a small Java agent that attaches to a Minecraft server, specifically Paper or Folia servers, to stop a specific kind of world data corruption. In Minecraft, a world is split into pieces called chunks, and when a server runs critically low on memory while loading one, that load can fail, and the game quietly substitutes a blank placeholder for it. The real danger comes later: if the server then saves that blank placeholder to disk before it fully recovers, it can overwrite the actual, good chunk data already saved, permanently destroying a piece of a player's world. The author noticed that if a server happens to crash before that bad save reaches disk, the original good data survives on its own. This tool turns that lucky accident into something guaranteed: it refuses to let a failed blank chunk get written over good existing data. To decide when to block a save, it does not look at file size, since a chunk a player intentionally cleared out can also be small. Instead it checks the chunk's internal status field, which in Minecraft only ever moves forward through a fixed set of stages and never backward. A failed, blank chunk is always stuck in an early stage, while even a chunk a player emptied out by hand still reaches the final stage. So the rule is simple: only skip a save when new data is unfinished but the version already on disk is finished, since that can only mean corruption. On a real production server with many plugins, the author reports it inspected over ten thousand real save events with zero incorrect blocks. It is designed to use very little memory at the exact moments when the server is already short on memory, falling back to reading only a small piece of file header information when memory is critically low. Later versions added two more protections: one that checks how long a chunk has actually been inhabited by players, to avoid a freshly regenerated but empty looking area overwriting an old, long lived chunk, and one that repairs chunk data on read if mislabeled but still intact, so the game does not regenerate over it and wipe out what remains. Installation is done by adding a Java agent flag when starting the server, and it includes a safe trial mode that only logs what it would have blocked.

Copy-paste prompts

Prompt 1
Explain how ChunkGuardAgent decides whether a chunk save should be skipped.
Prompt 2
Walk me through adding the -javaagent flag for ChunkGuardAgent to my Paper server startup.
Prompt 3
Help me interpret ChunkGuardAgent's shadow mode logs before enabling it for real.
Prompt 4
Explain the InhabitedTime check ChunkGuardAgent uses to catch fake regenerated chunks.

Frequently asked questions

What is chunkguardagent?

A Java agent for Minecraft Paper/Folia servers that blocks blank, load-failed chunks from overwriting good saved world data during low memory.

What language is chunkguardagent written in?

Mainly Java. The stack also includes Java, Paper, Folia.

What license does chunkguardagent use?

No license file is mentioned, so reuse terms are unclear.

How hard is chunkguardagent to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is chunkguardagent for?

Mainly ops devops.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.