Detect if user changed his item in inventory

Is that possible to get this from Sponge function , or I need to store item in hand in HashMap and check if ther are the same?

“Changed” isnt enough of a descriptive word for me to understand what you after here?

Do you mean when the item is swapped out for another item? When the hotbar index slot is changed to another? Both?

Also do want to detect if anything about the item in the slot has changed such as a sword loosing durability?

Yes, I mean this one.

Take a look at these events.

ChangeInventoryEvent.Pickup
InteractItemEvent

After filtering these events to check for if the slot affected is the players hands slots then you can run your code