Minecraft (Java Edition)
Stop x-raying

Stop X-raying

X-raying is a cheat that allows a player to see through blocks, which they can use to find hidden loot rooms, chests, and valuable ores.

How can you stop x-raying?

Paper, or Minecraft server software that’s built off of Paper (e.g. Purpur) has a feature to combat x-raying which you can use. The feature can be configured in the paper-world-defaults.yml, which is located in the config folder of your servers root directory, and in this guide we'll walk you trough how you can configure and set it up for your server.

An example of what the anti-xray configuration inside paper-world-defaults.yml looks like

anti-xray:
  enabled: false
  engine-mode: 1
  hidden-blocks:
  - copper_ore
  - deepslate_copper_ore
  - gold_ore
  - deepslate_gold_ore
  - iron_ore
  - deepslate_iron_ore
  - coal_ore
  - deepslate_coal_ore
  - lapis_ore
  - deepslate_lapis_ore
  - mossy_cobblestone
  - obsidian
  - chest
  - diamond_ore
  - deepslate_diamond_ore
  - redstone_ore
  - deepslate_redstone_ore
  - clay
  - emerald_ore
  - deepslate_emerald_ore
  - ender_chest
lava-obscures: false
max-block-height: 64
replacement-blocks:
- stone
- oak_planks
- deepslate
update-radius: 2
use-permission: false

The configuration options, and how they work

  1. The enabled: option is used to turn anti-xray on or off, setting it to false will disable the feature, while setting it on true will enable anti-xray for your paper server or derivative of paper (e.g. Purpur).

  2. Engine mode

    2.1 engine-mode: 1 Hides the blocks specificed in the hidden-blocks: list, and replaces them with the blocks in the replacement-blocks: field.

    2.2 engine-mode: 2 Replaces blocks specified in the hidden-blocks: list, with the same blocks that are in the hidden-blocks: list.

  3. lava-obscures:, Enable this option if you want to obfuscate blocks that are touching lava. Obfuscating refers to replacing the block with something else other than what's really there.

  4. max-block-height: Sets the max height of which the anti-xray feature will work, it starts from the bottom of the world, and you can increase the value in integers of 16, so that means 16, 32, 48, 64, and so on, values that are not in that format will be rounded down, so 50 would become 48.

  5. update-radius: Determines when to send the real blocks behind the surface, so if you have update-radius: 1 for example, blocks that are touching air will be real blocks, and if you have update-radius: 2 blocks that are touching air, and one block behind that will be real blocks. There are only two valid configuration options, update-radius 1, and update-radius: 2. update-radius: 2 Is useful for when you don't want players to see blocks that are not there, they might have a slow connection, fast pickaxe, or both, which might make them able to dig faster than updates from the server is sent to their client, resulting in them seeing fake blocks, diamond ore for example.

  6. You can change ùse-permission: to true if you want to enable the paper.antixray.bypass permission, which makes players with the permission able to bypass the anti-xray feature.