Class PlayerDeniedBedUseEvent

java.lang.Object
org.bukkit.event.Event
com.palmergames.bukkit.towny.event.player.PlayerDeniedBedUseEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable

public class PlayerDeniedBedUseEvent extends org.bukkit.event.Event implements org.bukkit.event.Cancellable
  • Constructor Details

    • PlayerDeniedBedUseEvent

      public PlayerDeniedBedUseEvent(org.bukkit.entity.Player player, org.bukkit.Location location, boolean consideredEnemy, Translatable denialMessage)
  • Method Details

    • isCancelled

      public boolean isCancelled()
      Specified by:
      isCancelled in interface org.bukkit.event.Cancellable
    • setCancelled

      public void setCancelled(boolean cancel)
      Set to true in order to allow the bed use.
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable
    • getDenialMessage

      public Translatable getDenialMessage()
      Returns:
      the denialMessage shown when a player cannot use the bed.
    • setDenialMessage

      public void setDenialMessage(Translatable cancelMessage)
      Parameters:
      cancelMessage - the cancelMessage to set
    • getHandlers

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

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

      public org.bukkit.entity.Player getPlayer()
      Returns:
      the player being denied the use of a bed by Towny.
    • getLocation

      public org.bukkit.Location getLocation()
      Returns:
      the location of the bed.
    • isConsideredEnemy

      public boolean isConsideredEnemy()
      When false this is being denied because the player is in neither a personally-owned plot, nor an Inn plot.
      Returns:
      True when this beduse is being denied because the Player is an enemy or outlaw at the bed's location.