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

Entities are not removed client-side when you are dead


    • Icon: Bug Bug
    • Resolution: Unresolved
    • Minecraft 14w06b
    • Minecraft 1.6.2, Minecraft 1.6.4, Minecraft 13w37a, Minecraft 1.7.1, Minecraft 1.7.2, Minecraft 13w47e, Minecraft 13w48a, Minecraft 13w48b, Minecraft 13w49a, Minecraft 1.7.3, Minecraft 1.7.4, Minecraft 14w11b, Minecraft 1.7.9, Minecraft 14w17a, Minecraft 14w18b, Minecraft 14w19a, Minecraft 14w20a, Minecraft 14w20b, Minecraft 14w21a, Minecraft 14w21b, Minecraft 14w25b, Minecraft 14w26b, Minecraft 1.7.10, Minecraft 14w30c, Minecraft 14w31a, Minecraft 14w32a, Minecraft 14w32b, Minecraft 14w33c, Minecraft 14w34a, Minecraft 14w34b, Minecraft 14w34d, Minecraft 1.8, Minecraft 1.8.1-pre3, Minecraft 1.8.1, Minecraft 1.8.2-pre1, Minecraft 1.10.2, Minecraft 16w32b, Minecraft 16w33a, Minecraft 16w36a, Minecraft 16w38a, Minecraft 16w39a, Minecraft 16w39b, Minecraft 16w39c, Minecraft 16w40a, Minecraft 16w41a, Minecraft 16w42a, Minecraft 16w43a, Minecraft 1.11 Pre-Release 1, Minecraft 1.11, Minecraft 16w50a, Minecraft 1.11.2, Minecraft 17w06a, Minecraft 17w13b, Minecraft 17w15a, Minecraft 17w16b, Minecraft 17w17b, Minecraft 17w18b, Minecraft 1.12 Pre-Release 2, Minecraft 1.12, Minecraft 1.13.1, Minecraft 1.13.2, Minecraft 18w48a, Minecraft 18w48b, Minecraft 18w49a, 20w08a, 1.16.2 Pre-release 1, 1.16.2 Pre-release 2, 1.16.2 Release Candidate 1, 1.16.2, 20w49a, 21w40a, 1.19.3, 23w04a, 1.19.4
    • Confirmed
    • Entities, Networking, Performance
    • Important
    • Platform

      The bug

      When you're dead, entities which are removed server-side remain loaded client-side. This can cause severe lag when you're working with spawners.

      Note: In recent versions this changed so entity creation is not processed either while dead. This results in massive lag when respawning.

      How to reproduce

      1. Set up an always active repeating command block with this command
        /summon item ~ ~1 ~ {Item:{id:stone_sword,Count:1b},Age:5999,Passengers:[{id:item,Item:{id:stone_sword,Count:1b},Age:5999,Passengers:[{id:item,Item:{id:stone_sword,Count:1b},Age:5999,Passengers:[{id:item,Item:{id:stone_sword,Count:1b},Age:5999,Passengers:[{id:item,Item:{id:stone_sword,Count:1b},Age:5999,Passengers:[{id:item,Item:{id:stone_sword,Count:1b},Age:5999,Passengers:[{id:item,Item:{id:stone_sword,Count:1b},Age:5999,Passengers:[{id:item,Item:{id:stone_sword,Count:1b},Age:5999,Passengers:[{id:item,Item:{id:stone_sword,Count:1b},Age:5999,Passengers:[{id:item,Item:{id:stone_sword,Count:1b},Age:5999}]}]}]}]}]}]}]}]}]}
      2. Set your spawnpoint next to the command block
      3. Go stand in front of the items and kill yourself
      4. Wait some minutes before pressing the "Respawn" button
        After the "Respawn" button is pressed the game lags (intensity depends on how long you waited)

      Another way to reproduce (LAN world)

      1. Start Minecraft in 2 windows with both different names (so use one in offline mode)
      2. Start a new LAN world
      3. Join the LAN world with the other Minecraft window
      4. Set the difficulty to peaceful
      5. Press F3 and kill yourself using /kill
      6. Now start spawning a zombie with a spawn egg with the player that is still alive
        → The zombies will disappear on the window with the player that is alive but they won't on the screen of the dead player. You can also see that value of "All" on the debug screen is different in the two windows.

      Code analysis

      Based on 1.12 decompiled using MCP 9.40 PRE 1

      The code to send entity destroy packets to the client is in the method net.minecraft.entity.player.EntityPlayerMP.onUpdate() which only runs if the player is alive.

      20w08a Mojang name: net.minecraft.server.level.ServerPlayer.tick()

            Unassigned Unassigned
            jespertheend Jesper the End
            27 Vote for this issue
            12 Start watching this issue