This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { int i = EntityLiving.func_82159_b(par1ItemStack) - 1; ItemStack itemstack1 = par3EntityPlayer.getCurrentArmor(i); if (itemstack1 == null) { par3EntityPlayer.setCurrentItemOrArmor(i, par1ItemStack.copy()); par1ItemStack.stackSize = 0; } return par1ItemStack; }
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { int i = (this.armorType - 3) * -1; ItemStack itemstack1 = par3EntityPlayer.inventory.armorItemInSlot(i); if (itemstack1 == null) { par3EntityPlayer.inventory.armorInventory[i] = par1ItemStack.copy(); par1ItemStack.stackSize = 0; } return par1ItemStack; }
Currently there is a bug, where if the player right clicks with an armor item in their hand. The armor will equip itself on the wrong Armor Slot.
This fix will be helpful for all custom armored created until Mojang smashes this bug.
Mojangs Bugged Code:
Here is my Fix: