类 ShieldBlockEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.entity.EntityEvent
net.minecraftforge.event.entity.living.LivingEvent
net.minecraftforge.event.entity.living.ShieldBlockEvent
The ShieldBlockEvent is fired when an entity successfully blocks with a shield.
Cancelling this event will have the same impact as if the shield was not eligible to block.
The damage blocked cannot be set lower than zero or greater than the original value.
Note: The shield item stack "should" be available from
Cancelling this event will have the same impact as if the shield was not eligible to block.
The damage blocked cannot be set lower than zero or greater than the original value.
Note: The shield item stack "should" be available from
LivingEntity.getUseItem()
at least for players.-
嵌套类概要
从类继承的嵌套类/接口 net.minecraftforge.event.entity.living.LivingEvent
LivingEvent.LivingJumpEvent, LivingEvent.LivingTickEvent, LivingEvent.LivingVisibilityEvent
从类继承的嵌套类/接口 net.minecraftforge.event.entity.EntityEvent
EntityEvent.EnteringSection, EntityEvent.EntityConstructing
从类继承的嵌套类/接口 net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明float
float
void
setBlockedDamage
(float blocked) Set how much damage is blocked by this action.
Note that initially the blocked amount is the entire attack.void
setShieldTakesDamage
(boolean damage) Set if the shield will take durability damage or not.boolean
Controls ifLivingEntity.hurtCurrentlyUsedShield(float)
is called.从类继承的方法 net.minecraftforge.event.entity.living.LivingEvent
getEntity
从类继承的方法 net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
字段详细资料
-
source
-
originalBlocked
private final float originalBlocked -
dmgBlocked
private float dmgBlocked -
shieldTakesDamage
private boolean shieldTakesDamage
-
-
构造器详细资料
-
ShieldBlockEvent
-
-
方法详细资料
-
getDamageSource
- 返回:
- The damage source.
-
getOriginalBlockedDamage
public float getOriginalBlockedDamage()- 返回:
- The original amount of damage blocked, which is the same as the original incoming damage value.
-
getBlockedDamage
public float getBlockedDamage()- 返回:
- The current amount of damage blocked, as a result of this event.
-
shieldTakesDamage
public boolean shieldTakesDamage()Controls ifLivingEntity.hurtCurrentlyUsedShield(float)
is called.- 返回:
- If the shield item will take durability damage or not.
-
setBlockedDamage
public void setBlockedDamage(float blocked) Set how much damage is blocked by this action.
Note that initially the blocked amount is the entire attack. -
setShieldTakesDamage
public void setShieldTakesDamage(boolean damage) Set if the shield will take durability damage or not.
-