类 LivingDamageEvent.Post

封闭类:
LivingDamageEvent

public static class LivingDamageEvent.Post extends LivingDamageEvent
LivingDamageEvent.Post is fired after health is modified on the entity.
The fields in this event represent the FINAL values of what was applied to the entity.
Also note that appropriate resources (like armor durability and absorption extra hearts) have already been consumed.
This event is fired whenever an Entity is damaged in LivingEntity#actuallyHurt(DamageSource, float)
This event is fired via CommonHooks.onLivingDamagePost(LivingEntity, DamageContainer).
另请参阅:
  • 字段详细资料

    • originalDamage

      private final float originalDamage
    • source

      private final DamageSource source
    • newDamage

      private final float newDamage
    • blockedDamage

      private final float blockedDamage
    • shieldDamage

      private final float shieldDamage
    • postAttackInvulnerabilityTicks

      private final int postAttackInvulnerabilityTicks
    • reductions

      private final EnumMap<DamageContainer.Reduction,Float> reductions
  • 构造器详细资料

  • 方法详细资料

    • getOriginalDamage

      public float getOriginalDamage()
      返回 the original damage when Entity.hurt(net.minecraft.world.damagesource.DamageSource, float) was invoked。
      返回:
      the original damage when Entity.hurt(net.minecraft.world.damagesource.DamageSource, float) was invoked
    • getSource

      public DamageSource getSource()
      返回 the DamageSource for this damage sequence。
      返回:
      the DamageSource for this damage sequence
    • getNewDamage

      public float getNewDamage()
      返回 the amount of health this entity lost during this sequence。
      返回:
      the amount of health this entity lost during this sequence
    • getBlockedDamage

      public float getBlockedDamage()
      返回 the amount of damage reduced by a blocking action。
      返回:
      the amount of damage reduced by a blocking action
    • getShieldDamage

      public float getShieldDamage()
      返回 the amount of shield durability this entity lost if a blocking action was captured and the entity was holding a shield。
      返回:
      the amount of shield durability this entity lost if a blocking action was captured and the entity was holding a shield
    • getPostAttackInvulnerabilityTicks

      public int getPostAttackInvulnerabilityTicks()
      返回 the number of ticks this entity will be invulnerable after this sequence。
      返回:
      the number of ticks this entity will be invulnerable after this sequence
    • getReduction

      public float getReduction(DamageContainer.Reduction reduction)
      参数:
      reduction - the type of reduction to obtain
      返回:
      the amount of damage reduced by this reduction type.