Minecraft wiki entry for Measuring_distance, associated text: If you're confused whether to add or subtract for your X and Z values, use the debug screen for a sanity check, and note again "Facing: north (toward negative Z)". The target's Z is somewhat less than your Z value of 540, hinting that you want to subtract 132 from 540 to get 407. If you turn a little to the right, you can verify the target is east of you, "toward positive X", so you're looking for a number greater than (i.e. less negative than) your X position of -743, so you want to subtract negative 127 from -723, which is -734 + 127 = -615.