How do you set the spawn at the center of a block?

When I set the world spawn i always spawn in the corner of a block, which makes your player stand over 4 different blocks, is there a way to make all players spawn in the center of one block?

Add 0.5D to the x and z of the coordinates and you’ll spawn at the center.

@gabizou Doesn’t seem to work, could you give an example? I might be typing it wrong.

I think he’s talking about using the /setworldspawn command.