[SPIGOT-1806] Add player.getMainHand() to determine if the player has set their left/right hand as their main hand Created: 06/Mar/16  Updated: 11/Mar/16  Resolved: 11/Mar/16

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Minor
Reporter: Eddie Brown Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: 1.9


 Description   

Add player.getMainHand() to determine if the player has set their left/right hand as their main hand. Needed so that custom items (eg. guns) know which side to fire the bullet from, etc...



 Comments   
Comment by Matthew Steglinski [ 10/Mar/16 ]

I've submitted a PR to resolve this issue here: https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/pull-requests/142/

Comment by Eddie Brown [ 06/Mar/16 ]

Please reopen. You are wrong. Please look at the serverbound settings packet on wiki vg. I know it works since im using it with protocollib to currently determine the main hand of the player.

Comment by md_5 [ 06/Mar/16 ]

I do not believe the server knows this.

Comment by Eddie Brown [ 06/Mar/16 ]

Would also be nice to have entity.setMainHand(left/right) and entity.getMainHand(). Since apparently mobs can be left handed in 1.9

Generated at Thu Mar 27 04:25:27 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.