Class KonquestTownCaptureEvent

java.lang.Object
org.bukkit.event.Event
konquest.api.event.KonquestEvent
konquest.api.event.town.KonquestTownEvent
konquest.api.event.town.KonquestTownCaptureEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable

public class KonquestTownCaptureEvent extends KonquestTownEvent implements org.bukkit.event.Cancellable
Called before an enemy player captures a town for their own kingdom.

Players capture towns for their kingdoms when they destroy the final critical block in the town monument. When a town is captured, it transfers ownership to the attacking player's kingdom. Canceling this event will prevent the town from being captured, but the final critical block will still be broken.

After this event is cancelled, the town will remain un-captured, but all critical blocks will be broken. The monument will regenerate as normal after enemy players break the most recent monument block.

Author:
Rumsfield
  • Constructor Details

    • KonquestTownCaptureEvent

      public KonquestTownCaptureEvent(KonquestAPI konquest, KonquestTown town, KonquestPlayer player, KonquestKingdom newKingdom)
      Default constructor
      Parameters:
      konquest - The API instance
      town - The town
      player - The player
      newKingdom - The town's new kingdom
  • Method Details

    • getPlayer

      public KonquestPlayer getPlayer()
      Gets the player that captured this town, and is now the town lord.
      Returns:
      The player
    • getNewKingdom

      public KonquestKingdom getNewKingdom()
      Gets the new kingdom that will control the town when it is captured.
      Returns:
      The old kingdom
    • 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