InteractEvent

I am trying to get the player and the item the player right clicked with but I have not gotten far. I have been only able to get the player who clicked. How would I go about getting the item the player right clicked with and then checking it against an item from a certain mod?

My code so far,
@Listener
public void onPlayerInteract(InteractEvent e, @First Player p) {
p.sendMessage(Text.of(p.getName()));
}

InteractEvent is very far up in the event interface hierarchy. You could be interacting with literally anything. For you to be able to get the block you’re interacting with, you’d listen for an InteractBlockEvent instead.

Just out of curiosity, you’re the second person this week to ask the exact same question. Is there some tutorial that told you specifically how to do this? Back in Bukkit, I’d see the same code over and over again, with everyone watching the same (wrong) (bad) tutorial.

No I have been going in this blind. I have been not referring to any tutorial. Also can you link me to the other post that was made about this?