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

Item entities turn invisible when dropped on the ground



    • Bug
    • Resolution: Unresolved
    • None
    • Minecraft 1.11.2, Minecraft 1.13, Minecraft 1.13.2, Minecraft 1.14.3, 1.15.2, 20w06a, 20w07a, 20w12a, 1.16 Pre-release 3, 1.16 Release Candidate 1, 1.16, 1.16.1, 1.16.2, 1.16.3, 1.16.4 Pre-release 1
    • Confirmed
    • Entities, Networking
    • Normal


      Item entities turn invisible when dropped on the ground. The problem is intermittent, and I haven't found a way to reliably reproduce it. It doesn't seem to matter where the item entity comes from.

      I've had items turn invisible both when tossing them out of my inventory and when being dropped from broken blocks.

      It doesn't seem to matter what the item is. I've had it happen with seeds, lily pads and shulker boxes. The shulker boxes are especially worrying, because one invisible shulker box can result in the loss of a lot of valuable materials.

      Code analysis. This bug is a continuation of MC-11834, and also a race condition, so it's hard to consistently reproduce. One way to force it to happen is to set a breakpoint in the entity metadata packet handler, and then resume the main thread. This can be a bit awkward to set up, though:

      1. Set up and start a server (superflat is the easiest). Disable mob spawning, and kill all entities (due to MC-51732 this will need to be repeated a few times to eliminate slimes).
      2. Add -agentlib:jdwp=transport=dt_shmem,address=minecraft,server=y,suspend=n to the client JVM arguments.
      3. Launch the client.
      4. Open a command line, and run jdb -attach minecraft.
      5. In JDB, type threads and verify that (java.lang.Thread)0x1 Render thread running appears (that "Render thread" has ID 1).
      6. Connect to the server, and wait a few seconds.
      7. In JDB, type stop at ra:11 (where ra is ClientboundSetEntityDataPacket as of 1.16.4-pre1, and line 11 is handle). Note that this means that any entity metadata change will trigger the breakpoint, which includes sneaking and sprinting. If this is accidentally triggered, you will need to run resume several times.
      8. Spawn an item. This can be done by breaking a block or tossing an item in your inventory. Make sure that the item will land far enough away that it won't be picked up immediately.
      9. The game will freeze with the breakpoint hit in thread=Netty Client IO #2 (or similar).
      10. Type resume 1 in JDB to resume the render thread (which should advance one frame and then freeze again, or may unfreeze the game completely). This specifically needs to be done to ensure the item gets ticked before entity metadata is received, and is what actually reproduces the race condition.
      11. After a second, type resume to resume all threads. JDB will immediately say that the breakpoint was hit in thread=Render thread; type resume a second time to resume it.
      12. There will now be an invisible dropped item. Walking into it will still add it to the inventory.


        Issue Links



              Unassigned Unassigned
              haydenmuhl Hayden Muhl
              27 Vote for this issue
              15 Start watching this issue