Броня которая не будет ломаться.

Версия Minecraft
1.7.10
12
-1
Здравствуйте, начал заниматься моддингом совсем недавно, и у меня возможно глупый вопрос, но особо инфы по этой теме найти не удалось.

Я создал свою броню, мне нужно что бы прочность работала как энергия, но когда она падала до нуля предмет не ломался.

P.S. Мое первое сообщение на форуме)
 
особо инфы по этой теме найти не удалось
А ты искал? На второй странице тема :m_faceplam:
 
Java:
public class BestArmor<p_77656_1_> extends ItemArmor{
    private String texturePath = "weaponmod:textures/model/armor/";

    public BestArmor(int id, int armorType) {
      super(BaseWeaponMod.ANG1, id, armorType);
      this.setCreativeTab(BaseWeaponMod.tabWeapon1);
      this.setMaxStackSize(1);
      this.setTextureName();
      this.setMaxDamage(0);
    
    }

    public void setTextureName ()
    {
      if(armorType == 0||armorType == 1||armorType == 3){
        this.texturePath += "draconic_layer_" + 1 + ".png";
      }
      else {
        this.texturePath += "draconic_layer_" + 2 + ".png";
      }
    }

    @Override
    public String getArmorTexture(ItemStack itemstack, Entity entity, int slot, String type){
      return this.texturePath;
    }
    @Override
    public void onArmorTick(World world, EntityPlayer player, ItemStack itemstack) {   
        if(player.inventory.armorItemInSlot(3) != null && player.inventory.armorItemInSlot(3).getItem() == BaseWeaponMod.bestarmorhelmet
            && player.inventory.armorItemInSlot(2) != null && player.inventory.armorItemInSlot(2).getItem() == BaseWeaponMod.bestarmorplate
            && player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(1).getItem() == BaseWeaponMod.bestarmorpants
            && player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(0).getItem() == BaseWeaponMod.bestarmorboots) {
            
            player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 3, 3, true));
        }
    }

}

Java:
static ArmorMaterial ANG1 = EnumHelper.addArmorMaterial("ANG1", 500, new int[] {30, 30, 30, 30}, 30);
 
Заходишь в мод, где твое "новое изобретение" уже есть и смотришь (копируешь) код от туда.
В текущем случае - draconic evolution, возможно Ender IO.

P.S.
прочность работала как энергия
Я так это понял.
 
Назад
Сверху