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

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • Minecraft 1.10.2, Minecraft 16w41a, Minecraft 1.12.2, Minecraft 18w05a, Minecraft 1.13.1, 1.16.1, 20w29a, 21w03a, 1.16.5, 21w05b, 21w08b
    • Confirmed
    • Commands

      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.

        1. Bug.rar
          122 kB
          Andrey Zhukov

            Unassigned Unassigned
            andreasxp Andrey Zhukov
            Votes:
            8 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              CHK: