Class 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.- 
Nested Class SummaryNested classes/interfaces inherited from class net.minecraftforge.event.entity.living.LivingEventLivingEvent.LivingJumpEvent, LivingEvent.LivingTickEvent, LivingEvent.LivingVisibilityEventNested classes/interfaces inherited from class net.minecraftforge.event.entity.EntityEventEntityEvent.EnteringSection, EntityEvent.EntityConstructingNested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Eventnet.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate floatprivate final floatprivate booleanprivate final DamageSource
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionfloatfloatvoidsetBlockedDamage(float blocked) Set how much damage is blocked by this action.
 Note that initially the blocked amount is the entire attack.voidsetShieldTakesDamage(boolean damage) Set if the shield will take durability damage or not.booleanControls ifLivingEntity.hurtCurrentlyUsedShield(float)is called.Methods inherited from class net.minecraftforge.event.entity.living.LivingEventgetEntityMethods inherited from class net.minecraftforge.eventbus.api.EventgetListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
- 
Field Details- 
source
- 
originalBlockedprivate final float originalBlocked
- 
dmgBlockedprivate float dmgBlocked
- 
shieldTakesDamageprivate boolean shieldTakesDamage
 
- 
- 
Constructor Details- 
ShieldBlockEvent
 
- 
- 
Method Details- 
getDamageSource- Returns:
- The damage source.
 
- 
getOriginalBlockedDamagepublic float getOriginalBlockedDamage()- Returns:
- The original amount of damage blocked, which is the same as the original incoming damage value.
 
- 
getBlockedDamagepublic float getBlockedDamage()- Returns:
- The current amount of damage blocked, as a result of this event.
 
- 
shieldTakesDamagepublic boolean shieldTakesDamage()Controls ifLivingEntity.hurtCurrentlyUsedShield(float)is called.- Returns:
- If the shield item will take durability damage or not.
 
- 
setBlockedDamagepublic void setBlockedDamage(float blocked) Set how much damage is blocked by this action.
 Note that initially the blocked amount is the entire attack.
- 
setShieldTakesDamagepublic void setShieldTakesDamage(boolean damage) Set if the shield will take durability damage or not.
 
-