Module gomint.api

Class EntityDamageEvent

    • Constructor Detail

      • EntityDamageEvent

        public EntityDamageEvent​(Entity entity,
                                 EntityDamageEvent.DamageSource damageSource,
                                 float damage)
        Create a new entity based cancellable event
        Parameters:
        entity - for which this event is
        damageSource - where the damage comes from
        damage - which should be dealt
    • Method Detail

      • setFinalDamage

        public void setFinalDamage​(float damage)
        Set the final damage which should be applied to the entity.
        Parameters:
        damage - which should be dealt
      • getFinalDamage

        public float getFinalDamage()
        Get the amount of damage which should be applied to the entity
        Returns:
        damage which should be dealt
      • setDamage

        public void setDamage​(float damage)
        Set the input damage to this event. When the final damage has not been modified this value will be used to calculate the final damage being dealt. There is no way to get the new final damage before it is applied to the entity.
        Parameters:
        damage - which should be used to calculate the final damage
      • getDamage

        public float getDamage()
        Get the damage which has been input into the calculation. This value represents the damage before any reduction.
        Returns:
        damage which is used in the final calculation