Skip to content

Minecraft: Configure Anti-Xray in Paper – Guide

Learn how to enable Paper's built-in Anti-Xray, choose the right mode, and configure the Nether and End separately.

26 November 20265 min read2 Views0 helpful

Don't have your own server yet? Host your Minecraft server with ZAP-Hosting from €4.49 / month.Or try 3 days from €0.81

Introduction

With X-ray mods or texture packs, players can see ores through walls and find diamonds in minutes. Paper has a built-in Anti-Xray feature to counter this: the server sends players false data for hidden blocks, so an X-ray client only sees stone or random fake ores. Anti-Xray is disabled by default. In this guide, you'll learn how to enable it, which mode is right for your server, and what its limitations are.

Before you start

  • A Minecraft server running the Paper or Purpur server type (Purpur is based on Paper). Paper's Anti-Xray feature isn't available on Vanilla, Fabric, or Forge. You can change the server type under Games & variants; see Switch games and manage variants.
  • The settings are in the config/paper-world-defaults.yml file. The Files tab automatically opens the folder for your active variant, for example, minecraft/paper/.
Tip

Back up the file first If you've already changed other values in the file, download it to your PC using Download before editing it.

The three modes

Use engine-mode to choose how Paper hides ores:

ModeHow it worksProtectionPerformance
1Hidden blocks appear as stone (deepslate below Y 0, netherrack in the Nether, and end stone in the End).Hides only ores completely surrounded by solid blocks. Ores next to caves or water remain visible.Uses the fewest resources, especially on the player side
2Paper fills the rock with random fake ores. An X-ray client sees ores everywhere and can't find the real ones.Better than mode 1Requires more processing, especially on the player side
3Like mode 2, but uses the same fake blocks for each layer of a chunk instead of for each block.Similar to mode 2Roughly halves the amount of data sent when entering and is easier to compress

Mode 1 has the least impact on performance. To make X-ray more difficult, use mode 2 or 3.

Enable Anti-Xray

  1. Stop your server.
  2. In the Files tab, open the config/paper-world-defaults.yml file.
  3. Find the anticheat: section and its anti-xray: subsection, then replace it with one of the blocks below.
  4. Click Save and start your server.
Warning

Pay attention to indentation YAML files are sensitive to spaces. Use the exact indentation shown and don't use tabs.

yaml
anticheat:
  anti-xray:
    enabled: true
    engine-mode: 1
    hidden-blocks:
    - chest
    - coal_ore
    - deepslate_coal_ore
    - copper_ore
    - deepslate_copper_ore
    - raw_copper_block
    - diamond_ore
    - deepslate_diamond_ore
    - emerald_ore
    - deepslate_emerald_ore
    - gold_ore
    - deepslate_gold_ore
    - iron_ore
    - deepslate_iron_ore
    - raw_iron_block
    - lapis_ore
    - deepslate_lapis_ore
    - redstone_ore
    - deepslate_redstone_ore
    lava-obscures: false
    max-block-height: 64
    replacement-blocks: []
    update-radius: 2
    use-permission: false

For mode 3, use the same block and only change engine-mode: 3.

yaml
anticheat:
  anti-xray:
    enabled: true
    engine-mode: 2
    hidden-blocks:
    - air
    - copper_ore
    - deepslate_copper_ore
    - raw_copper_block
    - diamond_ore
    - deepslate_diamond_ore
    - gold_ore
    - deepslate_gold_ore
    - iron_ore
    - deepslate_iron_ore
    - raw_iron_block
    - lapis_ore
    - deepslate_lapis_ore
    - redstone_ore
    - deepslate_redstone_ore
    lava-obscures: false
    max-block-height: 64
    replacement-blocks:
    - chest
    - amethyst_block
    - andesite
    - budding_amethyst
    - calcite
    - coal_ore
    - deepslate_coal_ore
    - deepslate
    - diorite
    - dirt
    - emerald_ore
    - deepslate_emerald_ore
    - granite
    - gravel
    - oak_planks
    - smooth_basalt
    - stone
    - tuff
    update-radius: 2
    use-permission: false
Info

air in hidden-blocks With air in the list, Paper also creates fake holes. This helps counter cave finders and hides ores on cave walls, but may lower players' FPS. If your players experience issues, remove the - air line.

Configure the Nether and End

The values in paper-world-defaults.yml apply to all worlds. The Nether needs different blocks, and Anti-Xray isn't necessary in the End. Configure both in the paper-world.yml file in the folder for the relevant dimension. The folder location depends on your Minecraft version:

DimensionPaper 26.1 and laterPaper up to 1.21
Netherworld/dimensions/minecraft/the_nether/paper-world.ymlworld_nether/paper-world.yml
Endworld/dimensions/minecraft/the_end/paper-world.ymlworld_the_end/paper-world.yml

If your world isn't named world, replace the name accordingly. See Manage worlds for more about the world format.

By default, the file only contains _version. Leave this line in place and add only the anticheat block below it. The world will continue to inherit all other values from paper-world-defaults.yml.

Nether with mode 1:

yaml
anticheat:
  anti-xray:
    enabled: true
    engine-mode: 1
    hidden-blocks:
    - ancient_debris
    - nether_gold_ore
    - nether_quartz_ore
    lava-obscures: false
    max-block-height: 128
    replacement-blocks: []
    update-radius: 2
    use-permission: false

Nether with mode 2 or 3:

yaml
anticheat:
  anti-xray:
    enabled: true
    engine-mode: 2
    hidden-blocks:
    - air
    - ancient_debris
    - bone_block
    - glowstone
    - magma_block
    - nether_bricks
    - nether_gold_ore
    - nether_quartz_ore
    - polished_blackstone_bricks
    lava-obscures: false
    max-block-height: 128
    replacement-blocks:
    - basalt
    - blackstone
    - gravel
    - netherrack
    - soul_sand
    - soul_soil
    update-radius: 2
    use-permission: false

End (all modes):

yaml
anticheat:
  anti-xray:
    enabled: false

Restart your server afterward.

Settings in detail

SettingMeaning
enabledTurns Anti-Xray on (true) or off (false, default).
engine-modeMode 1, 2, or 3; see above.
hidden-blocksBlocks to hide. In modes 2 and 3, these are also the fake blocks. In modes 2 and 3, Paper can't use chests or other blocks with contents as fake blocks.
replacement-blocksModes 2 and 3 only: blocks that are additionally replaced with fake blocks, such as stone. This list isn't used in mode 1.
max-block-heightAnti-Xray works up to this height. Values must be multiples of 16; Paper rounds other values down. Recommended: 64 in the Overworld, 128 in the Nether.
update-radiusThe radius within which Paper reveals real blocks when mining. Values from 0 to 2 are allowed; the default is 2. 0 is intended for testing only.
lava-obscuresAlso hides blocks adjacent to lava. Recommended: false.
use-permissionWhen set to true, players with the paper.antixray.bypass permission can see the real ores. Recommended: false. Use only with an up-to-date permissions plugin.

What Anti-Xray doesn't prevent

According to Paper, Anti-Xray deters most X-ray users, but it isn't foolproof, even in modes 2 and 3:

  • Extended view distance: Some hacked clients can see real ores in a larger area around them. The only way to counter this is with an additional anti-cheat plugin; Paper doesn't include one. See Anti-cheat for your server to learn how to install one.
  • World seed: If a client knows your world seed, it can calculate where ores are located. You can make this more difficult by using custom feature-seeds in paper-world-defaults.yml together with the structure seeds in spigot.yml. It can't be prevented completely, so don't share your world seed.
  • Ores next to caves and water: They remain visible in mode 1. In modes 2 and 3, they are hidden only if air is in hidden-blocks.

Common issues

I can still see ores. Check whether the ores are above max-block-height, whether they're next to air or water, and whether the block is missing from your list. If use-permission is set to true, players with OP permissions can see the real ores.

It doesn't work below Y 0 or in certain biomes. Your list probably doesn't include blocks such as deepslate or basalt. Add all of the recommended blocks above.

My changes aren't taking effect. Paper only reads these settings when it starts. Restart your server and don't use /reload. Also check the file's indentation.

Conclusion

You've enabled Paper's Anti-Xray feature and configured it for the Overworld, Nether, and End. If you have any further questions, our support team is available every day. 🙂

Free tools

Minecraft Tools

View all

Feedback

Was this article helpful?

Your feedback helps us prioritize and improve content.

0 of 0 people found this article helpful.

Personal support

Need more help than the guide provides?

Our ZAP-Hosting support team knows your product — briefly describe your issue and we'll help you personally.

Zappy knows this guide and answers you right in the chat.