Requirements
In server.
When players swap item with offhand from containers.
Clear item in command block or datapack.
How to reproduce
Open a minecraft 1.12.5 server and join in.
Put a container. (either chest or barrel or hopper or others)
Put a repeating_command_block and input 'clear @p stone'. (for example)
Use ‘/item replace block x y z container.0 with stone’ to put a stone in the container.
Use keybind <key.swapOffhand> to swap the stone to player’s offhand.
You can see the stone still in your 'weapon.offhand' slot.
If you are in creative mode, the stone will disappear when you open your inventory.
If you are in survival mode or adventure mode, the stone will disappear when you pick it up.
In all mode, the stone will disappear when you disconnect the server and rejoin, or you use keybind <key.swapOffhand> to swap the stone to hotbar.
Tips: In server process, I can found that the stone has been cleared already. But it still appeared in player’s offhand.
Expected Result
The normal phenomenon should be that when I swap the item which should be clear by command block or datapack, it should be cleared and disappeared.
Anyway, I guess it’s a display bug in offhand slot.
Hi there!
I'm currently reviewing older, unconfirmed reports to help keep the bug tracker up to date. I’ll temporarily resolve this as Awaiting Response for now.
Please let me know if this issue is still happening for you in Minecraft 1.21.6. If you reply, the ticket will automatically reopen and I’ll be happy to take another look.