![Blog post background](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2F6hkezmdd%2Fproduction%2Fcf9c024a502193b3f1dbd7940eb5e169fd59ab23-1920x1080.png%3Ffit%3Dmax%26auto%3Dformat&w=3840&q=75)
Minecraft
How To Set Up Anti X-Ray for PaperSpigot Servers
![Blog post leading image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2F6hkezmdd%2Fproduction%2F8a99c875bd81e6dd60d2a9d6916ac536ee2d3724-1920x1080.png%3Ffit%3Dmax%26auto%3Dformat&w=3840&q=75)
Minecraft servers are constantly changing, and it's crucial to ensure a safe and fair gaming environment. One major issue that server admins often deal with is X-Ray cheaters, which let players see through blocks and ruin the game's integrity. In this blog post, we'll delve into the specifics of setting up Anti X-Ray measures designed specifically for PaperSpigot servers.
What is Paper's Anti-Xray?
If you're using Paper servers, you'll be glad to know that Paper Anti-Xray is included. This feature does exactly what it says - it prevents players from using x-ray. When someone tries to x-ray, it will make all blocks appear as ores, making it nearly impossible to x-ray.
How can I set up the Paper Anti-Xray?
Go to the File Manager.
Find the file called "paper.yml" (for the newer versions the config file is in the config folder and is called paper-world-defaults.yml) and click on it.
Once you're in the file, scroll down to line 286 and search for "anti-xray". When you find it, modify your settings to the following values:
anti-xray:
enabled: true
engine-mode: 2
max-block-height: 64
What is Engine-Mode and what's the difference?
Here's a very simple screenshot explaining all stages:
![Blog image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2F6hkezmdd%2Fproduction%2F1c9bf709a1638344e0735334eeb1a451d5ee5d04-1920x1080.png%3Ffit%3Dmax%26auto%3Dformat&w=3840&q=75)
Source: https://docs.papermc.io/paper/anti-xray
![Blog image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2F6hkezmdd%2Fproduction%2F1f94a004a5cb58874759c86638f3b346e63b8442-1920x1080.png%3Ffit%3Dmax%26auto%3Dformat&w=3840&q=75)
Source: https://docs.papermc.io/paper/anti-xray
When it comes to the performance side, engine-mode: 1 is not as computationally demanding. It selectively hides ores that are fully covered by solid blocks, leaving those exposed to air or water visible. In contrast, engine-mode: 2 employs fake ores to obstruct the view of real blocks. By introducing air to hidden-blocks, engine-mode: 2 can successfully conceal all ores, including those exposed to air. Furthermore, engine-mode: 3 reduces network load by around 50% and assists with compressing chunk packets.
Once you've made the required adjustments to your settings, click on "save" located at the bottom right-hand corner. Then, restart your server and you're all set. If you've completed all the steps accurately, Paper Anti-Xray should now be working!