#3575·Pumpkin

Pass the used hand down to item behaviours (normal_use, normal_use_with_rotation)

Author: matheustavarestrindadeCreated Sep 18, 2026Updated Sep 18, 2026
Labelsapiitemrefactor

What

ItemBehaviour::normal_use and normal_use_with_rotation do not receive the hand that was used. ItemRegistry and handle_use_item know it (Hand::from_packet_id, get_stack_in_hand(hand)), but it stops at the registry, so an item cannot tell whether it was used from the main or the off-hand.

Worked around for books in #3570 with a new normal_use_with_hand default that forwards to normal_use_with_rotation, so no other item changed behaviour.

What the full fix looks like

Add hand: Hand to normal_use and normal_use_with_rotation and update the implementors (27 implement normal_use, 2 implement normal_use_with_rotation), then drop the temporary default. Items that care about the hand can then use it directly.

Why

A packet that names a hand has to name the hand the player actually used. Sending the wrong one makes the client act on the wrong item, which is how the book bug in #3569 happened.