Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-238384

Entity id AtomicInteger is shared between client rendering and integrated server

XMLWordPrintable

    • Icon: Bug 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.

            Unassigned Unassigned
            MESLewis Morgan Lewis
            Votes:
            32 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated:
              CHK: