mojira.dev
MC-157196

Tamed animals cannot be added to a team

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

  1. Create two teams named wolfTeam and playerTeam:

    /team add wolfTeam
    /team add playerTeam
  2. Join the team playerTeam:

    /team join playerTeam @s
  3. Summon a wolf on the team wolfTeam:

    /summon wolf ~ ~ ~ {Team:wolfTeam}
  4. Tame the wolf:

    /data modify entity @e[type=wolf,limit=1,sort=nearest] Owner set from entity @s UUID
  5. Confirm the wolf is still on the team wolfTeam:

    /team list wolfTeam

    → ✔ The wolf's UUID is displayed

  6. Try to select the wolf using the "team" target selector argument:

    /execute if entity @e[type=wolf,team=wolfTeam]

    → ❌ No entities are found

  7. 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

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.

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:

  1. Create two teams named wolfTeam and playerTeam:

    /team add wolfTeam
    /team add playerTeam
  2. Join the team playerTeam:

    /team join playerTeam @s
  3. Summon a wolf on the team wolfTeam:

    /summon wolf ~ ~ ~ {Team:wolfTeam}
  4. Tame the wolf:

    /data modify entity @e[type=wolf,limit=1,sort=nearest] Owner set from entity @s UUID
  5. Confirm the wolf is still on the team wolfTeam:

    /team list wolfTeam

    → ✔ The wolf's UUID is displayed

  6. Try to select the wolf using the "team" target selector argument:

    /execute if entity @e[type=wolf,team=wolfTeam]

    → ❌ No entities are found

  7. Try again, this time using the team playerTeam:

    /execute if entity @e[type=wolf,team=playerTeam]

    → ❌ The wolf is found by the target selector

See also MC-190761, which is probably the cause for this.

Can confirm in 20w51a.

Can confirm in 21w03a.

Can confirm in 21w06a.

Can confirm in 1.20.4

Kai Cook

(Unassigned)

Confirmed

Commands

1.14.4, 1.15.2, 20w18a, 1.16.1, 20w28a, ..., 22w06a, 1.19, 1.20.4, 1.21.1, 24w37a

25w06a

Retrieved