When attempting to set the team of a tamed animal it appears to succeed but in actuality the animal is not set to the team. Attempting to execute any command based on the team it does not include the animal in its selection.
To reproduce
by @unknown
Create two teams named wolfTeam and playerTeam:
/team add wolfTeam /team add playerTeam
Join the team playerTeam:
/team join playerTeam @s
Summon a wolf on the team wolfTeam:
/summon wolf ~ ~ ~ {Team:wolfTeam}
Tame the wolf:
/data modify entity @e[type=wolf,limit=1,sort=nearest] Owner set from entity @s UUID
Confirm the wolf is still on the team wolfTeam:
/team list wolfTeam
→ ✔ The wolf's UUID is displayed
Try to select the wolf using the "team" target selector argument:
/execute if entity @e[type=wolf,team=wolfTeam]
→ ❌ No entities are found
Try again, this time using the team playerTeam:
/execute if entity @e[type=wolf,team=playerTeam]
→ ❌ The wolf is found by the target selector
Linked issues
Comments 8
Confirmed in 1.16.1 and 20w27a. It seems tamed animals can only be found by target selectors that test for the team of their owner, regardless of the team the animal is on. For example:
Create two teams named wolfTeam and playerTeam:
/team add wolfTeam /team add playerTeam
Join the team playerTeam:
/team join playerTeam @s
Summon a wolf on the team wolfTeam:
/summon wolf ~ ~ ~ {Team:wolfTeam}
Tame the wolf:
/data modify entity @e[type=wolf,limit=1,sort=nearest] Owner set from entity @s UUID
Confirm the wolf is still on the team wolfTeam:
/team list wolfTeam
→ ✔ The wolf's UUID is displayed
Try to select the wolf using the "team" target selector argument:
/execute if entity @e[type=wolf,team=wolfTeam]
→ ❌ No entities are found
Try again, this time using the team playerTeam:
/execute if entity @e[type=wolf,team=playerTeam]
→ ❌ The wolf is found by the target selector
Related to MC-108495.
See also MC-190761, which is probably the cause for this.
Can confirm. The dog I tamed was added to the team, and is still listed when using
/team list
, but cannot be targeted using@e[team=testTeam]
. There may be other cases in which this issue occurs as well. May need more testing.