Package redempt.redlib.region.events
Class RegionEnterEvent
java.lang.Object
org.bukkit.event.Event
redempt.redlib.region.events.RegionEnterEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public class RegionEnterEvent
extends org.bukkit.event.Event
implements org.bukkit.event.Cancellable
Called when a player enters a region with events enabled
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionRegionEnterEvent(org.bukkit.entity.Player player, Region region, RegionEnterEvent.EnterCause cause, org.bukkit.event.Cancellable parent) Constructs a new RegionEnterEvent -
Method Summary
Modifier and TypeMethodDescriptiongetCause()static org.bukkit.event.HandlerListorg.bukkit.event.HandlerListorg.bukkit.entity.PlayerbooleanvoidsetCancelled(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
-
RegionEnterEvent
public RegionEnterEvent(org.bukkit.entity.Player player, Region region, RegionEnterEvent.EnterCause cause, org.bukkit.event.Cancellable parent) Constructs a new RegionEnterEvent- Parameters:
player- The player who entered the regionregion- The region that was enteredcause- What caused the player to enter the regionparent- The event which caused this RegionEnterEvent to fire
-
-
Method Details
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList() -
getHandlers
public org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlersin classorg.bukkit.event.Event
-
getPlayer
public org.bukkit.entity.Player getPlayer()- Returns:
- The player who entered the region
-
getRegion
- Returns:
- The region that was entered
-
getCause
- Returns:
- What caused the player to enter the region
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin 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 joining- Specified by:
setCancelledin interfaceorg.bukkit.event.Cancellable- Parameters:
cancel- Whether to cancel this event
-