Interface EntityBlockAttackEvent

All Superinterfaces:
Cancellable, Event

public interface EntityBlockAttackEvent extends Event, Cancellable
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 Type
    Method
    Description
    float
    Returns how much of the damage the shield takes away, in half-hearts.
    float
    Returns the damage of the hit, in half-hearts, before the shield.
    Returns the entity holding the shield.
    void
    setBlockedDamage(float blockedDamage)
    Changes how much of the damage the shield takes away.
    Returns the item blocking the hit.
    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

      DamageSource source()
      Returns the hit being blocked.
      Returns:
      the hit being blocked
      Since:
      0.1.0
    • 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 between 0 and damage()
      Since:
      0.1.0