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
@unknown 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
/team add Test
/team modify Test color red
drop an item and run
/data merge entity @e[type=item,sort=nearest,limit=1] {CustomName:"{\"text\":\"Test\"}",CustomNameVisible:1b}
/team join Test @e[type=item,sort=nearest,limit=1]
see the red name, indicating it's on the team
/say @e[type=item,team=Test]
→ ❌ The command will not say "Test"
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.
Linked issues
is duplicated by 7
Attachments
Comments 10
Confirmed for 1.16.1 and 20w30a
Can confirm in 20w49a.
Can confirm in 21w03a.
Can confirm in 21w05b.
Can confirm in 21w06a.
still exists in 1.20.

can confirm in 24w07a.
I feel like this should have a higher priority since it is inconsistent with other team related behaviour, confuses new datapack developers, limits datapack capabilities unnessesarily and seems not to hard to fix (people have already proposed solutions).

Can confirm in 1.21 Pre-release 2.
Confirmed for 18w30b