Uploaded image for project: 'Minecraft (Bedrock codebase)'
  1. Minecraft (Bedrock codebase)
  2. MCPE-162237

The volume arguments floor the selector's position


    • Icon: Bug Bug
    • Resolution: Fixed
    • Preview, 1.19.70
    • Preview, Preview, Preview, 1.19.22 Hotfix, Preview, 1.19.41, 1.19.51
    • None
    • Confirmed
    • Windows
    • 908578

      The bug

      When using the volume arguments dx dy dz in a target selector, the position is floored before the entity is tested for. While this does line up the position with the block grid nicely in some cases, that behavior should be delegated to the x y z arguments, which already do something similar. As it stands right now there is no way to test if an entity is in a smaller cubic volume than 1x1x1 blocks since the position floors.

      Steps to reproduce:

      Create a situation where a cubic volume should select a player if it were to start at some decimal position. Here is an example:

      • Run the following two commands. The first will set your position to (1.25, -60.0, 0.5) and the second creates a volume that should select players between (0.75, -60.0, 0.0) and (1.75, -59.0, 1.0), inclusive:
        /teleport @p 1.25 -60.0 0.5
        /testfor @a[x=0.75,y=-60,z=0,dx=0]

      "No targets matched selector." To be found you must stand between (0.0, -60.0, 0.0) and (1.0, -59.0, 1.0), inclusive.

            Sprunkles Sprunkles
            1 Vote for this issue
            0 Start watching this issue