mojira.dev
MC-274309

Holding leather horse armor in offhand and clicking moves it to your main hand

 Reproduction Steps:

  • Hold leather horse armor in your offhand

  • Hold another item (like coal) in your main hand

  • Right-click, and notice how the items were swapped

 

Issue:
Equipable#swapWithEquipmentSlot calls LivingEntity#getEquipmentSlotForItem to get the slot for the item. The issue is that getEquipmentSlotForItem returns MAINHAND if the item is not usable by that entity (which in this case, leather horse armor returns false for canUseSlot)

So this causes swapWithEquipmentSlot to incorrectly swap the items, as it thinks that item can be used.
 

Linked issues

Attachments

Comments 3

Can confirm. Please note that this only affects leather horse armor, contrary to what your summary would suggest. Also affects all other types of horse armor, as well as wolf armor.

As mentioned by Jarl already, this is a duplicate of MC-273300 so I'm going to be resolving this report (MC-274309) as a duplicate.

Owen1212055

(Unassigned)

Community Consensus

Platform

Normal

Input, Inventory

1.21

Retrieved