Skip to content

Instantly share code, notes, and snippets.

@stonar96
Last active July 1, 2025 23:07
Show Gist options
  • Save stonar96/69ca0311392188b7ac2ece226286147f to your computer and use it in GitHub Desktop.
Save stonar96/69ca0311392188b7ac2ece226286147f to your computer and use it in GitHub Desktop.
Recommended RayTraceAntiXray settings by stonar96

Recommended RayTraceAntiXray settings by stonar96

General

Please read the README.md file on the RayTraceAntiXray github page first. All settings are documented and explained in the linked default config file there. Before configuring the plugin you should enable Paper Anti-Xray using engine-mode: 1. Optionally (especially for testing) you can increase the max-block-height. After configuring Paper Anti-Xray you can configure the plugin using the following settings for example.

Recommended settings

Optimized

(Faster, but worse gameplay experience and less protection.)

settings:
  anti-xray:
    update-ticks: 1
    ms-per-ray-trace-tick: 50
    # Adjust to available (ideally unused) CPU threads.
    ray-trace-threads: 2
world-settings:
  default:
    anti-xray:
      ray-trace: true
      ray-trace-third-person: false
      ray-trace-distance: 64.0
      rehide-blocks: false
      rehide-distance: .inf
      max-ray-trace-block-count-per-chunk: 30
      ray-trace-blocks:
      # You can add further blocks here,
      # but the max-ray-trace-block-count-per-chunk setting may need to be adjusted.
      - chest
      - diamond_ore
      - deepslate_diamond_ore
      - emerald_ore
      - deepslate_emerald_ore
      - gold_ore
      - deepslate_gold_ore
      - lapis_ore
      - deepslate_lapis_ore
      - spawner
  # Adjust world name.
  world_nether:
    anti-xray:
      # Note that ancient_debris never generates naturally exposed to air.
      # Normal engine-mode: 1 is sufficient, disable ray tracing in the nether.
      ray-trace: false
  # Adjust world name.
  world_the_end:
    anti-xray:
      ray-trace: false

More expensive

(Slower, but better gameplay experience and more protection.)

settings:
  anti-xray:
    update-ticks: 1
    ms-per-ray-trace-tick: 50
    # Adjust to available (ideally unused) CPU threads.
    ray-trace-threads: 2
world-settings:
  default:
    anti-xray:
      ray-trace: true
      # Be aware that this is about three times as resource intensive.
      ray-trace-third-person: true
      ray-trace-distance: 80.0
      rehide-blocks: true
      rehide-distance: 76.0
      max-ray-trace-block-count-per-chunk: 60
      ray-trace-blocks:
      # You can add further blocks here,
      # but the max-ray-trace-block-count-per-chunk setting may need to be adjusted.
      - chest
      - diamond_ore
      - deepslate_diamond_ore
      - emerald_ore
      - deepslate_emerald_ore
      - gold_ore
      - deepslate_gold_ore
      - lapis_ore
      - deepslate_lapis_ore
      - mossy_cobblestone
      - spawner
  # Adjust world name.
  world_nether:
    anti-xray:
      # Note that ancient_debris never generates naturally exposed to air.
      # Normal engine-mode: 1 is sufficient, disable ray tracing in the nether.
      ray-trace: false
  # Adjust world name.
  world_the_end:
    anti-xray:
      ray-trace: false

Timings

For "timings" you can use the commands /raytraceantixray timings on and /raytraceantixray timings off. If you turn it on, the time in ms per ray trace tick is printed to the console each tick. These times shouldn't be greater than 50ms to 100ms. Remember to turn it off as it gets very spammy.

@greaternot
Copy link

do i need to have paper-enginemode=1 for the plugin to work? or is it that the plugin actually works without needing to use paper's engine mode 1?

@stonar96
Copy link
Author

stonar96 commented Jul 1, 2025

@greaternot Yes you have to enable Paper's built-in Anti-Xray with engine-mode: 1. RayTraceAntiXray uses the built-in system and adds features to it. RayTraceAntiXray also uses some configuration settings from Paper's built-in Anti-Xray in addition to its own settings in the plugin configuration file.

If you don't enable Paper's built-in Anti-Xray with engine-mode: 1, RayTraceAntiXray will be completely disabled in this world and do nothing, regardless of whether you have set ray-trace: true or not in the plugin configuration.

However, you can run Paper's built-in Anti-Xray without RayTraceAntiXray by setting ray-trace: false in the plugin configuration.

@greaternot
Copy link

greaternot commented Jul 1, 2025

@greaternot Yes you have to enable Paper's built-in Anti-Xray with engine-mode: 1. RayTraceAntiXray uses the built-in system and adds features to it. RayTraceAntiXray also uses some configuration settings from Paper's built-in Anti-Xray in addition to its own settings in the plugin configuration file.

If you don't enable Paper's built-in Anti-Xray with engine-mode: 1, RayTraceAntiXray will be completely disabled in this world and do nothing, regardless of whether you have set ray-trace: true or not in the plugin configuration.

However, you can run Paper's built-in Anti-Xray without RayTraceAntiXray by setting ray-trace: false in the plugin configuration.

would like to say, raytraceantixray worked as intended, i did the config of paperworld.yml to use engine mode 1 but sometimes in some chunks. it seems coal and copper veins are visible. is it something that happens commonly or is it that there is something wrong with my configuration or server?

@stonar96
Copy link
Author

stonar96 commented Jul 1, 2025

@greaternot This can have many configuration related reasons. For example:

  • The ores are missing in the ray-trace-blocks list.
  • The ores are above the max-block-height setting.
  • There are more ores in the chunk than the configured max-ray-trace-block-count-per-chunk.
  • You have already seen the ores before and rehide-blocks is disabled.
  • ray-trace or Paper's built-in Anti-Xray isn't enabled using engine-mode: 1.
  • The use-permission option is enabled and you have the Anti-Xray bypass permission (paper.antixray.bypass) or you have operator status.
  • You have reloaded your server instead of restarting it.
  • You have manually placed the ores and you didn't reload the chunks or rejoin the server.

See also https://docs.papermc.io/paper/anti-xray/#faq-common-pitfalls-and-support.

Also note that I intentionally don't recommend hiding non-valuable ores like coal with RayTraceAntiXray for performance reasons. Of course, you can still do this if you think it's necessary and your server can handle it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment