Posted February 26, 201411 yr How can i add a potion effect to a player when he's wearing a full specific armour set?
February 26, 201411 yr @Override public void onArmorTickUpdate(World world, EntityPlayer player, ItemStack itemStack) { if (player.getCurrentItemOrArmor(4) != null && player.getCurrentArmor(3) != null && player.getCurrentItemOrArmor(2) != null && player.getCurrentItemOrArmor(1) != null) { ItemStack helmet = player.getCurrentItemOrArmor(4); ItemStack plate = player.getCurrentItemOrArmor(3); ItemStack legs = player.getCurrentItemOrArmor(2); ItemStack boots = player.getCurrentItemOrArmor(1); if (helmet.getItem() == yourHelmet && plate.getItem() == yourChestPlate && legs.getItem() == yourLeggings && boots.getItem() == yourBoots) { player.addPotionEffect((new PotionEffect(Potion.potionname.id, field, field))); } } Item class.
February 27, 201411 yr Author @Override public void onArmorTickUpdate(World world, EntityPlayer player, ItemStack itemStack) { if (player.getCurrentItemOrArmor(4) != null && player.getCurrentArmor(3) != null && player.getCurrentItemOrArmor(2) != null && player.getCurrentItemOrArmor(1) != null) { ItemStack helmet = player.getCurrentItemOrArmor(4); ItemStack plate = player.getCurrentItemOrArmor(3); ItemStack legs = player.getCurrentItemOrArmor(2); ItemStack boots = player.getCurrentItemOrArmor(1); if (helmet.getItem() == yourHelmet && plate.getItem() == yourChestPlate && legs.getItem() == yourLeggings && boots.getItem() == yourBoots) { player.addPotionEffect((new PotionEffect(Potion.potionname.id, field, field))); } } Item class. Ok, thank you
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.