Posted February 17, 201510 yr Hi all. I need to know when the player gains an item of my mod. Be it by picking it up from the ground, getting it out of a chest or anything else. I need this to register an achievement. I can use ItemPickupEvent to get notified when the player picks up an item from the ground but that doesn't work for picking up from a chest or other inventory. So ideally I would like to have an event that is fired when the player gains an item in his/her inventory. Is there something like that? Thanks!
February 17, 201510 yr How does that help me? Nothing will fire that event? Subscribe on a tick handler, scan the inventory, if it changes send an event that the players inventory changed. I require Java, both the coffee and the code
February 17, 201510 yr Well, it kind of is... But at the end of the day there is no existing event that notifies you on a slot or inventory changes. Currently looking at the inventory code, I cannot see an easier way to do this. Unless you hack the inventory code and add you own event in there. I require Java, both the coffee and the code
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.