Minecraft wiki entry for Dual_wield, associated text: When a tool with a right-click function is held in the off-hand with another tool or weapon selected in the hotbar, right-clicking on a block that is relevant to the off-hand tool uses that off-hand tool unless the selected tool in the hotbar can also be used on the same block, in which case the hotbar tool has priority.