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
Called when a player is about to teleport because it is in contact with a
 portal which will generate an exit portal.
 
 For other entities see EntityPortalEvent
- 
Nested Class SummaryNested classes/interfaces inherited from class org.bukkit.event.player.PlayerTeleportEventPlayerTeleportEvent.TeleportCauseNested classes/interfaces inherited from class org.bukkit.event.EventEvent.Result
- 
Field SummaryFields inherited from class org.bukkit.event.player.PlayerEventplayer
- 
Constructor SummaryConstructorsConstructorDescriptionPlayerPortalEvent(@NotNull Player player, @NotNull Location from, @Nullable Location to, @NotNull PlayerTeleportEvent.TeleportCause cause) PlayerPortalEvent(@NotNull Player player, @NotNull Location from, @Nullable Location to, @NotNull PlayerTeleportEvent.TeleportCause cause, int getSearchRadius, boolean canCreatePortal, int creationRadius) 
- 
Method SummaryModifier and TypeMethodDescriptionbooleanReturns whether the server will attempt to create a destination portal or not.intGets the maximum radius the world is searched for a free space from the given location.static @NotNull HandlerListDeprecated.No effectintGets the search radius value for finding an available portal.getTo()ForPlayerTeleportEvent.TeleportCause.NETHER_PORTAL, this is initially just the starting point for the search for a portal to teleport to.voidsetCanCreatePortal(boolean canCreatePortal) Sets whether the server should attempt to create a destination portal or not.voidsetCreationRadius(int creationRadius) Sets the maximum radius the world is searched for a free space from the given location.voidsetSearchRadius(int searchRadius) Set the Block radius to search in for available portals.voidSee the description ofgetTo().booleanDeprecated.No effectMethods inherited from class org.bukkit.event.player.PlayerTeleportEventgetCauseMethods inherited from class org.bukkit.event.player.PlayerMoveEventgetFrom, hasChangedBlock, hasChangedOrientation, hasChangedPosition, hasExplicitlyChangedBlock, hasExplicitlyChangedPosition, isCancelled, setCancelled, setFromMethods inherited from class org.bukkit.event.player.PlayerEventgetPlayerMethods inherited from class org.bukkit.event.EventcallEvent, getEventName, isAsynchronous
- 
Constructor Details- 
PlayerPortalEvent
- 
PlayerPortalEvent
- 
PlayerPortalEvent
 
- 
- 
Method Details- 
getToForPlayerTeleportEvent.TeleportCause.NETHER_PORTAL, this is initially just the starting point for the search for a portal to teleport to. It will initially just be thePlayerMoveEvent.getFrom()scaled for dimension scaling and clamped to be inside the world border.For PlayerTeleportEvent.TeleportCause.END_PORTAL, this will initially be the exact destination either, the world spawn for end->any world or end spawn for any world->end.- Overrides:
- getToin class- PlayerMoveEvent
- Returns:
- starting point for search or exact destination
 
- 
setToSee the description ofgetTo().- Overrides:
- setToin class- PlayerMoveEvent
- Parameters:
- to- starting point for search or exact destination
 
- 
willDismountPlayerDeprecated.No effectNo effect- Overrides:
- willDismountPlayerin class- PlayerTeleportEvent
- Returns:
- no effect
 
- 
getRelativeTeleportationFlagsDeprecated.No effectNo effect- Overrides:
- getRelativeTeleportationFlagsin class- PlayerTeleportEvent
- Returns:
- no effect
 
- 
setSearchRadiuspublic void setSearchRadius(int searchRadius) Set the Block radius to search in for available portals.- Parameters:
- searchRadius- the radius in which to search for a portal from the location
 
- 
getSearchRadiuspublic int getSearchRadius()Gets the search radius value for finding an available portal.- Returns:
- the currently set search radius
 
- 
getCanCreatePortalpublic 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
 
- 
setCanCreatePortalpublic void setCanCreatePortal(boolean canCreatePortal) Sets whether the server should attempt to create a destination portal or not.- Parameters:
- canCreatePortal- Sets whether there should be a destination portal created
 
- 
setCreationRadiuspublic void setCreationRadius(int creationRadius) Sets 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
 
- 
getCreationRadiuspublic 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 class- PlayerTeleportEvent
 
- 
getHandlerList
 
-