https://github.com/DarkRoleplay/Dark-Roleplay-Core/blob/1.11-Rework/src/main/java/net/dark_roleplay/drpcore/client/events/player/Event_Mouse.java
That's how I solved it, I used a tutorial for that but cannot find it. Hoping the code is understandable.
And the IExtendedItem ist just an Interface containing a method to get the Items range.