mojira.dev
MC-310906

Swapping items with your offhand by using the keybind is entirely server-sided

Description:
There are two different ways to put an item in your offhand in Minecraft. You can either hover the item in your hotbar and press the corresponding keybind (F by default), or put the item into the offhand slot in your inventory. With high latency or on a lagging server, there is a very noticable delay from pressing the keybind until the items are actually swapped, whereas putting new items into the offhand inventory slot works perfectly fine without any delay.

I have attached a video offhand_keybind.mp4 showing the difference between using the keybind and the inventory slot.

Reproduction:
As in the attached video, set the random tick speed to some very large value to cause server lag (I used 100000 in my video, which should suffice). After that you should be able to observe a signifcant delay when using the keybind (I press the keybind to swap items with my offhand at the same time as I am punching).

Expected Behavior:
Using the keybind should behave identically to simply swapping the items from your inventory. With high server lag or latency, this becomes a very noticable QoL-issue and it seems silly to have to use your inventory to switch items with your offhand, when there is a designated keybind for it.

Further notes:
For this to be fixed properly, the server needs to know exactly what item was swapped into the offhand when receiving the corresponding Player Action packet. This is currently impossible, because both swapping items with your offhand and dropping items does not cause an updated Set Held Item packet to be sent. This is because they do not call MultiPlayerGameMode::ensureHasSentCarriedItem, compared to all other actions which require knowledge of the currently held item. The current consequences of this are already well documented in MC-240720, MC-154881 and a bunch of duplicates, so I refrained from making a separate report on this.

edit: I apologize for the sound in my attached video, I didn’t have my headphones plugged in and apparently some youtube short was running in the background °_°

Attachments

Comments 2

Thank you for helping us improve Minecraft! We saved your files:

[media]

Thank you for your report!
After consideration, the issue is being closed as Won't Fix.

Please note that this is not the same as Working as Intended, as this bug report correctly describes behavior in the game that might not be the intended or desirable behavior, but it will not be fixed right now. Sometimes, this is because the issue reported is minor and/or impossible to change without large architectural changes to the code base.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

Z0rty

(Unassigned)

Confirmed

26.2, 26.3 Snapshot 7, 26.3 Snapshot 9

Retrieved