mojira.dev
MC-123607

Parrots can still be sitting on shoulders, when they are burning, poisoning and withering

The bug

Parrots can still be sitting on shoulders, when they are burning, poisoning and withering.

Caused the following issues:
  1. When the parrot is on the shoulder, will not have fire animation and potion particles. (This relates to MC-115111)

  2. No matter how long the parrot stays on the shoulders, when they get off the shoulders still continue to burn, poison and wither (in general, no status effects can be applied or tick down, or have any effect on a shoulder parrot).

Code analysis

The following is based on a decompiled version of Minecraft 1.12.2 using MCP 9.40.
The reason for this is, because the flag boolean in the method net.minecraft.entity.ai.EntityAILandOnOwnersShoulder.shouldExecute() does not check if the entity (parrot) is burning, is poisoned or withered.

Suggested fix

boolean flag = entitylivingbase != null && !((EntityPlayer)entitylivingbase).isSpectator() && !((EntityPlayer)entitylivingbase).capabilities.isFlying && !entitylivingbase.isInWater() &&
//Everything beneath is added to fix this issue
!entity.isBurning() && !entity.isPotionActive(MobEffects.POISON) && !entity.isPotionActive(MobEffects.WITHER);

Linked issues

Attachments

Comments 4

In 20w12a

In 1.16 Pre 3

Can confirm in 21w03a.

Can confirm in 21w05a.

[Mod]Les3awe

(Unassigned)

Confirmed

Mob behaviour, Player

burn, parrot, poison, shoulder, wither

Minecraft 1.12.2, Minecraft 17w50a, Minecraft 18w01a, Minecraft 18w02a, Minecraft 18w03a, ..., 25w09b, 1.21.5 Release Candidate 1, 1.21.5, 25w17a, 1.21.6 Pre-Release 3

Retrieved