mojira.dev
MC-22147

Entity duplication bug

The bug

Definitely the way how entities are being saved is not stable and need to be checked. Yesterday I complained that my horse with armor and saddle disappeared with no reason after I have re-logged my SSP world. Today I enter my brewing room I found my only one librarian villager was duplicated. Both librarians and with the same offerings as of my last trade.

It's impossible for a villager to have entered that room (underground, by iron door); the closest village is 800 m away. I got my librarian by curing a zombie villager and trapping him in that room.

Sorry, this bug is irreproducible. It happened randomly.

Code analysis

See this comment by @unknown

Linked issues

Attachments

Comments 30

Is this still a concern in the current Minecraft version? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

I'm now playing 1.6.2 and that bug never happened again. In fact, this kind of bug has taken place 3 times since I purchased the game two years ago, it happened when I re-logged after a crash. But this very one, I got no crash and it happened just after I had updated the game to 1.6.1, so I thought it was worth reporting.

Arjan de Vries

I experienced this bug a few days ago on the 14w32d snapshot. My farmer got cloned, same trades unlocked.

I've just had this happen in 1.8.2-pre1. I have a set of villager tended farms, completely sealed, and I now have two identical farmers (same trades, all unlocked) in one of them.

This just happened to me in 1.8.6, same as Pongo Sapiens reports. I have a sealed villager-tended farm, and the farmer/shepherd has been duplicated (same trades).

20 more comments
Timothy Miller

Does anyone have some suggestions for reasonably efficient ways to reproduce this bug?

Gnembon and MethodZz are helping out, but the tests they're doing are unexpected to me, and they haven't given me much detail. They're still running into some problems, and I'm starting to suspect that their tests are affected more by tick delivery to lazy chunks than to data loss on unloading. I really need to be able to test and debug this myself on my own server.

What would be great is a world download and some procedures that have a tendency to cause breakages.

Any thoughts on this?

Timothy Miller

Some interesting new observations. I'm not confident enough to say anything definitive at this time, but here's what I think right now from my testing and code analysis:

  • The symptoms of MC-22147 are actually caused by the same block entity bug I described in MC-79154.

  • Rich Crosby's fix addresses a real bug, but that bug is not what causes MC-22147. However, a good fix for MC-119971 should fix Crosby's bug also.

Update: A while ago, I had put a debug message in AnvilChunkLoader that would get printed out if a chunk was being saved but got thrown away because of pendingAnvilChunksCoordinates. I just saw it print out for the first time after having done all kinda of extensive testing. Although rare, data loss CAN happen. The fix I'm working on for MC-119971 does indeed address this.

Timothy Miller

I need to make a correction. MC-22147 is about entities like mobs and stuff. MC-79154 is about BLOCK entities, which is a whole other thing. None of the suggestions made pertaining to MC-79154 have anything to do with entities. For instance, we can still get mobs to dupe at chunk boundaries.

Does this still happen in the 1.13 prereleases, currently 1.13-pre3?

Timothy Miller

This is likely caused by MC-119971 and/or MC-108469. The former is marked as fixed for an up-coming release, but Xcom did provide a fix for MC-108469. For the bugs fixed by the EigenCraft group, Grum has tended to assign them to Mr. Herlitz who then assigns them to one of the junior devs; you might want to do that.

Ezer'Arch

(Unassigned)

Confirmed

duplicated, duplication, entities, villager

Minecraft 1.6.1, Minecraft 14w25b, Minecraft 14w32d, Minecraft 1.8.6, Minecraft 15w43b, Minecraft 1.10.2, Minecraft 1.11, Minecraft 1.12.1

Retrieved