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

Non-LivingBase entities can be on a team (and show color) but can't be targeted using team=

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: Minecraft 1.10.2, Minecraft 16w40a, Minecraft 1.11 Pre-Release 1, Minecraft 1.11.2, Minecraft 1.12, Minecraft 1.12.1 Pre-Release 1, Minecraft 1.12.2, Minecraft 17w46a, Minecraft 18w02a, Minecraft 18w19b, Minecraft 1.13, Minecraft 18w30b, Minecraft 18w31a, Minecraft 18w32a, Minecraft 18w33a, Minecraft 1.13.1-pre1, Minecraft 1.13.1, Minecraft 1.13.2, Minecraft 18w43b, Minecraft 18w45a, Minecraft 18w46a, Minecraft 18w48a, Minecraft 18w48b, Minecraft 18w49a, Minecraft 19w04b, Minecraft 19w07a, Minecraft 19w12b, Minecraft 19w13b, Minecraft 19w14a, Minecraft 19w14b, Minecraft 1.14.3
    • Fix Version/s: None
    • Confirmation Status:
      Confirmed
    • Category:
      (Unassigned)

      Description

      The bug

      If you add a dropped item (or any Non-LivingBase entities) to a team, it follows the color team rule fine. The problem is, you can't target it with team=

      Note

      [Mojang] Searge (Michael Stoyke) added a comment - 10/Aug/14 12:17 AM
      Only living entities can be on a team, items are not living entities, only mobs, animals, villagers and players are.

      This is not correct, as it has the color, it is on the team, so it can be added fine. The only problem is that it can't be targeted via team=

      How to reproduce

      1. /team add Test
      2. /team modify Test color red
      3. drop an item and run
        /data merge entity @e[type=item,sort=nearest,limit=1] {CustomName:"{\"text\":\"Test\"}",CustomNameVisible:1b}
      4. /team join Test @e[type=item,sort=nearest,limit=1]
      5. see the red name, indicating it's on the team
      6. /say @e[type=item,team=Test]
        The command will fail

      Code analysis

      Based on 1.11.2 decompiled using MCP 9.35 rc1

      The method net.minecraft.command.EntitySelector.getTeamPredicates(...).new Predicate() {...}.apply(Entity) returns false if the entity is not an instance of EntityLivingBase even though the method net.minecraft.entity.Entity.getTeam() is correctly implemented for all entities.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                Asteraoth [Mod] Asteraoth
              • Votes:
                11 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated:
                  CHK: