pub fn use_item_on(
player: &Player,
world: &Arc<World>,
hand: InteractionHand,
hit_result: &BlockHitResult,
) -> InteractionResultExpand description
Handles using an item on a block.
This implements the logic from Java’s ServerPlayerGameMode.useItemOn().
§Flow
- Spectator mode: Only allow opening menus (currently returns Pass)
- Check if block interaction should be suppressed (sneaking + holding items)
- If not suppressed: Call block’s
use_item_onmethod - If block returns
TryEmptyHandInteractionand main hand: Call block’suse_without_item - If item not empty: Call item behavior’s
use_onfor placement - Handle creative mode infinite materials