Entity duplication with portals
The bug
When an entity dies while travelling through a portal, it will drop its items and travel to the dimension.

This can further be exploited as a method of mass duplicating items.

Suggested fix
Provided by Marcono1234
The following changes should be made to fix the issue
- Override setDead in EntityLivingBase to set the boolean dead to true as well
- Methods overriding onDeath need to test for dead as well or add an onDeathSpecial method which is called in EntityLivingBase.onDeath and then overridden
- (Optional but suggested): Write dead as DeathHandled to NBT to make sure that onDeath runs only once even after reloading or teleporting to another dimension
This would require EntitySlime.onUpdate() to call setDead() as well and not directly set the field value.
Note - The boolean dead found in EntityLivingBase that returns true when the entity begins its death animation and has 0 health; not the boolean isDead in the Entity class.
[Mojang] Searge (Michael Stoyke)
2017-02-28, 03:26 AM
2020-11-24, 02:09 PM
2020-01-13, 05:37 PM
4
5
duplication, end_portal, entity, item, nether_portal
Minecraft 1.11.2 - 1.15.1
Minecraft 1.11.2, Minecraft 17w06a, Minecraft 17w13a, Minecraft 17w13b, Minecraft 17w14a, Minecraft 17w15a, Minecraft 17w16a, Minecraft 17w16b, Minecraft 17w17b, Minecraft 17w18a, Minecraft 1.12 Pre-Release 5, Minecraft 1.12 Pre-Release 6, Minecraft 1.12, Minecraft 1.12.1 Pre-Release 1, Minecraft 1.12.1, Minecraft 1.12.2, Minecraft 17w45b, Minecraft 17w46a, Minecraft 17w47a, Minecraft 17w47b, Minecraft 17w50a, Minecraft 18w05a, Minecraft 18w11a, Minecraft 1.13-pre8, Minecraft 1.13, Minecraft 18w30b, Minecraft 1.13.1-pre1, Minecraft 1.13.1-pre2, Minecraft 1.13.1, Minecraft 1.13.2, Minecraft 18w48a, Minecraft 18w48b, Minecraft 18w49a, Minecraft 18w50a, Minecraft 19w02a, Minecraft 19w08b, Minecraft 19w09a, Minecraft 19w11a, Minecraft 19w11b, 1.15.1