Class KonquestTownAttackEvent

java.lang.Object
org.bukkit.event.Event
All Implemented Interfaces:
org.bukkit.event.Cancellable

public class KonquestTownAttackEvent extends KonquestTownEvent implements org.bukkit.event.Cancellable
Called when an enemy player breaks a block within a town.

This event occurs for all blocks broken inside town land, including inside of the monument and for critical blocks. Canceling this event prevents the block from braking.

  • Constructor Details

    • KonquestTownAttackEvent

      public KonquestTownAttackEvent(KonquestAPI konquest, KonquestTown town, KonquestPlayer attacker, org.bukkit.block.Block block, boolean isMonument, boolean isCritical)
      Default constructor
      Parameters:
      konquest - The API instance
      town - The town
      attacker - The attacking player
      block - The block
      isMonument - Is the block inside the monument
      isCritical - Is the block a critical monument block
  • Method Details

    • getAttacker

      public KonquestPlayer getAttacker()
      Gets the attacking player.
      Returns:
      The attacker
    • getBlock

      public org.bukkit.block.Block getBlock()
      Gets the block broken by the attacker.
      Returns:
      The block
    • isMonument

      public boolean isMonument()
      Checks whether the block was broken anywhere inside the monument.
      Returns:
      True when the block is inside the town monument, else false
    • isCritical

      public boolean isCritical()
      Checks whether the block is a critical block in the monument.
      Returns:
      True when the block is a critical block, else false
    • isCancelled

      public boolean isCancelled()
      Specified by:
      isCancelled in interface org.bukkit.event.Cancellable
    • setCancelled

      public void setCancelled(boolean val)
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable