Class DeathPriceEvent

java.lang.Object
org.bukkit.event.Event
com.palmergames.bukkit.towny.event.deathprice.DeathPriceEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable
Direct Known Subclasses:
NationPaysDeathPriceEvent, PlayerPaysDeathPriceEvent, TownPaysDeathPriceEvent

public abstract class DeathPriceEvent extends org.bukkit.event.Event implements org.bukkit.event.Cancellable
  • Field Details

    • cancelled

      protected boolean cancelled
    • payer

      protected final Account payer
    • amount

      protected double amount
    • deadResident

      protected final Resident deadResident
    • killer

      protected final org.bukkit.entity.Player killer
  • Constructor Details

    • DeathPriceEvent

      public DeathPriceEvent(Account payer, double amount, Resident deadResident, org.bukkit.entity.Player killer)
  • Method Details

    • getHandlerList

      public static org.bukkit.event.HandlerList getHandlerList()
    • getHandlers

      public org.bukkit.event.HandlerList getHandlers()
      Specified by:
      getHandlers in class org.bukkit.event.Event
    • getPayer

      public Account getPayer()
      Returns:
      the payer
    • getAmount

      public double getAmount()
      Returns:
      the amount
    • setAmount

      public void setAmount(double amount)
      Parameters:
      amount - the amount to set
    • getDeadResident

      public Resident getDeadResident()
      Returns:
      the deadResident
    • getKiller

      @Nullable public @Nullable org.bukkit.entity.Player getKiller()
      Returns:
      killer, the Player who is getting paid, or null if this was not a PVP death.
    • isPVPDeath

      public boolean isPVPDeath()
      Returns:
      true when this is a PVP related death.
    • isCancelled

      public boolean isCancelled()
      Whether the event has been cancelled or the amount has been made 0 or less.
      Specified by:
      isCancelled in interface org.bukkit.event.Cancellable
    • setCancelled

      public void setCancelled(boolean cancel)
      Set the event to cancelled. False meaning money will be lost, True meaning no money will be lost.
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable