-
Bug
-
Resolution: Unresolved
-
None
-
1.17.1
-
None
-
Community Consensus
-
Entities
-
Normal
-
Platform
net.minecraft.entity uses an AtomicInteger to set an entity's id in the constructor. However, this AtomicInteger is also incremented by the client rendering thread when a new entity is created. Due to multi-threading of rendering and integrated server this causes inconsistent behavior when compared with a dedicated server and connected client.
This issue can by solved by either not incrementing the CURRENT_ID AtomicInteger when an entity is created by the rendering thread, or by giving the client and server separate counters, as is the case with a dedicated server and client.
https://youtu.be/hr-twzxs6FM highlights why the entity id matters and the inconsistency between integrated and dedicated servers.