类 ArmorHurtEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.entity.EntityEvent
net.neoforged.neoforge.event.entity.living.LivingEvent
net.neoforged.neoforge.event.entity.living.ArmorHurtEvent
- 所有已实现的接口:
net.neoforged.bus.api.ICancellableEvent
Fired on both sides when a
LivingEntity
's armor is dealt damage in
doHurtEquipment
.-
嵌套类概要
嵌套类从类继承的嵌套类/接口 net.neoforged.neoforge.event.entity.living.LivingEvent
LivingEvent.LivingJumpEvent, LivingEvent.LivingVisibilityEvent
从类继承的嵌套类/接口 net.neoforged.neoforge.event.entity.EntityEvent
EntityEvent.EnteringSection, EntityEvent.EntityConstructing, EntityEvent.Size
-
字段概要
字段 -
构造器概要
构造器构造器说明ArmorHurtEvent
(EnumMap<EquipmentSlot, ArmorHurtEvent.ArmorEntry> armorMap, LivingEntity player) -
方法概要
修饰符和类型方法说明Provides the Itemstack for the given slot.Used internally to get the full map ofItemStack
s to be hurtgetNewDamage
(EquipmentSlot slot) 返回 the amount to hurt the armor if the event is not cancelled。返回 the original damage before any event modifications。void
setNewDamage
(EquipmentSlot slot, float damage) Sets new damage for the armor.从类继承的方法 net.neoforged.neoforge.event.entity.living.LivingEvent
getEntity
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 net.neoforged.bus.api.ICancellableEvent
isCanceled, setCanceled
-
字段详细资料
-
armorEntries
-
-
构造器详细资料
-
ArmorHurtEvent
@Internal public ArmorHurtEvent(EnumMap<EquipmentSlot, ArmorHurtEvent.ArmorEntry> armorMap, LivingEntity player)
-
-
方法详细资料
-
getArmorItemStack
Provides the Itemstack for the given slot. Hand slots will always returnItemStack.EMPTY
- 返回:
- the
ItemStack
to be hurt for the given slot
-
getOriginalDamage
返回 the original damage before any event modifications。- 返回:
- the original damage before any event modifications
-
getNewDamage
返回 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
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 ofItemStack
s to be hurt
-