Posted May 18, 201312 yr I'm trying to do a set of armor that when the player is full equipped he will be fireproof (no damage when in lava or in touch with fire). For now it work well when I'm in lava but when I jump out I still burning and start to lose hp. Any help? I tried this way and the commented way: public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) { EntityPlayer player = (EntityPlayer) par3Entity; if ( player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(2) != null && player.inventory.armorItemInSlot(3) != null ) { ItemStack itemstack0 = player.inventory.armorItemInSlot(0); ItemStack itemstack1 = player.inventory.armorItemInSlot(1); ItemStack itemstack2 = player.inventory.armorItemInSlot(2); ItemStack itemstack3 = player.inventory.armorItemInSlot(3); if ( itemstack0.itemID == SunSonMod.fireProtectedHelmet.itemID && itemstack1.itemID == SunSonMod.fireProtectedPlate.itemID && itemstack2.itemID == SunSonMod.fireProtectedLegs.itemID && itemstack3.itemID == SunSonMod.fireProtectedBoots.itemID ) { /*if(player.isBurning()){ player.extinguish(); }*/ if(!itemstack0.isItemEnchanted() && !itemstack1.isItemEnchanted() && !itemstack2.isItemEnchanted() && !itemstack3.isItemEnchanted()){ itemstack0.addEnchantment(Enchantment.fireProtection, 1000); itemstack1.addEnchantment(Enchantment.fireProtection, 1000); itemstack2.addEnchantment(Enchantment.fireProtection, 1000); itemstack3.addEnchantment(Enchantment.fireProtection, 1000); } } } }
May 18, 201312 yr Author There is a method onArmorTickUpdate in the Item class. That's what you need. I tried and still the same. When I'm in lava I don't lose hp but when I jump out I start taking damage
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.