Skip to main content

Anti-Xray (Paper)

This guide explains how to use Paper's built-in anti-xray feature through the paper-world-defaults.yml file.
The goal is practical: enable basic protection against X-ray without adding a plugin.


File location and important structure

The relevant configuration file is at home/container/config/paper-world-defaults.yml or it can be overridden per each world's folder. The section that needs to be changed looks like this:

anti-xray:
enabled: false
engine-mode: 1
hidden-blocks:
- copper_ore
- raw_copper_block
- deepslate_copper_ore
- iron_ore
- deepslate_iron_ore
- gold_ore
- deepslate_gold_ore
- coal_ore
- deepslate_coal_ore
- lapis_ore

Reasonable settings recommendations

anti-xray:
enabled: true
engine-mode: 1
  1. Use engine-mode 1 to minimize the risk of glitches and overhead.
  2. Make sure the hidden-blocks list is complete (see the recommendation list).
  3. Observe for at least 7 days before enabling automatic sanctions.

List of blocks that should be hidden

Add all ore variants and sensitive blocks so protection is more effective:

  • coal_ore; deepslate_coal_ore
  • iron_ore; deepslate_iron_ore
  • copper_ore; raw_copper_block; deepslate_copper_ore
  • gold_ore; deepslate_gold_ore; nether_gold_ore
  • lapis_ore; deepslate_lapis_ore
  • redstone_ore; deepslate_redstone_ore
  • diamond_ore; deepslate_diamond_ore
  • emerald_ore; deepslate_emerald_ore
  • nether_quartz_ore
  • ancient_debris

Example:

anti-xray:
enabled: true
engine-mode: 1
hidden-blocks:
- coal_ore
- deepslate_coal_ore
- iron_ore
- deepslate_iron_ore
- copper_ore
- raw_copper_block
- deepslate_copper_ore
- gold_ore
- deepslate_gold_ore
- nether_gold_ore
- lapis_ore
- deepslate_lapis_ore
- redstone_ore
- deepslate_redstone_ore
- diamond_ore
- deepslate_diamond_ore
- emerald_ore
- deepslate_emerald_ore
- nether_quartz_ore
- ancient_debris

Save and Restart the Server to apply


Quick troubleshooting

  • Visual glitch → lower the engine-mode or reduce hidden-blocks.
  • TPS drop → enable async if available, or lower strictness; optimize Paper.
  • Still leaking → make sure all ore variants are listed; test mode 2 only if the server can handle it.