Skip to main content
← All Guides
Performance · 5 min read

Paper Anti-Xray Feature Explained

Understand Paper's built-in anti-xray system, how engine modes work, and how to configure it without hurting server performance.

What Is Anti-Xray?

X-ray is a cheat that lets players see through blocks to find ores, caves, and hidden structures. Paper includes a built-in anti-xray system that hides ore locations from cheating clients without requiring a separate plugin. Understanding paper anti xray explained properly helps you pick the right mode and avoid unnecessary performance costs.

How It Works

Paper's anti-xray modifies the chunk data sent to clients. Instead of sending real block information for hidden ores, it replaces them with fake blocks. When a player legitimately exposes an ore by mining adjacent blocks, the server sends the real data. Cheating clients only see the fake data, making x-ray useless.

Engine Mode 1 vs Engine Mode 2

Engine Mode 1: Hide and Replace

Mode 1 replaces all hidden ore blocks with stone (or the appropriate base block). The client sees a world where ores only appear when exposed to air. This mode is lightweight because it only modifies existing ore positions.

anticheat:
  anti-xray:
    enabled: true
    engine-mode: 1
    hidden-blocks:
      - diamond_ore
      - deepslate_diamond_ore
      - gold_ore
      - deepslate_gold_ore
      - iron_ore
      - deepslate_iron_ore
      - emerald_ore
      - deepslate_emerald_ore
      - lapis_ore
      - deepslate_lapis_ore
      - copper_ore
      - deepslate_copper_ore
      - redstone_ore
      - deepslate_redstone_ore

Engine Mode 2: Fake Ore Injection

Mode 2 replaces all stone/deepslate blocks that are not exposed to air with a random mix of ore types. This creates a "noise" pattern where every hidden block could be an ore, making it impossible for x-ray users to distinguish real ores from fake ones. This is the more secure option but has a higher performance and bandwidth cost.

anticheat:
  anti-xray:
    enabled: true
    engine-mode: 2
    replacement-blocks:
      - stone
      - deepslate
      - oak_planks
      - chest

Performance Impact

Paper anti xray explained in terms of performance: Mode 1 has negligible overhead. It simply swaps block IDs during chunk serialization. Mode 2 is heavier because it generates fake ore patterns for every hidden block, which increases both CPU usage during chunk sending and network bandwidth.

On a 50-player server, Mode 2 typically adds 1 to 3 ms per chunk send operation. This is usually acceptable, but on servers with very fast chunk loading (pregened worlds with NVMe storage), it can become noticeable. Profile with Spark and look for anti-xray in the chunk sending section.

Which Mode Should You Use?

  • Mode 1 if performance is your priority and you are comfortable with slightly weaker protection. Sophisticated x-ray clients can sometimes distinguish the pattern of replaced blocks.
  • Mode 2 if security is your priority. This mode is effectively unbeatable by client-side x-ray. The performance cost is worth it for competitive or economy-heavy servers where ore cheating undermines gameplay.

Configuration Tips

For paper anti xray explained in practice:

  • Add chest to hidden blocks if you want to protect hidden storage.
  • Add spawner to prevent players from finding mob spawners with x-ray.
  • In the Nether, add ancient_debris and nether_gold_ore.
  • Do not add too many block types to Mode 2 replacement blocks, as each additional type increases chunk data size.

See an optimized server in action: Astroworld MC, IP play.astroworldmc.com, Java + Bedrock.

Anti-Xray and Chunk Loading

Paper anti xray explained often raises questions about interaction with chunk optimizations. Anti-xray runs during chunk packet creation, not during chunk loading. This means pregenerating your world does not bypass anti-xray. Every chunk is processed when sent to a player, regardless of whether it was pregenerated. However, pregeneration does reduce the total work per chunk because generation and anti-xray do not stack on the same tick.

Pair anti-xray with chunk loading optimizations for the best balance of security and performance.

Related Tools & Resources

🔧

Minecraft Tools

Calculators, generators & server tools

🧱

Item Database

Browse all Minecraft items, stats & recipes

⚒️

Crafting Recipes

Visual crafting guides for every recipe