Cancellablepublic class EntityPortalEvent extends EntityTeleportEvent
For players see PlayerPortalEvent
Event.Result| Modifier and Type | Field | Description |
|---|---|---|
protected TravelAgent |
travelAgent |
|
protected boolean |
useTravelAgent |
entity| Constructor | Description |
|---|---|
EntityPortalEvent(Entity entity,
Location from,
Location to,
TravelAgent pta) |
| 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.
|
getEntity, getEntityTypegetFrom, getTo, isCancelled, setCancelled, setFrom, setTocallEvent, getEventName, isAsynchronousprotected boolean useTravelAgent
protected TravelAgent travelAgent
public EntityPortalEvent(@NotNull
Entity entity,
@NotNull
Location from,
@Nullable
Location to,
@NotNull
TravelAgent pta)
public void useTravelAgent(boolean useTravelAgent)
If this is set to true, the TravelAgent will try to find a Portal at
the EntityTeleportEvent.getTo() Location, and will try to create one if there is
none.
If this is set to false, the EntityEvent.getEntity() will only be
teleported to the EntityTeleportEvent.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 EntityTeleportEvent.getTo() Location, and will try to create one if there is
none.
If this is set to false, the EntityEvent.getEntity() will only be
teleported to the EntityTeleportEvent.getTo() Location.
@NotNull public TravelAgent getPortalTravelAgent()
public void setPortalTravelAgent(@NotNull
TravelAgent travelAgent)
travelAgent - the Travel Agent used (or not) in this event@NotNull public HandlerList getHandlers()
getHandlers in class EntityTeleportEvent@NotNull public static HandlerList getHandlerList()
Copyright © 2020. All rights reserved.