Class KonquestTerritoryMoveEvent

java.lang.Object
org.bukkit.event.Event
com.github.rumsfield.konquest.api.event.KonquestEvent
com.github.rumsfield.konquest.api.event.territory.KonquestTerritoryMoveEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable

public class KonquestTerritoryMoveEvent extends KonquestEvent implements org.bukkit.event.Cancellable
Called before a player enters or leaves a territory.

This only happens at chunk boundaries. The wild is not a territory, and is represented as a null territory field. When this event is cancelled, the player's movement will also be cancelled and they will be prevented from moving.

  • Constructor Details

    • KonquestTerritoryMoveEvent

      public KonquestTerritoryMoveEvent(KonquestAPI konquest, KonquestTerritory territoryTo, KonquestTerritory territoryFrom, KonquestPlayer player)
      Default constructor
      Parameters:
      konquest - The API instance
      territoryTo - The territory moving to
      territoryFrom - The territory moving from
      player - The player
  • Method Details

    • getPlayer

      public KonquestPlayer getPlayer()
      Get the player that moved between territories.
      Returns:
      The player
    • getTerritoryTo

      public KonquestTerritory getTerritoryTo()
      Get the territory that the player is moving into. Returns null when moving into the wild.
      Returns:
      The territory, or null when wild
    • getTerritoryFrom

      public KonquestTerritory getTerritoryFrom()
      Get the territory that the player is moving out of. Returns null when moving out of the wild.
      Returns:
      The territory, or null when wild
    • 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