Rapid Lava Damage

Discussion in 'Plugin Development' started by Acer_Mortem, May 17, 2014.

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

    Acer_Mortem

    I'm currently trying to circumvent Armor influencing damage (for example, if a mob hits a player with full chainmail for 10 damage, only about 6 or so would actually hit), so I'm setting the players health to their health minus the damage:

    Code:
    p.setHealth(p.getHealth() - e.getDamage());
    I then set the players noDamageTicks like so:
    Code:
            p.setNoDamageTicks(p.getMaximumNoDamageTicks());
    I then set the damage to 0 to prevent any further damage from occuring. Unfortunately, this has the problem that the players noDamageTicks are essentially ignored. For example, if a player is standing in lava, instead of waiting for the full DamageTicks to pass, the player is spammed with damage.

    Does anyone know how to stop this? Thanks =)
     
  2. Offline

    JUSTCAMH

    So there is an EntityDamageEvent. Make a hashmap, add the player to the hashmap and in your event, check if the entity damaged is your player from the hashmap. If so, cancel it
     
Thread Status:
Not open for further replies.

Share This Page