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

sort=nearest / furthest do the opposite of what tehy are supposed to do.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • Minecraft 1.13.1
    • None
    • I tested this in a normal superflatt world, which I opened to lan to join with 2 other accounts.
      The world was generated in 1.13.1, and all the commands were written in 1.13.1.
    • Unconfirmed

      to reproduce: "coppy" my setup as discribed below:

      I encounterd this bug while I wtied to make a datapack which sorts all players by distance to a given entity. I did this by creating 2 functions:

      1. run.mcfunction

      • scoreboard players set count distancecount 0
      • execute as @a[sort=nearest] run function distancesort:sort

      2. sort.mcfunction

      • scoreboard players ass count distancecount 1
      • scoreboard players operation @s distonacecount = count distancecount

      to start I use this command:

      • execute as @e[name=freeze] at @s run function distancesort:run
      1. "freeze" is the only armorstand in the map. And the only entity with that name.

      explination:

      with the start command I sett the postition of where the commands shall be executed to the position of the "freeze" armorstand.
      Then the fakeplayers "count" distancesort is set to 0.
      The execute then calls the "sort" function for every player in the wrld, because of the selector "@a[sort=nearest]" the player closest to the armorstand should call the function first.
      When a player calls/runs the "sort" function, he increases "count" distancesort by 1. And then sets "count" distancesort to his own distancesort scoreboard.

      The problem:

      when using the selector "@a[sort=nearest]" the player furthest away from the armorstand runs the function first.
      And when using the selector "@a[sort=furthest]" the player nearest to the armorstand runs the function first.
      Basicly the selector doese the opposite of what is says.

      2018-9-11_14.25.51 was taken with "@a[sort=nearest]"
      2018-9-11_14.26.07 was taken with "@a[sort=furthest]"
      the player with the rainbow-skin is "IrgendwasMitPat"

        1. 2018-09-11_14.25.51.png
          329 kB
          Wleklik, Patrik
        2. 2018-09-11_14.26.07.png
          321 kB
          Wleklik, Patrik

            Unassigned Unassigned
            GameJunkiePat Wleklik, Patrik
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: