Interface EntityBlockAttackEvent
- All Superinterfaces:
Cancellable, Event
Fired when a raised shield is about to block a hit. Cancelling it lets the hit through as if the
shield were lowered.
- Since:
- 0.1.0
-
Method Summary
Modifier and TypeMethodDescriptionfloatReturns how much of the damage the shield takes away, in half-hearts.floatdamage()Returns the damage of the hit, in half-hearts, before the shield.entity()Returns the entity holding the shield.voidsetBlockedDamage(float blockedDamage) Changes how much of the damage the shield takes away.shield()Returns the item blocking the hit.source()Returns the hit being blocked.Methods inherited from interface Cancellable
isCancelled, setCancelled
-
Method Details
-
entity
LivingEntity entity()Returns the entity holding the shield.- Returns:
- the entity holding the shield
- Since:
- 0.1.0
-
source
-
shield
ItemStack shield()Returns the item blocking the hit.- Returns:
- the item blocking the hit
- Since:
- 0.1.0
-
damage
float damage()Returns the damage of the hit, in half-hearts, before the shield.- Returns:
- the damage of the hit, in half-hearts, before the shield
- Since:
- 0.1.0
-
blockedDamage
float blockedDamage()Returns how much of the damage the shield takes away, in half-hearts.- Returns:
- how much of the damage the shield takes away, in half-hearts
- Since:
- 0.1.0
-
setBlockedDamage
void setBlockedDamage(float blockedDamage) Changes how much of the damage the shield takes away.- Parameters:
blockedDamage- the damage to block, clamped between0anddamage()- Since:
- 0.1.0
-