1. Nightkeeper
  2. Guides
  3. Catch x-ray

How to detect and stop x-ray on a Minecraft server

X-ray ruins a survival economy quietly: nobody sees it happen, diamonds just stop being worth anything. You can make it much harder, and you can catch the players who try, as long as you judge them on data rather than a hunch.

The short version

  • On Paper, turn on the built-in anti-xray. It hides ores that aren't exposed to air.
  • X-rayers mine very little stone per vein, and the veins they find are almost always hidden ones.
  • Lucky players exist. Look at a pattern over several sessions before you ban.

1. Prevent it with anti-xray

Paper includes an anti-xray feature that changes what the server sends to players, so an x-ray texture pack or mod has nothing real to show. It's set in config/paper-world-defaults.yml (or per world, in that world's paper-world.yml):

anticheat:
  anti-xray:
    enabled: true
    engine-mode: 1
  • Engine mode 1 disguises hidden ores as ordinary stone, deepslate or netherrack. It's cheap and stops most x-ray.
  • Engine mode 2 also fills hidden blocks with fake ores, so x-ray shows ore everywhere and is useless. It's stronger, but sends more data to players.

Restart the server after changing it. Anti-xray only hides blocks that aren't touching air, so ores visible in caves still show up, and it won't catch every cheat client. That's why detection still matters.

2. Know what x-ray mining looks like

Honest miners dig a lot of stone for every diamond vein, through strip mines, branch mines or caves. Many of the veins they find are already exposed to air in a cave or ravine. X-rayers do the opposite:

  • Very little stone per vein. They tunnel straight from one vein to the next.
  • Mostly hidden veins. The ores they mine were fully enclosed in stone, with no way to see them.
  • Tunnels that bend toward ores. Seen from spectator mode, the tunnels turn and dip exactly where a vein is, then move on.
  • A high rate of diamonds or ancient debris per hour compared with other players at the same stage.

3. Check a suspect with your block logger

If you run CoreProtect, look at what a player broke over the last few days:

/co lookup u:<player> a:-block b:diamond_ore,deepslate_diamond_ore t:3d
/co lookup u:<player> a:-block b:stone,deepslate t:3d

Compare the two counts. Then fly over their tunnels in spectator mode with /gamemode spectator and look at the shape. A random tunnel that keeps finding hidden veins is the strongest evidence you can get.

4. Avoid banning lucky players

  • One good session proves nothing. Look across several.
  • Cave mining finds a lot of ore with little stone, but those veins are exposed. That's legit.
  • Fortune, trading and loot chests change diamond counts without any mining.
  • When the evidence is borderline, watch instead of acting. An x-rayer keeps doing it.

If you do act, keep the evidence. A ban with a record like "4 hidden veins in 128 stone across three sessions" survives an appeal. A ban because they "had too many diamonds" doesn't.

How Warden handles x-ray

Warden, the AI staff team on every Nightkeeper server, runs this check on every player, all the time:

  • It records whether each ore was visible when it was mined, and scores stone per vein and the share of veins that were hidden against legit odds.
  • It builds an evidence map of the player's tunnel against the ores around it.
  • By default it brings strong cases to you with the evidence instead of banning on a hunch. You can let it act on its own if you prefer.

One example from Warden's incident log: a player found 4 valuable veins after mining only 128 stone, and 75% of those veins were completely hidden. That's 5.6 times above legit odds. Warden flagged it to the owner with the evidence.