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

"spreadplayers" command counts all entities as being on one team

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reopened
    • Resolution: Unresolved
    • Affects Version/s: Minecraft 1.10.2, Minecraft 16w41a, Minecraft 1.12.2, Minecraft 18w05a, Minecraft 1.13.1
    • Fix Version/s: None
    • Confirmation Status:
      Confirmed
    • Category:
      (Unassigned)

      Description

      The bug

      The /spreadplayers command treats entities on multiple teams as if they were all on the same team.

      In the latest versions the command feedback also says that the spread distance is Infinity:

      18w05a
      Spread 1 teams around 25.751766, -20.911484 with an average distance of Infinity blocks apart
      

      How to reproduce

      1. Create two teams
        /team add team_a
        /team add team_b
        
      2. Summon two armor stands which are in the teams
        /summon armor_stand ~ ~ ~ {CustomName:"\"A\"",Team:team_a}
        /summon armor_stand ~ ~ ~ {CustomName:"\"B\"",Team:team_b}
        
      3. Use /spreadplayers for them
        /spreadplayers ~ ~ 1 5 true @e[type=armor_stand,team=!]
        

        They were both teleported to the same position

      Code analysis

      Based on 1.11 decompiled using MCP 9.35 rc1

      Incorrect team count in start message (does not exist anymore)

      The start message commands.spreadplayers.spreading. ("Spreading ... blocks around ...") uses the entity count instead of the team count.

      Teams of mobs are not counted

      The methods net.minecraft.command.CommandSpreadPlayers.getNumberOfTeams(List<Entity>) and net.minecraft.command.CommandSpreadPlayers.setPlayerPositions(List<Entity>, World, Position[], boolean) treat all entities which are not a player as if they were in no team.

        Attachments

        1. Bug.rar
          122 kB
          Andrey Zhukov

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              andreasxp Andrey Zhukov
            • Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                CHK:

                Potential Duplicates