Package redempt.redlib.region.events
Class RegionExitEvent
java.lang.Object
org.bukkit.event.Event
redempt.redlib.region.events.RegionExitEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public class RegionExitEvent
extends org.bukkit.event.Event
implements org.bukkit.event.Cancellable
Called when a player exits a region with events enabled
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result
-
Constructor Summary
ConstructorDescriptionRegionExitEvent
(org.bukkit.entity.Player player, Region region, RegionExitEvent.ExitCause cause, org.bukkit.event.Cancellable parent) Constructs a new RegionExitEvent -
Method Summary
Modifier and TypeMethodDescriptiongetCause()
static org.bukkit.event.HandlerList
org.bukkit.event.HandlerList
org.bukkit.entity.Player
boolean
void
setCancelled
(boolean cancel) Set whether or not to cancel the player entering the Region.Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
RegionExitEvent
public RegionExitEvent(org.bukkit.entity.Player player, Region region, RegionExitEvent.ExitCause cause, org.bukkit.event.Cancellable parent) Constructs a new RegionExitEvent- Parameters:
player
- The player that exited the regionregion
- The region that was exitedcause
- What caused the player to enter the regionparent
- The event that caused this RegionExitEvent to fire
-
-
Method Details
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList() -
getHandlers
public org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlers
in classorg.bukkit.event.Event
-
getPlayer
public org.bukkit.entity.Player getPlayer()- Returns:
- The player who exited the region
-
getRegion
- Returns:
- The region that was exited
-
getCause
- Returns:
- What caused the player to exit the region
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelled
in interfaceorg.bukkit.event.Cancellable
- Returns:
- Whether or not the event has been cancelled. Always false if the parent event cannot be cancelled.
-
setCancelled
public void setCancelled(boolean cancel) Set whether or not to cancel the player entering the Region. Not all causes can be cancelled - checkgetCause()
first, you can't cancel a player leaving- Specified by:
setCancelled
in interfaceorg.bukkit.event.Cancellable
- Parameters:
cancel
- Whether to cancel this event
-