Posted January 17, 201510 yr Hey there, I was wondering what I am doing wrong. I have tried both: public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) { if(player.getCurrentArmor(3) != null && player.getCurrentArmor(2) != null && player.getCurrentArmor(1) != null){ ItemStack helmet = player.getCurrentArmor(3); ItemStack plate = player.getCurrentArmor(2); ItemStack legs = player.getCurrentArmor(1); if(helmet.getItem() == itemRegist.bedrockHelmet && plate.getItem() == itemRegist.bedrockChest && legs.getItem() == itemRegist.bedrockLegs){ player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.getId(), 5, 2)); player.addPotionEffect(new PotionEffect(Potion.resistance.getId(), 5, 1)); } else if(helmet.getItem() == itemRegist.bedrockHelmet && plate.getItem() == itemRegist.bedrockChest){ player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.getId(), 5, 1)); player.addPotionEffect(new PotionEffect(Potion.resistance.getId(), 5, 0)); } else if(helmet.getItem() == itemRegist.bedrockHelmet){ player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.getId(), 5, 0)); } } and: public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) { if(player.getCurrentArmor(3) != null && player.getCurrentArmor(2) != null && player.getCurrentArmor(1) != null){ ItemStack helmet = player.getCurrentArmor(3); ItemStack plate = player.getCurrentArmor(2); ItemStack legs = player.getCurrentArmor(1); if(helmet.getItem() == itemRegist.bedrockHelmet){ player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.getId(), 5, 0)); } else if(helmet.getItem() == itemRegist.bedrockHelmet && plate.getItem() == itemRegist.bedrockChest){ player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.getId(), 5, 1)); player.addPotionEffect(new PotionEffect(Potion.resistance.getId(), 5, 0)); } else if(helmet.getItem() == itemRegist.bedrockHelmet && plate.getItem() == itemRegist.bedrockChest && legs.getItem() == itemRegist.bedrockLegs){ player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.getId(), 5, 2)); player.addPotionEffect(new PotionEffect(Potion.resistance.getId(), 5, 1)); } } } And neither do what I am looking for. I want it so when a player is wearing one piece of armour (that isn't boots) they get slowness one (and yes, I left out the ors for when there are less 2 or 1 items being worn, I just wanted to test), when they wear 2 they get slowness 2 and resistance 1, and when they wear all 3 they gets slowness 3 resistance 2. With the first code it only works on the helmet being worn - giving slowness 1 With the second code it only works when everything is worn - giving slowness 3, resistance 2. I never really messed with customizing armour and potion effects, any pointers on how to achieve this goal? Why bother?
January 17, 201510 yr Author I know that. As I said, when they are wearing more stuff they get more effects... which is in the code that I posted... Why bother?
January 17, 201510 yr Author Pardon my ignorance, I just realized where I have been going wrong. Sorry about that. Why bother?
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.