Quick Inventory Event Question

So I’m trying to get the ItemStack that the player actually clicked, I’m using the follow code:

    @Listener
    public void onClick(ClickInventoryEvent.Primary event) {
        ItemStack clicked = event.getCursorTransaction().getOriginal().createStack();
    }

I just wanted to know if this is the right way to do it, I’ve not tested it yet as I’m busy implementing the stuff that uses the event, and I was just wondering if anyone knew if this works.

Uhm… I tested this a couple days ago and got an abstract method error…

This worked for me

Try updating your SpongeForge version.