Package konquest.api.event.town
Class KonquestTownAttackEvent
java.lang.Object
org.bukkit.event.Event
konquest.api.event.KonquestEvent
konquest.api.event.town.KonquestTownEvent
konquest.api.event.town.KonquestTownAttackEvent
- 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.
- Author:
- Rumsfield
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionKonquestTownAttackEvent(KonquestAPI konquest, KonquestTown town, KonquestPlayer attacker, org.bukkit.block.Block block, boolean isMonument, boolean isCritical) Default constructor -
Method Summary
Modifier and TypeMethodDescriptionGets the attacking player.org.bukkit.block.BlockgetBlock()Gets the block broken by the attacker.booleanbooleanChecks whether the block is a critical block in the monument.booleanChecks whether the block was broken anywhere inside of the monument.voidsetCancelled(boolean val) Methods inherited from class konquest.api.event.town.KonquestTownEvent
getTownMethods inherited from class konquest.api.event.KonquestEvent
getHandlerList, getHandlers, getKonquestMethods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
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 instancetown- The townattacker- The attacking playerblock- The blockisMonument- Is the block inside the monumentisCritical- Is the block a critical monument block
-
-
Method Details
-
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 of 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:
isCancelledin interfaceorg.bukkit.event.Cancellable
-
setCancelled
public void setCancelled(boolean val) - Specified by:
setCancelledin interfaceorg.bukkit.event.Cancellable
-