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
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result
-
Constructor Summary
ConstructorDescriptionPlayerDeniedBedUseEvent
(org.bukkit.entity.Player player, org.bukkit.Location location, boolean consideredEnemy, Translatable denialMessage) -
Method Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.event.HandlerList
org.bukkit.event.HandlerList
org.bukkit.Location
org.bukkit.entity.Player
boolean
boolean
When false this is being denied because the player is in neither a personally-owned plot, nor an Inn plot.void
setCancelled
(boolean cancel) Set to true in order to allow the bed use.void
setDenialMessage
(Translatable cancelMessage) Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
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 interfaceorg.bukkit.event.Cancellable
-
setCancelled
public void setCancelled(boolean cancel) Set to true in order to allow the bed use.- Specified by:
setCancelled
in interfaceorg.bukkit.event.Cancellable
-
getDenialMessage
- Returns:
- the denialMessage shown when a player cannot use the bed.
-
setDenialMessage
- Parameters:
cancelMessage
- the cancelMessage to set
-
getHandlers
public org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlers
in classorg.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.
-