RayTraceAntiXray v1.18.0

Paper plugin for server-side async multithreaded ray tracing to hide ores that are exposed to air.

RayTraceAntiXray​

Paper plugin for server-side async multithreaded ray tracing to hide ores that are exposed to air using Paper Anti-Xray engine-mode 1.

Paper Anti-Xray can't hide ores that are exposed to air in caves for example (see picture below). This plugin is an add-on for Paper Anti-Xray to hide those ores too, using ray tracing to calculate whether or not those ores are visible to players. This plugin can also fully hide block entities such as chests since Minecraft 1.20.6.

185815590-4b2efce6-5a26-4579-b079-e9958a454fd0.gif

How to install​

  • Download and install Paper 26.2. Folia is supported since Minecraft 1.20.1.
  • Enable Paper Anti-Xray using engine-mode: 1.
  • Download and install ProtocolLib.
  • Download and install RayTraceAntiXray. (For older Minecraft versions, browse the update history.)
  • Configure RayTraceAntiXray by editing the file plugins/RayTraceAntiXray/config.yml (see default config below).
  • See also: Recommended settings below.
  • Note that you should restart your server after each of these steps. Don't enable, disable or reload this plugin on a running server under any circumstances (e.g. using /reload, plugin managers, etc.). It won't work properly and will cause issues.
RayTraceAntiXray version(s)Minecraft version(s)
1.18.026.2
1.17.126.1.2
1.17.026.1 - 26.1.1
1.16.31.21.11
1.16.21.21.9 - 1.21.10
1.15.2 - 1.16.11.21.4 - 1.21.8
1.15.11.21.2 - 1.21.3
1.15.01.21 - 1.21.1
1.13.3 - 1.14.01.20.6
1.13.21.20.3 - 1.20.5
1.13.11.20.2
1.13.01.20.1
1.11.0 - 1.12.01.20
1.10.4 - 1.10.81.19.4
1.9.5 - 1.10.31.19.3
1.8.0 - 1.9.41.19 - 1.19.2
1.6.0 - 1.7.31.18.2
1.5.01.17.1
1.0 - 1.41.16.4 - 1.16.5
Generally, this table refers to the latest builds of Paper for the listed Minecraft versions. Especially for early builds, there's no guarantee that the plugin will work. The plugin may or may not work on forks or modified versions of Paper. (It most likely works, but I'm not actively testing it.) If you're unsure, please don't hesitate to ask. If a Minecraft version is missing from this table, such as 1.16.3, 1.17, or 1.18.1, it means that this version isn't supported at all.

Demo​

Demo

Default config​

YAML:
# This is an example configuration. Lines starting with # are comments and are ignored.
#
# settings:
#   anti-xray:
#     update-ticks: 1                           # Time period in Minecraft ticks for sending block updates to reveal blocks.
#     ms-per-ray-trace-tick: 50                 # Target time per ray trace tick in milliseconds.
#     ray-trace-threads: 2                      # Number of threads that are used for ray tracing.
# world-settings:
#   default:                                    # All worlds inherit settings from the default section.
#     anti-xray:
#       ### Ray tracing related settings ###
#       # RayTraceAntiXray hides blocks that are exposed to air, which are not hidden by Paper Anti-Xray.
#       # For this, a list of block positions is created when a chunk is sent to a player based on the block selection related settings below.
#       # Those blocks are hidden initally when the chunk is sent, which means they are replaced by stone, deepslate, netherrack or end stone depending on the world type.
#       # Then they are ray traced to reveal the blocks that the player can actually see.
#       ray-trace: true                         # Whether or not to enable ray tracing. Note that Paper Anti-Xray must also be enabled using engine-mode: 1.
#       ray-trace-third-person: true            # Whether or not to ray trace third person back and front view. Note that this is even more resource intensive.
#       ray-trace-distance: 64.0                # Blocks with a greater distance between the block center and the player eye are not calculated and will thus stay hidden or revealed depending on the previous state.
#       rehide-blocks: true                     # Whether or not to rehide revealed blocks that the player can no longer see. If false, revealed (already seen) blocks are only rehidden when the chunk is resent.
#       rehide-distance: 60.0                   # Blocks with a greater or equal distance between the block center and the player eye are treated as invisible to the player and are therefore (re)hidden (provided that rehide-blocks is enabled and the distance is still within the ray-trace-distance). If rehide-blocks is disabled, this setting has a similar effect as the ray-trace-distance and no effect if it is greater than the ray-trace-distance.
#       ### Block selection related settings ###
#       # The following settings are used to determine the list of block positions to be hidden and ray traced when a chunk is sent to a player.
#       # Note that this list is not updated dynamically with newly placed or broken blocks until the chunk is resent.
#       # Note that Paper Anti-Xray config settings, such as max-block-height, also apply.
#       max-ray-trace-block-count-per-chunk: 30 # Maximum number of initially hidden and ray traced block positions per chunk. Counting starts at the bottom of the world and increases upwards.
#       ray-trace-blocks:                       # Blocks that are hidden and ray traced. If this list is empty, the hidden-blocks specified in the Paper config file are used.
#       - diamond_ore
#       - deepslate_diamond_ore
#       - emerald_ore
#       - deepslate_emerald_ore
#   lobby:                                      # Example section for the world lobby. Missing settings are inherited from the default section.
#     anti-xray:
#       ray-trace: false                        # Disable ray tracing in the world lobby.

settings:
  anti-xray:
    update-ticks: 1
    ms-per-ray-trace-tick: 50
    ray-trace-threads: 2
world-settings:
  default:
    anti-xray:
      ray-trace: true
      ray-trace-third-person: false
      ray-trace-distance: 80.0
      rehide-blocks: false
      rehide-distance: .inf
      max-ray-trace-block-count-per-chunk: 100
      ray-trace-blocks: []

Recommended settings​

All settings are documented and explained in the default config file above. 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.

Optimized​

(Faster, but worse gameplay experience and less protection.)
YAML:
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.)
YAML:
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

Demo settings​

These settings are intended only as demo configurations for testing the plugin. I don't recommend using them in production due to their performance impact.
Paper world defaults (server) config:
YAML:
anticheat:
  anti-xray:
    enabled: true
    engine-mode: 1
    hidden-blocks:
    # RayTraceAntiXray also hides blocks that are exposed to air.
    - mossy_cobblestone
    - spawner
    - chest
    - coal_ore
    - deepslate_coal_ore
    - copper_ore
    - deepslate_copper_ore
    - raw_copper_block
    - diamond_ore
    - deepslate_diamond_ore
    - emerald_ore
    - deepslate_emerald_ore
    - gold_ore
    - deepslate_gold_ore
    - iron_ore
    - deepslate_iron_ore
    - raw_iron_block
    - lapis_ore
    - deepslate_lapis_ore
    - redstone_ore
    - deepslate_redstone_ore
    lava-obscures: false
    # As of 1.18 some ores are generated much higher.
    # Please adjust the max-block-height setting at your own discretion.
    # https://minecraft.wiki/w/Ore might be helpful.
    max-block-height: 320
    # The replacement-blocks list is not used in engine-mode: 1. Changing this will have no effect.
    replacement-blocks: []
    update-radius: 2
    use-permission: false
RayTraceAntiXray (plugin) config:
YAML:
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: 160.0
      rehide-blocks: true
      rehide-distance: 156.0
      max-ray-trace-block-count-per-chunk: 100000
      # Use an empty list [] here to ray trace all the blocks from the Paper world defaults (server) config.
      ray-trace-blocks: []
  # 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.

Latest reviews

hi i need help about config please help me or give me a discord link i cant find it
Really good plugin! Works as intended. One side note, please get rid of ProtocolLib, its a really bad library and causes more issues than it solves.
I Had a issue with the plugin, the dev responded so fast! now the plugin works as intended! Would recomend
Amazing. It's light and works just as expected.
May it be updated to 1.21.8 or higher? My server running 1.21.8 seems like it may not be working.
stonar96
stonar96
Hi, yes, of course I'll update to 1.21.9/1.21.10. I'll probably get to it this weekend. Sorry for the delay.

The latest version of RayTraceAntiXray should work fine on 1.21.8, though.
Hi, it's now 1.21.7. Can you update it to 1.21.7? This plugin is great. I've been using it since 2023.
stonar96
stonar96
Hi, thanks for the review. The latest version should work fine for 1.21.7. If you encounter any problems with that, please don't hesitate to DM me.
A great solution to what paper's anti-xray lacks.
Have purchased very good plugin! I hope to keep it updated in the future! Support the author
Excellent plugin please update 1.21.3!!!
stonar96
stonar96
Thanks, I'll do that asap.
works literally amazing no complaints! hope it gets updated to 1.21.3
Buy a license now
$6.99
EULA
Standard EULA
Use on any projects you own with attribution
Support
Standard
Includes:
Download the resource
Access new updates
Support from the creator
Support duration
Lifetime
Share and earn
Refer this resource and earn a 10% commission.
58,187 Views
400 Purchases
399 Downloads
Aug 22, 2022 Published
Jul 24, 2026 Updated
5.00 star(s)
Average rating (18)
63.1 KB File size
Open source
  1. Yes
DRM-free
  1. Yes
Unobfuscated
  1. Yes
AI use in marketing
No
AI use in product
No
Type
  1. Staff
  1. Anticheat
  1. Patch
Game mode
  1. Survival
  1. Factions
  1. UHC
Supported software
  1. Paper
  1. Folia
Supported versions
  1. 26.1
Supported languages
  1. English
Creator
Owner
Struggling to cover the costs of your server? Set up your own webstore with Tebex in under 30 seconds.
Host a lag-free Minecraft or Hytale server in minutes.
Get 25% off your first order with our link.
Recommended for you
#1 BuiltByBit Plugin ~ Protects your server from crash packet exploits ~ Folia Support
5.00 star(s) 141 ratings
4,261 purchases
Create items, blocks, mobs, emojis, and more with automatic resourcepack generation!
5.00 star(s) 54 ratings
3,287 purchases
Protect your server from crash/dupe/packet exploits with the ultimate security fix plugin.
5.00 star(s) 45 ratings
3,145 purchases
High Performance | Customizable | Cross-Version | GeyserMC | Folia Support
4.50 star(s) 72 ratings
2,829 purchases
All-in-one dungeon creator. Create unlimited, timed dungeon experiences with your own builds
4.50 star(s) 73 ratings
2,592 purchases
Share and earn
Refer this resource and earn a 10% commission.
58,187 Views
400 Purchases
399 Downloads
Aug 22, 2022 Published
Jul 24, 2026 Updated
5.00 star(s)
Average rating (18)
63.1 KB File size
Open source
  1. Yes
DRM-free
  1. Yes
Unobfuscated
  1. Yes
AI use in marketing
No
AI use in product
No
Type
  1. Staff
  1. Anticheat
  1. Patch
Game mode
  1. Survival
  1. Factions
  1. UHC
Supported software
  1. Paper
  1. Folia
Supported versions
  1. 26.1
Supported languages
  1. English
Creator
Owner
Struggling to cover the costs of your server? Set up your own webstore with Tebex in under 30 seconds.
Host a lag-free Minecraft or Hytale server in minutes.
Get 25% off your first order with our link.
Recommended for you
#1 BuiltByBit Plugin ~ Protects your server from crash packet exploits ~ Folia Support
5.00 star(s) 141 ratings
4,261 purchases
Create items, blocks, mobs, emojis, and more with automatic resourcepack generation!
5.00 star(s) 54 ratings
3,287 purchases
Protect your server from crash/dupe/packet exploits with the ultimate security fix plugin.
5.00 star(s) 45 ratings
3,145 purchases
High Performance | Customizable | Cross-Version | GeyserMC | Folia Support
4.50 star(s) 72 ratings
2,829 purchases
All-in-one dungeon creator. Create unlimited, timed dungeon experiences with your own builds
4.50 star(s) 73 ratings
2,592 purchases
Top