Armor

Discussion in 'Plugin Development' started by leet4044, Jul 26, 2015.

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

    leet4044

    I'm trying to figure out how I can modify armor, so that I can make Leather Armor as strong as Diamond Armor. Anyone have any ideas how I can achieve this?
     
  2. Offline

    mariosunny

    You would have to listen to EntityDamageEvent, which is called when an entity is damaged. From there, you should determine whether or not EntityDamageEvent#getEntity() is an instanceof LivingEntity. Once you have cast the entity to a LivingEntity, you can get its armor using LivingEntity#getEquipment(), and then set the damage value of the event using EntityDamageEvent#setDamage(double).
     
  3. Offline

    leet4044

    @mariosunny I'm currently already doing this, but there are alot of calculations I have to attend to doing that event, which is why I was wondering if I could make like Custom Entities but for armor or something, or hardcode the armor values to be the same as diamond.
     
  4. Offline

    mariosunny

    Base armor values are calculated by minecraft and there is no way to change them using Bukkit. From rjVapes:

     
  5. Offline

    leet4044

    I figured I'd have to do that ;-; Welp, looks like I'm on my own. Anyone else who can help, feel free to post it here. Thanks for the help @mariosunny
     
    mariosunny likes this.
Thread Status:
Not open for further replies.

Share This Page