Class RtpTeleportEvent
java.lang.Object
org.bukkit.event.Event
net.godlycow.org.essc.api.rtp.event.RtpTeleportEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public class RtpTeleportEvent
extends org.bukkit.event.Event
implements org.bukkit.event.Cancellable
Fired right before the RTP teleport.
Rewrite the landing spot with setDestination(Location), or cancel the
event to block the teleport.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionRtpTeleportEvent(org.bukkit.entity.Player player, org.bukkit.World world, org.bukkit.Location destination) Creates a new RTP teleport event. -
Method Summary
Modifier and TypeMethodDescriptionReturns why the event was cancelled, or an empty string if not cancelled.org.bukkit.LocationReturns the landing spot (a copy).static org.bukkit.event.HandlerListorg.bukkit.event.HandlerListorg.bukkit.entity.PlayerReturns the teleporting player.org.bukkit.WorldgetWorld()Returns the world.booleanvoidsetCancelled(boolean cancel) voidsetCancelReason(String cancelReason) Sets why the event is being cancelled.voidsetDestination(org.bukkit.Location destination) Rewrites the landing spot.Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
RtpTeleportEvent
public RtpTeleportEvent(org.bukkit.entity.Player player, org.bukkit.World world, org.bukkit.Location destination) Creates a new RTP teleport event.- Parameters:
player- the teleporting playerworld- the worlddestination- the landing spot
-
-
Method Details
-
getPlayer
public org.bukkit.entity.Player getPlayer()Returns the teleporting player.- Returns:
- the player
-
getWorld
public org.bukkit.World getWorld()Returns the world.- Returns:
- the world
-
getDestination
public org.bukkit.Location getDestination()Returns the landing spot (a copy).- Returns:
- the destination
-
setDestination
public void setDestination(org.bukkit.Location destination) Rewrites the landing spot.- Parameters:
destination- the new destination
-
getCancelReason
Returns why the event was cancelled, or an empty string if not cancelled.- Returns:
- the cancel reason
-
setCancelReason
Sets why the event is being cancelled.- Parameters:
cancelReason- the cancel reason
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceorg.bukkit.event.Cancellable
-
setCancelled
public void setCancelled(boolean cancel) - Specified by:
setCancelledin interfaceorg.bukkit.event.Cancellable
-
getHandlers
public org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlersin classorg.bukkit.event.Event
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()
-