← All articles
Catching cheatersNov 7, 20262 min read

How can I tell if a player is x-raying on my Minecraft server?

X-ray is hard to catch because the player isn't moving or clicking strangely. They just always seem to know where the ore is. You have two options: try to spot it from how they mine, or stop the ore data reaching their client at all. The second one works far better.

What x-ray mining looks like

A player using x-ray mines like they have a map. The usual signs:

None of these is proof on its own. Some players are lucky, and some branch mine in long straight lines that happen to hit diamonds. Spotting it by hand means going through replays or block logs, which falls apart once you have more than a couple of suspects.

Hide the ore instead

X-ray works because the server sends every block in a chunk to the client, including ore buried in stone. The x-ray client simply hides the stone. If the server never sends the real ore, there is nothing to reveal.

Paper has this built in. It's called anti-xray, or ore obfuscation, and it replaces hidden ore with fake blocks in the chunk data before it's sent. Players only get the real block once it's exposed. It ships with Paper but is turned off by default, and a lot of server owners never find the setting.

Turning it on

Anti-xray is set per world in Paper's world config files. You turn it on under anticheat.anti-xray and choose an engine mode. Restart the server after changing it, because a reload won't apply it.

Rook's /ac antixray command shows whether Paper's anti-xray is on in each world, and gives you the exact config to turn it on if it's off. Rook deliberately doesn't rebuild that engine itself, since Paper's runs inside the chunk sending code where it belongs.

Without anti-xray Server real ore sent X-ray client sees every diamond With Paper anti-xray Server fake ore sent X-ray client sees nothing useful

Catching the ones who still try

With anti-xray on, the obvious x-ray clients stop working, but you may still want to know who tried. Rook also has a check that scores players who keep mining sealed ore with no exposed faces and flags them for staff to review. It doesn't ban automatically, because lucky branch mining can look similar for a while. Use the flag as a reason to check their mining history, not as the verdict.

More like this