# How to Stop X-Ray on Your Minecraft Server (/docs/minecraft/stop-xray)



X-ray texture packs and mods let players see ores through stone, giving them an unfair advantage. Paper has a built-in anti-xray engine that effectively blocks this.

Method 1: Paper Anti-Xray (Recommended) [#method-1-paper-anti-xray-recommended]

<div className="fd-steps">
  <div className="fd-step">
    Open the Paper config [#1-open-the-paper-config]

    Access the [XGamingServer panel](https://panel.xgamingserver.com), go to `Files`, and open `config/paper-world-defaults.yml`.
  </div>

  <div className="fd-step">
    Enable anti-xray [#2-enable-anti-xray]

    Find the `anticheat` section and set:

    ```yaml
    anticheat:
      anti-xray:
        enabled: true
        engine-mode: 2
        hidden-blocks:
          - diamond_ore
          - deepslate_diamond_ore
          - gold_ore
          - deepslate_gold_ore
          - iron_ore
          - deepslate_iron_ore
          - emerald_ore
          - deepslate_emerald_ore
          - lapis_ore
          - deepslate_lapis_ore
          - redstone_ore
          - deepslate_redstone_ore
          - copper_ore
          - deepslate_copper_ore
          - ancient_debris
        replacement-blocks:
          - stone
          - deepslate
          - netherrack
    ```
  </div>

  <div className="fd-step">
    Restart your server [#3-restart-your-server]

    **Engine Modes:**

    * **Mode 1:** Hides ores by replacing them with stone on the client. Lightweight but some x-ray mods bypass it.
    * **Mode 2:** Replaces all blocks with random ore data. More effective, slightly more bandwidth usage. **Recommended.**

    > 💡 **Tip:** Mode 2 makes all hidden blocks appear as random ores to x-ray users, making it impossible to distinguish real from fake.
  </div>
</div>

Method 2: Anti-Xray Plugins (Non-Paper) [#method-2-anti-xray-plugins-non-paper]

For Spigot or other server types, install an anti-xray plugin like Orebfuscator from SpigotMC.

> 📝 **Note:** Paper's built-in anti-xray has minimal performance impact. Mode 2 uses slightly more bandwidth but is far more effective.

See also: [Performance Guide](/docs/minecraft/optimize-server)

If you need help, join our [Discord](https://discord.xgamingserver.com/).
