How to get the item and player used in InteractBlockEvent?

Title says it all, realy.

For the item, you can use Player#getItemInHand()

The player is located in the cause, easiest way is to add a @First annotation to a field on the event listener, like public void onInteract(InteractBlockEvent event, @First Player player)

1 Like