[SPIGOT-1607] getItemInHand() in BlockPlaceEvent always return the item in the main hand Created: 01/Mar/16 Updated: 06/Mar/16 Resolved: 01/Mar/16 |
|
Status: | Closed |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Bug | Priority: | Minor |
Reporter: | tur tur | Assignee: | Thinkofname |
Resolution: | Fixed | Votes: | 0 |
Labels: | 1.9, blocks, bug, event, spigot | ||
Environment: |
Minecraft 1.9 |
Description |
When placing a block, the getItemInHand() method in BlockPlaceEvent event (not in the Player object) always return the item in the main hand, even if the block placed from the off-hand Code: @EventHandler public void onBlockPlace(BlockPlaceEvent e) { System.out.println("onBlockPlace() called"); System.out.println("onBlockPlace() item: " + e.getItemInHand().getType()); } Result (Sand in off-hand, apple in main hand): Result 2 (Sand in off-hand, nothing in main hand): |
Comments |
Comment by tur tur [ 06/Mar/16 ] |
I checked again now, seems to work in spigot too |
Comment by tur tur [ 03/Mar/16 ] |
@Thinkofname seems like the fix work in craftbukkit but not in spigot (latest version) |
Comment by tur tur [ 03/Mar/16 ] |
@Pr0totype2 but there is 2 hands, and i think the getItem() method should work |
Comment by - Pr0totype2 [ 02/Mar/16 ] |
Use #getInventory().getItemIn..... |
Comment by Z750 [ 01/Mar/16 ] |
This is a bug |