← Data packs

100x speed 3d ray trace althorithm

by JKuantamechanic · 2026-02-17 · Data packs

100x speed 3d ray trace althorithm preview

Are you still running execute positioned ^ ^ ^0.001 a thousand times for ray tracing?🤨 Checking the same block over and over and over and over and over and over and over and over before getting to the next block?? Cease that this instant! This macro-based algorithm performs block checks once per block by calculating the exact dx,dy, and dz steps required to reach the next block; thus, minimising block checks and enabling a 100x increase in ray-trace efficiency, no cap. The source code lies in the src folder, mcbuild's datapack compiler turns it into a bunch of mcfunctions. Only works for versions from 1.20.2 up, when macros were introduced.

3dDatapackOptimisedRayRaycastRaytraceServer UtilityTraceUtilUtilitiesUtilityVoxel