Paper anti-xray: setup, engine modes, and tradeoffs
Paper's built-in anti-xray hides ores server-side. Where it lives, what engine modes 1, 2 and 3 do, the client cost, and why /reload won't apply it.
Quick answer Paper has a built-in, obfuscation-based Anti-Xray with three modes, configured per world [1]. Set
anticheat.anti-xray.enabled: trueand pick anengine-modeinconfig/paper-world-defaults.yml(or a world’s ownpaper-world.yml) [2]. Mode 1 replaces the blocks you list with stone (deepslate below y 0), netherrack or end_stone depending on the dimension, and is much less computationally intensive than mode 2, especially on the client, but only hides ores entirely covered by solid blocks. Mode 2 randomizes the listed blocks and may better prevent X-ray [1]. It is obfuscation, not a guarantee: the docs list known bypasses [1]. Restart the server to apply changes;/reloaddoes not [1].
Everything below is from the PaperMC docs pages listed in the sources, read on 2026-09-24 (the anti-xray page shows “last updated May 12, 2026”). Config file locations and layout can differ between Paper versions, so check the live pages [1][2] against the version you run.
What it does and where it lives
Anti-Xray is an obfuscation-based feature in Paper: it replaces the blocks you list with “fake” blocks (details per mode below) [1]. It is not a guarantee. The docs say it stops the majority of users but “is not by any means infallible” [1], and list bypasses in the caveats section.
The config reference gives two locations for the same settings: config/paper-world-defaults.yml for all worlds, and world/dimensions/<namespace>/<key>/paper-world.yml for one world [2]. The docs’ own example for the Nether uses world/dimensions/minecraft/the_nether/paper-world.yml [1]. The settings sit under anticheat then anti-xray [2].
Per the reference, enabled defaults to false [2]. Nothing happens until you turn it on.
The three engine modes
From the docs [1][2]:
- engine-mode 1: replaces the blocks in
hidden-blockswith fake blocks, stone (deepslate at y < 0), netherrack, or end_stone depending on the dimension. - engine-mode 2: replaces both
hidden-blocksandreplacement-blockswith randomly generatedhidden-blocks. - engine-mode 3: works like mode 2, but instead of randomizing every block it randomizes the block for each layer of a chunk.
The docs’ comparison of mode 1 and mode 2: “Especially on the client side, engine-mode: 1 is much less computationally intensive, while engine-mode: 2 may better prevent Xray.” [1]
The mode 1 limit is the important one: only ores entirely covered by solid blocks are hidden. Ores exposed to air in caves, or to water from a lake, are not hidden [1]. In mode 2, fake ores obstruct the view of real blocks [1]. The docs say mode 3 can reduce network load when joining by a factor of about 2 and helps with chunk packet compression [1].
The options
All quoted behavior is from the reference page [2] unless noted.
enabled: on/off for the system.engine-mode: 1, 2 or 3, as above.hidden-blocks: the blocks to hide. In mode 2, tile entities such as chests or spawners are not allowed on this list, individual blocks may be listed multiple times to increase their chance of being placed, and air is ignored in mode 1.replacement-blocks: unused in mode 1 (changing it has no effect). In mode 2, both lists are randomly replaced byhidden-blocks, and tile entities may be added here. In mode 3, per the reference, this list is used to determine which blocks are used for each vertical chunk layer.max-block-height: the maximum height (y coordinate, from the bottom of the world) anti-xray operates to. Only integer multiples of 16 are accepted; other values are rounded down.update-radius: radius for block updates sent with real block data when a client interacts with a block. Only 0, 1 and 2 are accepted. The docs say 0 is designed for testing only and should not be used in production.lava-obscures: whether to obfuscate blocks touching lava. The docs note it does not work well with non-stone-like ore textures.use-permission: lets players withpaper.antixray.bypassbypass anti-xray. It is off by default because legacy permission plugins may struggle with the number of checks; the docs say to use it only with modern permission plugins.
The docs’ example config (engine-mode 1)
The docs give a “recommended configuration” per mode, telling you to replace the existing anticheat.anti-xray block in paper-world-defaults.yml [1]. This is their engine-mode 1 overworld example, shortened here to a few of the listed blocks. Copy the full list from the live page [1] rather than from this post:
anticheat:
anti-xray:
enabled: true
engine-mode: 1
hidden-blocks:
- chest
- coal_ore
- deepslate_coal_ore
- diamond_ore
- deepslate_diamond_ore
# ...remaining ores as listed on the docs page
lava-obscures: false
max-block-height: 64
replacement-blocks: []
update-radius: 2
use-permission: false
The docs comment on max-block-height: 64: “As of 1.18 some ores are generated much higher. Please adjust the max-block-height setting at your own discretion.” [1] Their Nether example uses max-block-height: 128 and hides ancient_debris, nether_gold_ore and nether_quartz_ore, and their End example simply sets enabled: false [1]. YAML is whitespace-sensitive, so the docs tell you to use the copy button (no stray tabs) and to back up the file first if it has other changes [1].
The tradeoff and its caveats
- Client cost. The docs’ one explicit performance warning: adding
airtohidden-blocksin mode 2 or 3 makes many holes, which “works well against cave finders but may cause client FPS drops for all players” [1]. The docs offer this as the mitigation for ores exposed to air, and this is the price [1]. Their FAQ also says hiding exposed ores otherwise requires additional plugins [1]. - Fake blocks may not show. In modes 2 and 3, tile entities can be hidden if not exposed to air, but Anti-Xray cannot place tile entities as fake blocks [1].
- It is not foolproof. The docs list bypasses: extending the range of visible real ores (mitigated by an anti-cheat plugin, not included out of the box; see installing plugins), reversing the world seed (partially mitigated with the
feature-seedsconfig and spigot.yml structure seed options, “not a complete solution”), and ores exposed to air [1]. - Outdated lists. An outdated config may be missing blocks: the docs mention deepslate or biome-specific blocks such as basalt in
replacement-blocks, and deepslate ore variants inhidden-blocks[1].
Applying changes
The docs are explicit: restart the server after changing anti-xray config, changes are not applied automatically, and do not use /reload [1]. They suggest verifying afterward by inspecting the config sections with timings or spark [1]; our spark walkthrough covers the tool.
What this doesn’t cover
- No recommended values beyond the docs’ own examples, and no benchmarks: the docs give no server-side CPU or bandwidth numbers, and I did not measure any.
- I did not test the settings on a running server for this post.
- The docs’ engine-mode 2 and 3 example lists, the Nether mode 2 and 3 examples, and per-version differences are on the live page [1].
Questions people ask
Do I need a plugin to stop X-ray on Paper?
Not for the basic obfuscation. Paper includes an obfuscation-based Anti-Xray with three modes, configurable per world [1]. The docs do say range-extension abuse is mitigated by an anti-cheat plugin, which is not included out of the box [1].
I enabled anti-xray and changed the file. Why do I still see ores?
The docs list several causes: the ores are above max-block-height, they are exposed to air in caves, use-permission is on and you have the bypass permission or op, or the block is missing from your block lists [1]. Also restart the server, because /reload does not apply anti-xray changes [1].
Does engine-mode 2 cost more than engine-mode 1?
The docs say engine-mode 1 is much less computationally intensive, especially on the client side, while engine-mode 2 may better prevent X-ray [1]. They give no server-side numbers, so measure your own server.