The Bug: Key: “The diamond” will mean the item that got duplicated from said container.
When you are in Spectator Mode, items shouldn’t transfer to your inventory from containers. If you press your offhand key (f by default) on a diamond in a container, and switch to creative mode, the diamond should appear in your offhand slot, but does not act as a ghost item, meaning you can use it after opening your inventory GUI, and clicking on the item in your offhand, effectively duplicating it. This is not true of Spectator, Survival, or Adventure modes, however, the item can be used after clicking on the diamond in Creative mode, and switching to those gamemodes.
Steps to Reproduce the Issue:
Make a new world in creative mode with cheats enabled, and get a chest and a diamond. Place the chest, and put your diamond in the chest. Now switch to Spectator Mode and interact with the chest. Hover your cursour over the diamond and press your swap to offhand button (f by default). Switch to Creative Mode, open your inventory GUI, and click on the diamond that should be in your offhand. Give yourself two sticks, and a crafting table, and go into Survival Mode. You should be able to craft a working spear.
Expected Result:
Entering Creative Mode, and clicking on the diamond should make the diamond disappear.
Actual Result:
The diamond did not disappear upon clicking on it, and it was even able to craft a spear.
Thank you for helping us improve Minecraft! We saved your files: