Class KonquestTownAttackEvent
java.lang.Object
org.bukkit.event.Event
com.github.rumsfield.konquest.api.event.KonquestEvent
com.github.rumsfield.konquest.api.event.town.KonquestTownEvent
com.github.rumsfield.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.
-
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.Block
getBlock()
Gets the block broken by the attacker.boolean
boolean
Checks whether the block is a critical block in the monument.boolean
Checks whether the block was broken anywhere inside the monument.void
setCancelled
(boolean val) Methods inherited from class com.github.rumsfield.konquest.api.event.town.KonquestTownEvent
getTown
Methods inherited from class com.github.rumsfield.konquest.api.event.KonquestEvent
getHandlerList, getHandlers, getKonquest
Methods 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 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 interfaceorg.bukkit.event.Cancellable
-
setCancelled
public void setCancelled(boolean val) - Specified by:
setCancelled
in interfaceorg.bukkit.event.Cancellable
-