if I remember right the arrow picked is first checking the offhand then iterating through the player inventory contents to pick the first arrow.
For a crossbow you can use get the crossbow, get the item meta, cast it to CrossbowMeta and then call CrossbowMeta#getChargedProjectiles to get the loaded projectiles.