When open any container gui (chest, hopper, crafting table and etc.) item command wont change item in offhand until close gui.
How to reproduce
Start server or connect to friend or create redstone timer
Execute command after open gui - chest or crafting table /item replace entity @a weapon.offhand with stick
Close gui
I found when I am trying to create server side only mod that able open chest by command. And I want to disable player ability to get item from chest or place in chest, like spectator. I found where server handle client click, but after a while I cant do any with swap key action. Then i test it for vanilla non modified container and found a bug. For demonstration I download lastest snapshot from official launcher and show its with command block
Thank you for your report!
We're tracking this issue in MC-278267, so this ticket is being resolved and linked as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki