Posted November 3, 201410 yr I want to know how i can check if a player has a certain item in his inventory, and also how to remove items from a players inventory
November 3, 201410 yr If you are referring to your own items (mod-made) you can override Item.onUpdate() method which is launched when you have it in inv. If you need to know if any item is in inventory use PlayerTickEvent and scan through inventory for item. If you would have hard time figuring it out please write. 1.7.10 is no longer supported by forge, you are on your own.
November 3, 201410 yr Author I managed to find what i needed, but now all i need to know is how to add an item into a players inventory.
November 3, 201410 yr entityPlayer.inventory.addItemStackToInventory(new ItemStack(MyMod.myModItem, 1)); 1.7.10 is no longer supported by forge, you are on your own.
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.