Cancellable
public class PlayerPortalEvent extends PlayerTeleportEvent
For other entities see EntityPortalEvent
Event.Result
PlayerTeleportEvent.TeleportCause
Modifier and Type | Field | Description |
---|---|---|
protected TravelAgent |
travelAgent |
|
protected boolean |
useTravelAgent |
player
Constructor | Description |
---|---|
PlayerPortalEvent(Player player,
Location from,
Location to,
TravelAgent pta) |
|
PlayerPortalEvent(Player player,
Location from,
Location to,
TravelAgent pta,
PlayerTeleportEvent.TeleportCause cause) |
Modifier and Type | Method | Description |
---|---|---|
static HandlerList |
getHandlerList() |
|
HandlerList |
getHandlers() |
|
TravelAgent |
getPortalTravelAgent() |
Gets the Travel Agent used (or not) in this event.
|
void |
setPortalTravelAgent(TravelAgent travelAgent) |
Sets the Travel Agent used (or not) in this event.
|
boolean |
useTravelAgent() |
Gets whether or not the Travel Agent will be used.
|
void |
useTravelAgent(boolean useTravelAgent) |
Sets whether or not the Travel Agent will be used.
|
getEventName, isAsynchronous
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPlayer
getFrom, getTo, isCancelled, setCancelled, setFrom, setTo
getCause
protected boolean useTravelAgent
protected TravelAgent travelAgent
public PlayerPortalEvent(Player player, Location from, Location to, TravelAgent pta)
public PlayerPortalEvent(Player player, Location from, Location to, TravelAgent pta, PlayerTeleportEvent.TeleportCause cause)
public void useTravelAgent(boolean useTravelAgent)
If this is set to true, the TravelAgent will try to find a Portal at
the PlayerMoveEvent.getTo()
Location, and will try to create one if there is
none.
If this is set to false, the PlayerEvent.getPlayer()
will only be
teleported to the PlayerMoveEvent.getTo()
Location.
useTravelAgent
- whether to use the Travel Agentpublic boolean useTravelAgent()
If this is set to true, the TravelAgent will try to find a Portal at
the PlayerMoveEvent.getTo()
Location, and will try to create one if there is
none.
If this is set to false, the PlayerEvent.getPlayer()
} will only be
teleported to the PlayerMoveEvent.getTo()
Location.
public TravelAgent getPortalTravelAgent()
public void setPortalTravelAgent(TravelAgent travelAgent)
travelAgent
- the Travel Agent used (or not) in this eventpublic HandlerList getHandlers()
getHandlers
in class PlayerTeleportEvent
public static HandlerList getHandlerList()
Copyright © 2018. All rights reserved.