Minecraft command block /setblock is innacurate

minecraft-commandsminecraft-java-edition

I notice when I use command blocks and /setblock, i will always have to subtract the x-value by 1 for it to go in the correct place when i check where the coordinates for the block i want to be set. is this something with the programming, is this a glitch?

Best Answer

In Minecraft, an exact integer coordinate (like 10, 64, -5) is actually on the corner between 8 different blocks. A center of a block is at 10.5, 64.5, -4.5.

When using a command such as /fill or /setblock, if a whole number is given, Minecraft automatically adds 0.5 to all of the numbers. This is because blocks must be aligned to the grid properly, so it must assume that when a user says "10" they have actually just truncated "10.5"

This isn't a programming mistake or glitch, it's because it literally can't place the block at an exact coordinate of "10".

On the F3 screen in newer versions, the "Looking at" coordinate will tell you what you actually have to type in to set the block you are looking at.