类 ArmorHurtEvent

java.lang.Object
net.neoforged.bus.api.Event
所有已实现的接口:
net.neoforged.bus.api.ICancellableEvent

public class ArmorHurtEvent extends LivingEvent implements net.neoforged.bus.api.ICancellableEvent
Fired on both sides when a LivingEntity's armor is dealt damage in doHurtEquipment.
  • 字段详细资料

  • 构造器详细资料

  • 方法详细资料

    • getArmorItemStack

      public ItemStack getArmorItemStack(EquipmentSlot slot)
      Provides the Itemstack for the given slot. Hand slots will always return ItemStack.EMPTY
      返回:
      the ItemStack to be hurt for the given slot
    • getOriginalDamage

      public Float getOriginalDamage(EquipmentSlot slot)
      返回 the original damage before any event modifications。
      返回:
      the original damage before any event modifications
    • getNewDamage

      public Float getNewDamage(EquipmentSlot slot)
      返回 the amount to hurt the armor if the event is not cancelled。
      返回:
      the amount to hurt the armor if the event is not cancelled
    • setNewDamage

      public void setNewDamage(EquipmentSlot slot, float damage)
      Sets new damage for the armor. Setting damage for empty slots will have no effect.
      参数:
      damage - the new amount to hurt the armor. Values below zero will be set to zero.
    • getArmorMap

      Used internally to get the full map of ItemStacks to be hurt