Hello people, i am searching for a nice way to listen on a chestchange. I need the amount of items of the chest, after the player closed the chest. I searched for an event like Code: public onChestChange(onChestChangeEvent event){ //count items } or much more better would be Code: public onChestClose(onChestCloseEvent event){ //count items } But, unhappily there is no such event. What would be the best solution to listen for this, without wasting cpu time. thanx for your help
Code: @EventHandler public void onInventoryChange(InventoryChangeEvent event){ Inventory inv = event.getInventory(); if(inv instanceof Chest){ //do intemstack code in here. http://jd.bukkit.org/doxygen/d3/dad/interfaceorg_1_1bukkit_1_1inventory_1_1Inventory.html
For exapmle use the "InventoryListener();" - still old event system, the event is: Code:JAVA Event.Type.INVENTORY_CHANGE;
Thanx for your replys. I saw the InventoryListener too, but i only saw this methods: Code: Public Member Functions InventoryListener () void onFurnaceBurn (FurnaceBurnEvent event) Called when an ItemStack is successfully burned as fuel in a furnace. void onFurnaceSmelt (FurnaceSmeltEvent event) Called when an ItemStack is successfully smelted in a furnace. How can i use the Inventory_Change event ?
TopGear93 You sure it isn't this? Code:Java @EventHandlerpublic void onPlayerInventory(PlayerInventoryEvent event){Inventory inv = event.getInventory();if(inv instanceof Chest){//do intemstack code in here.}
I tried now some differnt ways, but i haven't got a working code. Wether the old plugin system nor the old plugin system is helping me. Someone got an Idea, how to check this without using spout code.