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

Sorting on age behaves weirdly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • None
    • Minecraft 1.13, Minecraft 18w31a, Minecraft 1.13.1
    • None
    • Confirmed

      The bug

      sort=nearest is supposed to take the closest entities first, and if two entities are at exactly the same distance, it takes the oldest entity. Vice versa, sort=furthest is supposed to take the furthest entities first, and if two entities are at exactly the same distance, it takes the youngest entity.

      However, it seems to use the arbitrary method to sort two entities that are the same distance away.

      How to reproduce

      1. Summon two entities after each other at exactly the same location
        /summon armor_stand ~ ~ ~ {CustomName:"\"One\""}
        /summon armor_stand ~ ~ ~ {CustomName:"\"Two\""}
        
      2. Run the following command
         /execute as @e[type=armor_stand,sort=nearest] run say hi

        "One" prints its name before "Two" as expected

      3. Run the following command
        /execute as @e[type=armor_stand,sort=furthest] run say hi
        

        "One" prints its name before "Two" while we expected it to be the other way around because "Two" is younger than "One"

      Note

      Maybe this is related to MC-126946

            Unassigned Unassigned
            Misoloo [Helper] Misode
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: