Solved Armour Protection

Discussion in 'Bukkit Help' started by Elimnator, Jan 3, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    Elimnator

    Is there a way to change the damage resistance given for pieces of armour?

    I know how to do it in spigot:
    Code:
    event.setDamage(DamageModifier.ARMOR, damage);
    But that does not work for bukkit, can anyone help?

    OK, I got it. If anyone wants to know how here is my code:

    Code:
                        double damage = e.getDamage();
                        damage = damage - getArmourProt(p);
                        if(damage < 0)
                            damage = 0;
                        if(damage > 44)
                            damage = 44;
                        if((p.getHealth() - damage) > 0){
                            p.setHealth(p.getHealth() - damage);
                            e.setDamage(0);
                        }else
                            e.setDamage(44);
    
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Oct 31, 2016
Thread Status:
Not open for further replies.

Share This Page