[SPIGOT-1604] PlayerInteractEvent called twice when main hand empty and off-hand not Created: 01/Mar/16  Updated: 01/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: Unassigned
Resolution: Duplicate Votes: 0
Labels: 1.9, bug, spigot
Environment:

Minecraft 1.9
Spigot version git-Spigot-1a196e1-7 6c0425 (MC: 1.9) (Implementing API version 1.9-R0.1-SNAPSHOT)
Windows 7 64Bit
Java 1.8.0_51



 Description   

When right click a block with a block in the off-hand (place the block) and the main hand is empty, the PlayerInteractEvent called twice (one time with an item and another time without, probably call for each hand)

Code:

@EventHandler
public void onPlayerIneractEvent(PlayerInteractEvent e) {
	System.out.println("onPlayerIneractEvent() called");
	System.out.println("onPlayerIneractEvent() item: " + (e.hasItem() ? e.getItem().getType() : "null"));
	}

Result (Sand in the off-hand, nothing in the main hand):
[22:55:50 INFO]: onPlayerIneractEvent() called
[22:55:50 INFO]: onPlayerIneractEvent() item: null
[22:55:50 INFO]: onPlayerIneractEvent() called
[22:55:50 INFO]: onPlayerIneractEvent() item: SAND



 Comments   
Comment by md_5 [ 01/Mar/16 ]

Duplicate, intended.

Generated at Sat Dec 13 15:19:04 UTC 2025 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.