[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... |
| Comment by Morphan1 [ 01/Jan/15 ] |
|
Er... Wow, I can't believe I didn't realize I forgot a part. *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. |