Здравствуйте
Как сделать так чтоб при одевании брони эффект давался только один раз а при снятии уберался
вот мой код но так получается что каждый тик игрок получает этот эффект заново и его начинает бить (у меня эффект на доп здоровье)
Как сделать так чтоб при одевании брони эффект давался только один раз а при снятии уберался
вот мой код но так получается что каждый тик игрок получает этот эффект заново и его начинает бить (у меня эффект на доп здоровье)
Код:
@Override
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
if (player.inventory.armorItemInSlot(3) != null && player.inventory.armorItemInSlot(3).getItem() == BaseMyBestMod.ironhelmeta
&& player.inventory.armorItemInSlot(2) != null && player.inventory.armorItemInSlot(2).getItem() == BaseMyBestMod.ironplate
&& player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(1).getItem() == BaseMyBestMod.ironpants
&& player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(0).getItem() == BaseMyBestMod.ironboots) {
player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 20, 0));
player.addPotionEffect(new PotionEffect(Potion.field_76434_w.id, 20, 10)); //вот этот эффект
}
}