Mojira Archive
MC-272706

Invulnerable parrots remain unharmed when players feed them cookies in survival or adventure mode, regardless of whether the damage type is player_attack and falls under #bypasses_invulnerability

Relates to MC-117593, MC-117703, MC-117643 and possibly MC-117589, MC-117667 and MC-211526. Feeding a parrot a cookie, or any item in the #minecraft:parrot_poisonous_food item tag, inflicts significant damage and poisons the parrot. This damage stems from the minecraft:player_attack damage type. (To verify, adding this damage type to the #minecraft:bypasses_resistance tag shows that even parrots with resistance 5 cannot survive the cookie. Furthermore, the death message "was slain by" confirms the damage type as minecraft:player_attack.) While invulnerable parrots can still take damage from cookies in creative mode, adding the minecraft:player_attack damage type to the #minecraft:bypasses_invulnerability tag does not allow killing parrots with cookies in survival or adventure mode.

Steps to reproduce

  1. Install the attached datapack
  2. Execute the following command in creative mode to verify that minecraft:player_attack is included in the tag:
    /damage @s 1 minecraft:player_attack
  3. /summon minecraft:parrot ~ ~ ~ {Invulnerable:1b}
  4. Get some cookies
  5. Be in survival or adventure mode
  6. Feed the parrot with the cookie
  7. Notice that it doesn't take damage from it (it still gets the poison effect)
  8. Be in creative mode
  9. Feed the parrot with the cookie

Observed result: While #minecraft:bypasses_invulnerability typically permits damage to be inflicted on invulnerable entities, even when the damage source isn't a player in creative mode, feeding a parrot a cookie in survival or creative mode doesn't cause damage to it with the datapack.
Expected result: As the minecraft:player_attack damage type is included in #minecraft:bypasses_invulnerability, feeding invulnerable parrots cookies in survival or adventure mode should result in damage to the parrot, akin to creative mode.

Guess why it occurs

I suspect that because of the resolution of MC-117593 and MC-117703, there's redundant code checking whether the player is in creative mode. While it might have been essential at the time, it seems unnecessary now and contributes to the reported problem.

Unresolved

No User

The grandpa of minecraft

2024-05-30, 09:38 PM

2024-07-12, 07:11 AM

0

1

Confirmed

Low

Platform

Commands

1.20.6, 1.21 Pre-Release 1, 1.21

-