Class KonquestTownCaptureEvent

java.lang.Object
org.bukkit.event.Event
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. If the town is a capital, then the old kingdom will be removed, and the capital will be converted into a town for the new 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.

  • Constructor Details

    • KonquestTownCaptureEvent

      public KonquestTownCaptureEvent(KonquestAPI konquest, KonquestTown town, KonquestPlayer player, KonquestKingdom newKingdom, boolean isCapital)
      Default constructor
      Parameters:
      konquest - The API instance
      town - The town
      player - The player
      newKingdom - The town's new kingdom
      isCapital - Whether the town was a capital
  • 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
    • isCapital

      public boolean isCapital()
      Checks whether the town is a capital of the old kingdom.
      Returns:
      Whether the town is a capital
    • 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