Posted July 4, 201411 yr I'm trying to replace an item with another item on right click on a custom mob if player is wearing a certain armor. This is the code I have and it wont work. Everything works except that even when I'm wearing the armor it says that I'm not wearing the armor. Code - http://pastebin.com/Ve8FzRJm
July 4, 201411 yr You need to change this: if(player.inventory.armorInventory[0] == new ItemStack(SoulCraft.soulHelmet)) to this: if (player.inventory.armorInventory[0].getItem() == SoulCraft.soulHelmet) for all the pieces of armour.
July 4, 201411 yr Author When I do your way, when I'm wearing the armor it says Im not wearing it, and when I'm not wearing the armor, the game crashes
July 4, 201411 yr Author This is code that I used in 1.6.4 that had a similar effect and it worked. But getCurrentItemorArmor is no longer a thing in 1.7.2 and when I change it to the suggested getCurrentArmor the code stops working. http://pastebin.com/bkrn42aD
July 4, 201411 yr Author SOLVED! Here is the new code if anyone is interested http://pastebin.com/fcUJJ6C9
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.