Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-13526

Command selector search radius offset by 0.5 in Y



    • Type: Bug
    • Status: Resolved
    • Resolution: Works As Intended
    • Affects Version/s: Minecraft 1.5.1, Minecraft 1.5.2, Snapshot 13w19a, Snapshot 13w21a, Snapshot 13w24b, Snapshot 13w25a, Snapshot 13w25b, Snapshot 13w25c, Minecraft 1.6, Minecraft 1.6.1, Minecraft 1.6.2, Minecraft 13w37a, Minecraft 13w37b, Minecraft 1.7, Minecraft 1.7.1, Minecraft 1.7.2, Minecraft 13w48b, Minecraft 1.7.4
    • Fix Version/s: None
    • Confirmation Status:


      When using a search selector such as "@p[ x,y,z,r]" (substitute x, y, z, and r for their values), the game does not search for players in the correct location. Although the game properly does floor(x ) and floor(z), for some reason, it does round(y ). The result is that the search area is a voxelized sphere, but it is offset from Minecraft's grid by 0.5 - this is very cumbersome to work around.

      The expected results would be achieved if the game did floor(y ), consistent with its handling of the x and z coordinates. Because it does not, unexpected behavior can occur: walking up variable-height layers of snow can put you out of the radius, as can standing on slabs. Furthermore, it's counter-intuitive to have the search area physically offset by 0.5 blocks from Minecraft's grid - it's made of blocks, but the blocks do not correspond to blocks in the game.

      Steps to reproduce:

      1. Look at your coordinates in F3 - the integer coordinates in parentheses for x and z are floor(x ) and floor(z).
      2. Use the command "/say @a[ floor(x ),floor(y ),floor(z),1]", substituting in the according numbers.
      3. Observe that it says your name.
      4. Jump up and place a whole block under yourself, standing on it. Use the command again.
      5. Observe that it still says your name: you are 0.5 away from the offset search center.
      6. Place a layer of snow, and repeat. Do this several times, and observe that once you are 1.5 blocks above your initial position, the command no longer works: you are 1.0 away from the offset search center.
      7. Dig downwards, and observe that the command will work until you are 1.5 below your initial position.

      Putting these facts together, observe that the search is centered at your feet from your initial position, rather than the center of the block. Also observe, as you play with your horizontal position, that it is centered around the middle of the block on the horizontal axes. Therefore, the search is centered around the middle of the block on x and z, but the bottom of the block on y: the detection area itself can be seen as a set of block-sized voxels which are offset by 0.5 on y from Minecraft's grid.


          Issue Links



              Unassigned Unassigned
              wolfiemario WolfieMario
              3 Vote for this issue
              3 Start watching this issue