The bug
When the owner of a sitting pet is attacked within a 12 meters radius around the pet it stands up. For wolves this could be intended since they can help their owner, however often if not always the owner made them sit on purpose to not accidentally hit them or be pushed of blocks by them while fighting. But for pets which cannot attack, like ocelots or parrots, this behavior makes no sense.
How to reproduce
Tame a parrot and make it sit
Spawn a monster within a 12 meters radius from the parrot and let it damage you
→ The parrot starts flying
Code analysis
Based on 1.12 decompiled using MCP 9.40 PRE 1
The method net.minecraft.entity.ai.EntityAISit.shouldExecute()
cancels sitting if the owner is within 12 meters and net.minecraft.entity.EntityLivingBase.getAITarget()
does not return null
.
Linked issues
is duplicated by 26
relates to 2
Comments 38
In case this bug report is for when tamed sitting wolves/cats momentarily start following the player when the player receives a hit from a mob, then it still occurs in 1.5.2
@Marios: MC-10109
Anytime I enter/exit a Nether Portal, the dogs will get up on their own, and I'm unable to order them to sit unless I restart that world.
Still in 1.13 and it's a bit annoying when you want to make a farm of creeper using cat AI to move creepers out. Parrots also teleport to you whenever you're attacked while they are not fighting pets (like cats) which is really annoying too. Sitting dogs out of a certain range should not teleport neither to help you. This can be very annoying when you fight in caves for instance. Also, I think nerby sitting dogs who stand up to help you fighting nerby ennemis should sit down again after there is no hostile entity attacking you (because they are dead or they're too far to chase you (this could be applied for "hostile" players too)), instead of teleporting to you. Actually, there is absolutly no benefice for sitting pets to teleport to their owner when they're under attacked. If they are ordered to sit, we want them to sit and not following us until they are ordered to stand. It's simple like that.
Still happening in 19w12b. My parrots always get killed in stupid ways because of them flying towards the creepers I'm fighting.
Very annoying. It happens every time they are around the player and player receives hit from a mob. Voted. Maybe you should give a better title and description.