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

The order, in which execute runs the command for each entity, is in reverse

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Minecraft 17w45b
    • Minecraft 17w45a
    • None
    • Windows 10
      Java 1.8.0_25 64Bit
    • Confirmed

      As the Description tells already, execute runs each command, starting from the last entity in the list from an entity selector.

      Steps to Reproduce:

      1. (Empty world) Place down an armor stand and stand besides it
      2. run
        say @e[sort=nearest]

        and it will print out <your username>, armor stand which is the expected behavior, you are nearer to yourself than the armor stand

      3. run
        execute as @e[sort=nearest] run say hi

        and it will print out the armor stand before your username

      Despite the order in the entity selector is correct, as seen in the first example, the execute goes through this list, starting at the back, which is not the expected behavior in my eyes.

            dinnerbone [Mojang] Nathan Adams
            Possseidon Dominik Vogel
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: