mojira.dev
MC-84873

DeathTime values 20+ cause corrupted mobs

The bug

Basically, if you summon a mob with a DeathTime tag under 20, everything works fine. The mob will disappear as soon as it hits 20 (it increments every tick). Example command for this:

/summon zombie ~ ~1 ~ {Health:0,DeathTime:19}

But, if you summon a mob with a DeathTime tag of 20 or more, the mob goes through the entire death animation, but that's not all. The world thinks the mob is still there even if the client doesn't think so. So you can't place blocks where the mobs were and they seem to be unloaded or something. Relogging causes them to reappear and go through the death animation again, but still exist. I don't know how to actually get rid of these "corrupt" mobs. Example command to trigger this (beware that there's not any confirmed method to get these mobs out of your world, so make a new one just in case):

/summon zombie ~ ~1 ~ {Health:0,DeathTime:20}

Code analysis

Code analysis by @unknown can be found in this comment.

Linked issues

Comments 20

Confirmed in 15w45a, and I found a way to get rid of them: water and gravity still affect them, so you can maneuver them into the Void (where they at least won't bother you if they are not deleted).

Please link to this comment in the description

The following is based on a decompiled version of Minecraft 1.10 using MCP 9.30.

This happens because the method net.minecraft.entity.EntityLivingBase.onDeathUpdate() tests if the DeathTime is exactly 20 after adding 1 instead of testing if it is equal to or larger than 20.

Is this still an issue in the latest snapshot 16w44a? If so please update the affected versions.

This is an automated comment on any open or reopened issue with out-of-date affected versions.

Confirmed for 1.13-pre2.

Please be so nice and update your commands to reproduce (only write zombie instead of Zombie). That makes it easier to test.

10 more comments

Can confirm in 21w07a.

Can confirm in 1.16.5 and 21w08b.

To anyone else who may be having trouble with this now, you can delete these broken mobs by setting their {DeathTime} back to a value under 20 by targeting their UUID. Just look at them and if you type "/data merge entity a10d2397-619e-4194-9a51-a78dd41fef2c {DeathTime:19s}" it should autofill their UUID for you.

Affects 1.17.1. Also thanks @Ben Wilcox for the tip, I summoned a corrupted mob with NoAI so I thought I'd have to edit the world files to get rid of it.

Can confirm in 1.19.

DonkeyCore

v-armanv

Confirmed

Low

Commands, Mob behaviour

animation, corruption, dataTag, death, deathtime

Minecraft 1.8.8, Minecraft 15w44b, Minecraft 15w45a, Minecraft 16w35a, Minecraft 16w39c, ..., 22w11a, 22w12a, 1.19, 1.19.2, 22w42a

22w43a

Retrieved