Here's a guide on how to make an inventory listener. I don't think the bot offers it in the API, but you will see how simple it can be. The architecture of the following classes can be made better but this is how I've done it on my first try.
(There wont be much explanation)
Main Class:
-Implements Observer -> Interface we made
-Exchanges context since we extend MethodProvider
-Sets the observer as the Main class
InventoryListener Class
Note: I think the code would break if you try running it while logged off. An easy fix would be to set the run state once we are logged in.
-Implements runnable, this is a seperate thread that runs to check the status of our inventory
-Really simple strategy, we check our current items with a cached set of items. If there are any differences, we know that we either gained/lost an item. Whenever those cases occur, we notify our observer.
-The thread runs ever 50 ms = checks for new items 20 times per second.
Observer - Interface