im trying to run a code when the player took an item from the inventory using InventoryTransactionEvent but the code runs only after the item is in the player's inventory. any idea?
That's how the event is supposed to work. You can cancel the event though, and that will keep the player from keeping the item, if that is your goal. If this doesn't solve your problem, please provide some more information about your goal and a snippet of your code.
The event runs twice. 1. it runs when the item is in the chest inventory and gets moved. 2. it runs when the item got to the player's inventory I'm trying to get to check if the first line was called.