Solved Armor Cap

Discussion in 'Plugin Development' started by Rexe0, May 18, 2020.

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

    Rexe0

    Hello, (I don't know if this is the right place to put it)

    If you didn't know there is a cap to armor which is 30 armor points. (The defense points from armor pieces)

    Would there be a way to get rid of this cap, as I am trying to create a new damage system with armor that gives armor points that exceed 30.

    Thanks.
     
  2. Offline

    KarimAKL

    Are you asking as a developer, or as a server owner?
     
  3. Offline

    Rexe0

    As a developer. I am trying t0 modify the damage calculations of Minecraft with armor.
     
  4. Offline

    KarimAKL

    @Rexe0 I made a little util class for getting the armor points from the material (because i couldn't find any other way), then i cancel the damage event and set the health using LivingEntity#setHealth(double).
    #setHealth() doesn't do anything about absorption so, you'll have to reduce that as well, if you want it to act like #damage().

    EDIT: In case you didn't get my point, you can reduce the damage with a custom formula like this.
     
    Last edited: May 21, 2020
  5. Offline

    Rexe0

    Yea i see. I already made the damage formula before (using what you described). So should i just calculate the defence gain from the armor and is there no way to remove the cap?
     
  6. Offline

    KarimAKL

    You can just get the armor when the entity is damaged.

    I didn't even know about a cap (other than the 20 from full diamond armor) before so, i'm not sure.
     
  7. Offline

    Rexe0

    There is a cap, so getting the armor of the entity would not be helpful if it goes over 30. Try it, just give your self an armor piece that gives over 30 defense points then check your armor stat.

    What I'm asking if there is an option in a server to remove or change it, or a setting within the bukkit API to remove or change it.
     
  8. Offline

    KarimAKL

    I thought you'd be able to get the armor but, it just wasn't calculated into the damage reduction.
    Can you get the armor, or is that also 30?
     
  9. Offline

    Rexe0

    If you’re talking about the player’s armor stat then your armor points are capped at 30. However if you mean the attribute modifiers on a select armor piece, it isn’t capped.

    Calculating the armor gain from each piece isn’t preffered, as armor won’t be the only thing that grants ‘defense points’ with what I am doing.
     
  10. Offline

    KarimAKL

    @Rexe0 Then try calculating everything that can give armor, or get it from something that collects the information.
     
  11. Offline

    Rexe0

    Will do. It’s a shame I can’t just remove the cap.
     
Thread Status:
Not open for further replies.

Share This Page