[SPIGOT-337] No Block in PlayerInteractEvent Created: 01/Jan/15  Updated: 03/Jan/20  Resolved: 04/Jan/15

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

Type: New Feature Priority: Minor
Reporter: Morphan1 Assignee: Unassigned
Resolution: Invalid Votes: 0
Labels: blocks, bug, event, interact


 Description   

If a player right clicks on a block and has a block in their hand, PlayerInteractEvent fires as it should... Except that there is no Block reference – event.hasBlock() returns false and getClickedBlock() is null.



 Comments   
Comment by Morphan1 [ 02/Jan/15 ]

Hmm... Well, looks like all I had to do was update. I wonder what weirdness must have caused the issue to begin with...
This issue is invalid and can be closed, sorry for wasting your time.

Comment by Morphan1 [ 01/Jan/15 ]

Er... Wow, I can't believe I didn't realize I forgot a part.
I can't seem to find the button to edit the issue...
So I'll just put it here for now:

*If a player right clicks on a block directly in front of them, with no blocks in between, and has a block in their hand, ...

Comment by Black Hole [ 01/Jan/15 ]

Please include your Spigot version (Output of /version command).

PlayerInteractEvent.hasBlock() is true for Action.RIGHT_CLICK_BLOCK, Action.LEFT_CLICK_BLOCK and Action.PHYSICAL. For Action.RIGHT_CLICK_AIR and Action.LEFT_CLICK_AIR the block is always null.

Generated at Sat Dec 13 11:50:10 UTC 2025 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.