Class StargateTeleportPortalEvent
java.lang.Object
org.bukkit.event.Event
org.sgrewritten.stargate.api.event.portal.StargatePortalEvent
org.sgrewritten.stargate.api.event.portal.StargateEntityPortalEvent
org.sgrewritten.stargate.api.event.portal.StargateTeleportPortalEvent
This event should be called whenever a non-player teleports through a stargate
This event can be used to overwrite the location the entity is teleported to.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result
-
Constructor Summary
ConstructorDescriptionStargateTeleportPortalEvent
(@NotNull org.bukkit.entity.Entity travellingEntity, @NotNull Portal portal, Portal destination, @NotNull org.bukkit.Location exit) Instantiates a new stargate portal event -
Method Summary
Modifier and TypeMethodDescriptionGets the destination portalorg.bukkit.Location
getExit()
Gets the location the entity is about to be teleported tostatic org.bukkit.event.HandlerList
Gets a handler-list containing all event handlers@NotNull org.bukkit.event.HandlerList
void
setExit
(@NotNull org.bukkit.Location location) Set the location the entity should exit fromMethods inherited from class org.sgrewritten.stargate.api.event.portal.StargateEntityPortalEvent
getEntity
Methods inherited from class org.sgrewritten.stargate.api.event.portal.StargatePortalEvent
getPortal
Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
StargateTeleportPortalEvent
public StargateTeleportPortalEvent(@NotNull @NotNull org.bukkit.entity.Entity travellingEntity, @NotNull @NotNull Portal portal, Portal destination, @NotNull @NotNull org.bukkit.Location exit) Instantiates a new stargate portal event- Parameters:
travellingEntity
-The entity travelling through a portal
portal
-The portal the entity entered from
destination
-The destination the entity should exit from
exit
-The exit location of the destination portal the entity will be teleported to
-
-
Method Details
-
getDestination
Gets the destination portal- Returns:
The destination portal
-
getExit
public org.bukkit.Location getExit()Gets the location the entity is about to be teleported to- Returns:
The location the entity should exit from the portal
-
setExit
public void setExit(@NotNull @NotNull org.bukkit.Location location) Set the location the entity should exit from- Parameters:
location
-The new location the entity should exit from.
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()Gets a handler-list containing all event handlers- Returns:
A handler-list with all event handlers
-
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlers
in classorg.bukkit.event.Event
-