Silly511 Posted May 24, 2016 Posted May 24, 2016 I am tring to make it where if an item has a certain NBT tag and is not in the players hand, then delete it. Currently every tick I am iterating though all the items in the players inventory and checking if they have the NBT tag and is not in the main hand. Is there a better way to do this? Quote
Silly511 Posted May 24, 2016 Author Posted May 24, 2016 I am tring to make it where if an item has a certain NBT tag and is not in the players hand, then delete it. Currently every tick I am iterating though all the items in the players inventory and checking if they have the NBT tag and is not in the main hand. Is there a better way to do this? Quote
Ernio Posted May 24, 2016 Posted May 24, 2016 onUpdate() is called whenever item is in inventory. Do that there. Are you also asking about removing item from world/other inventories (like mobs or chests)? Quote Quote 1.7.10 is no longer supported by forge, you are on your own.
Ernio Posted May 24, 2016 Posted May 24, 2016 onUpdate() is called whenever item is in inventory. Do that there. Are you also asking about removing item from world/other inventories (like mobs or chests)? Quote Quote 1.7.10 is no longer supported by forge, you are on your own.
Silly511 Posted May 24, 2016 Author Posted May 24, 2016 Well thats the problem. I want to check any type of item, not just my own. Quote
Silly511 Posted May 24, 2016 Author Posted May 24, 2016 Well thats the problem. I want to check any type of item, not just my own. Quote
Ernio Posted May 24, 2016 Posted May 24, 2016 Then PlayerTickEvent and iteration. Quote Quote 1.7.10 is no longer supported by forge, you are on your own.
Ernio Posted May 24, 2016 Posted May 24, 2016 Then PlayerTickEvent and iteration. Quote Quote 1.7.10 is no longer supported by forge, you are on your own.
Silly511 Posted May 24, 2016 Author Posted May 24, 2016 Ok so what I'm doing is fine. I just thought there might be a more efficient way. Quote
Silly511 Posted May 24, 2016 Author Posted May 24, 2016 Ok so what I'm doing is fine. I just thought there might be a more efficient way. Quote
Recommended Posts
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.