Class PlayerHitConstructionEvent

All Implemented Interfaces:
Cancellable

public final class PlayerHitConstructionEvent extends PlayerConstructionEvent
Called when a player hits a construction element (e.g planks, beams, posters etc).
See Also:
  • Method Details

    • getDamage

      public short getDamage()
      Gets the amount of damage the player causes by hitting the construction element.
      Returns:
      the amount of damage dealt with this hit.
    • setDamage

      public void setDamage(short damage)
      Sets the amount of damage the player should inflict with this hit.
      Parameters:
      damage - the new amount of damage.
    • getHitPosition

      public Vector3f getHitPosition()
      Gets the world coordinates where the construction element was hit exactly.
      Returns:
      coordinates where the construction element was hit.
    • getConstructionElement

      public ConstructionElement getConstructionElement()
      Description copied from class: PlayerConstructionEvent
      Gets the construction element.
      Overrides:
      getConstructionElement in class PlayerConstructionEvent
      Returns:
      the construction element.