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

Position selector arguments (x, y, z, dx, dy, dz) require all three axes to be specified only when called by the server

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Works As Intended
    • None
    • 1.18.1
    • None
    • Unconfirmed
    • (Unassigned)

      Description

      When a command using the position selector arguments is called by a player, the arguments only need to include one axis for it to work. When called by the server, it needs all three.

      Steps to Reproduce

      Stand at 0, 0, 0 and execute the following as a player:

      /say @a[x=-10, dx=20]

      Note that your name appears in the output, since you are standing between x=-10 and x=+10.

      Now, put that command in a .mcfunction and run the following as a player:

      /function demo:example

       

      Note that it still works, as expected.

      Edit the datapack so that your mcfunction is called by #minecraft:tick, such that the executor is now the server instead of the player. Note that no player name appears, even though you are standing within the area specified.

      In order for the command to select you now, you must specify all three axes in your command:

      say @a[x=-10, dx=20, y=-10, dy=20, z=-10, dz=20]

      This is in contrast to when the command originates from the player where it only requires 1 axis.

       

            Unassigned Unassigned
            SploxFox SploxFox
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: