Do you think you could make something easier? Because I need it kinda simple.
I can try, but if you think about it logically, it's just using the Distance formula. (Pythagorean theorem)

x1 = brick posx
x2 = player posx
x2 - x1
x22
y1 = brick posy
y2 = player posy
y2 - y1
y22
x2 + y2
Square Root x2
if you added z1 as brick posz, and z2 as player posz, subtracted 1 from 2, gave it a power of 2, then added that to x2 + y2, THEN get the square root of x2, you could have a 3D distance check.