# How to Stop X-Ray on a Minecraft Server

> Turn on Paper's built-in anti-xray to hide ores from x-ray texture packs and mods.

Source: https://www.beaconhosting.org/knowledgebase/how-to-prevent-x-ray-on-a-minecraft-server
Category: Minecraft
Last updated: 2026-11-05

X-ray mods and texture packs let players see ores through stone. **Paper** has anti-xray built in: it hides ores from the client until they're exposed.

## Turn it on (Paper)

1. In **Console**, click **Stop**.
2. In **Files**, open `config/paper-world-defaults.yml`.
3. Find `anticheat:` → `anti-xray:` and set:

```yaml
anticheat:
  anti-xray:
    enabled: true
    engine-mode: 2
```

4. Save and start the server.

## Engine modes

| Mode | What it does |
|---|---|
| `1` | Hides ores by replacing them with stone. Light on the server |
| `2` | Fills hidden areas with fake ores, so x-ray shows ores everywhere. Stronger, uses more CPU and bandwidth |
| `3` | Like mode 2, with less CPU use; newer Paper versions only |

The `hidden-blocks` list sets which blocks are hidden. The default covers the usual ores.

## The Nether

Set it per world in `world_nether/paper-world.yml` and add Nether ores such as `ancient_debris` to `hidden-blocks`.

## Not on Paper?

Vanilla has no anti-xray. On Fabric and Forge, look for an anti-xray mod in **Package Manager**, or switch to Paper if you run plugins.

