Posted March 21, 201510 yr Can anyone tell me which of the following is best for an item on the creation of it? For example, if I want a method to call when my custom item is dropped from a block break. Will either Overridden onEntityItemUpdate or onUpdate be called while the item is in a vanilla chest? For example, I'd like to have items lose durability while in a chest. Unless I'm doing something wrong or read the documentation wrong, onCreated is being called when the item spawns from a block break, like mining an ore. Thanks in advance
March 21, 201510 yr Items as objects in any inventory won't get any updates. For that you'd need custom tileEntity container (which chest is not) that will scan and update items for you. The only inventory that updates items per-tick is player's Item#onUpdate() is called always when item is inside player's inventory. Item#onCreated is called when you create item in crafting process (and only), so pulling it out of e.g creative inventory won't call it. To execute some code on block break you can use: HarvestDropsEvent Share what you want to do, and we will help in better manner. 1.7.10 is no longer supported by forge, you are on your own.
March 21, 201510 yr Author Will do Enio and thanks. I'm trying to write the pseudo code first before I jump straight into it and just needed to make sure I can do what I want. Thanks! I'll post here when I have something in 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.