mojira.dev
MC-696

Pets disobeying sit commands by helping player when attacked and within a certain radius

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

  1. Tame a parrot and make it sit

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

MC-2470 Tamed wolf, directed to sit, follows despite sitting Resolved MC-3197 Wolves/Dogs teleporting when sitting Resolved MC-3644 Wolves walking sit Resolved MC-4166 Problems with tamed dogs Resolved MC-10109 Cats stand up if player is hit by mob nearby Resolved

Comments 38

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.

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

Oh! Thanks.

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.

28 more comments

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 in 19w07a

Still happening in 19w12b. My parrots always get killed in stupid ways because of them flying towards the creepers I'm fighting.

This appears to be fixed in 1.14.2-pre3! Can anyone still reproduce this?

Just tested with a parrot and a wolf in 1.14.2-pre3. Both were ordered to sit, then I spawned a zombie in front of them, which attacked me. Neither of the animals stood up. Further testing in multiplayer is needed.

jake mcnaughton

(Unassigned)

Confirmed

(Unassigned)

attacking, owner, pets, sitting

Minecraft 1.4.2, Minecraft 1.4.5, Minecraft 1.6.2, Minecraft 1.7.4, Minecraft 14w05b, ..., Minecraft 18w50a, Minecraft 19w07a, Minecraft 19w12b, Minecraft 1.14 Pre-Release 1, Minecraft 1.14 Pre-Release 5

Minecraft 1.14.1

Retrieved