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:
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).
Add
-agentlib:jdwp=transport=dt_shmem,address=minecraft,server=y,suspend=n
to the client JVM arguments.Launch the client.
Open a command line, and run
jdb -attach minecraft
.In JDB, type
threads
and verify that(java.lang.Thread)0x1 Render thread running
appears (that "Render thread" has ID 1).Connect to the server, and wait a few seconds.
In JDB, type
stop at ra:11
(wherera
isClientboundSetEntityDataPacket
as of 1.16.4-pre1, and line 11 ishandle
). 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 runresume
several times.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.
The game will freeze with the breakpoint hit in
thread=Netty Client IO #2
(or similar).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.After a second, type
resume
to resume all threads. JDB will immediately say that the breakpoint was hit inthread=Render thread
; typeresume
a second time to resume it.There will now be an invisible dropped item. Walking into it will still add it to the inventory.
Linked issues
is duplicated by 14
relates to 2
Attachments
Comments 23
This is happening to me on a server. Do I need to create a crash report from my client, or from my server?
I triggered the bug when throwing a stack of string on the ground from my inventory. When I logged back in to the server after crashing the game, the string was visible on the ground in front of me.
Crash report attached. Please let me know if there's any other information you need.
This is easily reproduced in 1.11.2. If you open your inventory and drop an item, or stack of items by picking it up and dragging it off the inventory window it will behave as expected. However, if you CTRL-Q the items out of your inventory to the ground, normally stacked items will "disappear." To reproduce, CTRL-Q 5-6 items or stacks of items from your inventory (not hot bar slots) to the ground. Then exit inventory. Now walk over items to pick up again. Open inventory and quickly CTRL-Q them again. about 90% of the time one or more of the items will disappear from view. The items are still there just not being rendered. I suspect that the client does not have time to render the icon for the item before the next one is being ejected from inventory and so it is blank.
Some more information: Interestingly doing this with rockets, sword, bed, potion, food stack from my existing inventory failed every time (did it about 30 times to test). However, I had a stack of sugar and two saddles in a chest. When I picked those items from the chest, closed inventory, and then did the test as described above, it reproduced the bug easily. I was at y-level 40 and facing East, night time, light level 8 on solid blocks when I did these tests.
Hi all, looks like the issue has been inactive for a few months, but I recently discovered this bug while running a paper server. The issue persists in spigot and vanilla, though the chance for an item being invisible seems to be much higher on paper and spigot than in vanilla–oftentimes, the first block dropped or broken upon loading into the world is rendered as normal, but subsequent drops become invisible while running on paper.
Â
However, of note is reproducibility when connecting through either my local IP or through my public IP.
Steps to reproduce:
Preconditions:
The server and client are running on the same machine.
Using Java 15, with startup arguments: `java -Xms3G -Xmx8G -jar server.jar nogui`
Client is running optifine, have not tried vanilla yet but I assume behavior will be similar.
Port-forwarding and IP configuration is already set up properly in my router configuration–for reference, my pc is configured to be a set IP of 192.168.1.55 with my router forwarding port 25565 to this IP.
Start the server from a fresh world, with nothing changed (no server-ip set) – connect to localhost using client, and items will drop as normal when broken or dropped by the player. The server, as of now, should neither be accessible through 192.168.1.55 nor my public ip.
Now, stop the server, and input the appropriate server-ip into server.properties. Restart the server.
Connect to the server using the local IP, and block drops should behave normally.
Connect to the server using the public IP, and block drops and player item drops suddenly disappear as described in this issue.
Â
I have confirmed that this is not an issue with my network, as I have done the exact same steps without precondition #1–meaning, the server is run by a different machine on the same network. The issue does not appear when connecting with that other machine's local IP or through the public IP (again, assuming proper network configuration with port-forwarding).
Â
I don't know if this set of conditions is particular to me or if it's a wild goose-chase or not, but I hope this information may be helpful in solving this issue.
Â
Edit: see later comment, this issue is only reproducible when I am connected to my wifi extender, and not my home's main router.
@unknown Any modifications to the game (like optifine) are not accepted on the tracker. Please try to reproduce this without OptiFine
Just tested using vanilla 1.16.4, issue persists.
Â
Important information:
The issue disappears when I am directly connected to my home's main router. The issue only appears when I am connected to my wifi extender, which is how I produced the issue in the first place (my first post). Not sure how this plays into the situation–could mean lost packets going in/out? But I don't notice this issue when the server and client are hosted on separate machines, so again, not sure why this network configuration produces the issue.
Â
Edit: how do I tag someone??
I'm working on a datapack, and the weird thing about this is that it doesn't happen if the datapack is disabled, but happens if the datapack is enabled. I'm sure it's not the datapack code that is causing this, the hitbox of the item is disappearing (if it was caused by a regular invisibility effect the hitbox would still be visible)
Based on a discussion in #mcdevs on around September 11 2024, this was probably fixed in 1.19.4/23w03a due to the packet bundle feature (mentioned on https://www.minecraft.net/en-us/article/minecraft-snapshot-23w03a), which should eliminate the chance of an item spawning and then the entity metadata getting processed on the next tick. I haven't had any time to do any testing, though, so I'm marking this issue as Awaiting Response for now.
(The issue in #mcdevs was with someone who was implementing a custom server from scratch, and having items always disappear when dropped from breaking a block. They determined that their issue started happening in 1.19.4, and the issue went away when they implemented packet bundles. So presumably the code that removes items that have no entity metadata still exists, but hopefully packet bundles prevent it from being an issue with the official server software.)
Thank you for your report!
However, this issue has been temporarily closed as Awaiting Response.
We do not have enough information to find the cause of this issue.
Please force a crash by pressing F3 + C for 10 seconds while in-game and attach the crash report (
[minecraft/crash-reports/crash-<DATE>-client.txt|http://hopper.minecraft.net/help/finding-minecraft-data-folder]
) here.Once attached, the report will be reopened automatically.
Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Customer Support – 📖 Game Wiki