/
Belyash5
/
Flu
Обзор
Документация
Войти
/
Belyash5
/
Flu
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/main/java/com/hbm/items/armor/ItemModSerum.java
41 строка
1 KB
Bob
more armor mods!
27 янв 2021, 01:47
27 янв 2021, 01:47
956a7bb
Код
Авторство
О чём код?
package com.hbm.items.armor; import java.util.List; import com.hbm.handler.ArmorModHandler; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.EnumChatFormatting; public class ItemModSerum extends ItemArmorMod { public ItemModSerum() { super(ArmorModHandler.extra, true, true, true, true); } @Override public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) { list.add(EnumChatFormatting.GREEN + "Cures poison and gives strength"); list.add(""); super.addInformation(itemstack, player, list, bool); } @Override public void addDesc(List list, ItemStack stack, ItemStack armor) { list.add(EnumChatFormatting.BLUE + " " + stack.getDisplayName() + " (replaces poison with strength)"); } @Override public void modUpdate(EntityLivingBase entity, ItemStack armor) { if(!entity.worldObj.isRemote && entity.isPotionActive(Potion.poison.id)) { entity.removePotionEffect(Potion.poison.id); entity.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 100, 4)); } } }