Package org.bukkit.event.player
Class PlayerPortalEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
org.bukkit.event.player.PlayerMoveEvent
org.bukkit.event.player.PlayerTeleportEvent
org.bukkit.event.player.PlayerPortalEvent
- All Implemented Interfaces:
Cancellable
public class PlayerPortalEvent extends PlayerTeleportEvent
Called when a player is about to teleport because it is in contact with a
portal.
For other entities see EntityPortalEvent
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.player.PlayerTeleportEvent
PlayerTeleportEvent.TeleportCause -
Field Summary
-
Constructor Summary
Constructors Constructor Description PlayerPortalEvent(Player player, Location from, Location to)PlayerPortalEvent(Player player, Location from, Location to, PlayerTeleportEvent.TeleportCause cause)PlayerPortalEvent(Player player, Location from, Location to, PlayerTeleportEvent.TeleportCause cause, int getSearchRadius, boolean canCreatePortal, int creationRadius) -
Method Summary
Modifier and Type Method Description booleangetCanCreatePortal()Returns whether the server will attempt to create a destination portal or not.intgetCreationRadius()Gets the maximum radius the world is searched for a free space from the given location.static HandlerListgetHandlerList()HandlerListgetHandlers()intgetSearchRadius()Gets the search radius value for finding an available portal.voidsetCanCreatePortal(boolean canCreatePortal)Deprecated.not currently functionalvoidsetCreationRadius(int creationRadius)Deprecated.not currently functionalvoidsetSearchRadius(int searchRadius)Deprecated.not currently functionalMethods inherited from class org.bukkit.event.player.PlayerMoveEvent
getFrom, getTo, isCancelled, setCancelled, setFrom, setTo
-
Constructor Details
-
Method Details
-
setSearchRadius
Deprecated.not currently functionalSet the Block radius to search in for available portals.- Parameters:
searchRadius- the radius in which to search for a portal from the location
-
getSearchRadius
public int getSearchRadius()Gets the search radius value for finding an available portal.- Returns:
- the currently set search radius
-
getCanCreatePortal
public boolean getCanCreatePortal()Returns whether the server will attempt to create a destination portal or not.- Returns:
- whether there should create be a destination portal created
-
setCanCreatePortal
Deprecated.not currently functionalSets whether the server should attempt to create a destination portal or not.- Parameters:
canCreatePortal- Sets whether there should be a destination portal created
-
setCreationRadius
Deprecated.not currently functionalSets the maximum radius the world is searched for a free space from the given location. If enough free space is found then the portal will be created there, if not it will force create with air-space at the target location. Does not apply to end portal target platforms which will always appear at the target location.- Parameters:
creationRadius- the radius in which to create a portal from the location
-
getCreationRadius
public int getCreationRadius()Gets the maximum radius the world is searched for a free space from the given location. If enough free space is found then the portal will be created there, if not it will force create with air-space at the target location. Does not apply to end portal target platforms which will always appear at the target location.- Returns:
- the currently set creation radius
-
getHandlers
- Overrides:
getHandlersin classPlayerTeleportEvent
-
getHandlerList
-