- 114
- 2
Ух, прикольно сделали форум. Приятно, когда развивают то, что тебе действительно нравиться. Но все же, у меня появился вопрос. Как мне сделать, чтобы при надевании моей брони, время её эффектов было равно = 0, ну как-бы они есть, но время просто 0. Ибо, по умолчанию идет 7 секунд и потом опять повтор, в этом и минус. Что игрок, надевая и снимая все броньки, получает еще уйму эффектов с них. Вообщем, надеюсь вы меня поняли. Сам код при надевании, вот:
Java:
@Override
public void onArmorTick(World world, EntityPlayer player, ItemStack itemstack) {
if(player.inventory.armorItemInSlot(3) != null && player.inventory.armorItemInSlot(3).getItem() == RPGarmor.PalladiumHelmet
&& player.inventory.armorItemInSlot(2) != null && player.inventory.armorItemInSlot(2).getItem() == RPGarmor.PalladiumChestplate
&& player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(1).getItem() == RPGarmor.PalladiumLeggings
&& player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(0).getItem() == RPGarmor.PalladiumBoots) {
this.effectPlayer(player, Potion.getPotionById(5), 0);
this.effectPlayer(player, Potion.getPotionById(2), 0);
}
}
private void effectPlayer(EntityPlayer player, Potion potion, int amplifier) {
if(player.getActivePotionEffect(potion) == null || player.getActivePotionEffect(potion).getDuration() <= 1)
player.addPotionEffect(new PotionEffect(potion, 159, amplifier, true , true));
}
Последнее редактирование модератором:
