Package org.bukkit.event.entity
Class EntityPortalEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.entity.EntityEvent
org.bukkit.event.entity.EntityTeleportEvent
org.bukkit.event.entity.EntityPortalEvent
- All Implemented Interfaces:
Cancellable
public class EntityPortalEvent extends EntityTeleportEvent
Called when a non-player entity is about to teleport because it is in
contact with a portal.
For players see PlayerPortalEvent
-
Nested Class Summary
-
Field Summary
Fields Modifier and Type Field Description protected TravelAgenttravelAgentprotected booleanuseTravelAgent -
Constructor Summary
Constructors Constructor Description EntityPortalEvent(Entity entity, Location from, Location to, TravelAgent pta) -
Method Summary
Modifier and Type Method Description static HandlerListgetHandlerList()HandlerListgetHandlers()TravelAgentgetPortalTravelAgent()Gets the Travel Agent used (or not) in this event.voidsetPortalTravelAgent(TravelAgent travelAgent)Sets the Travel Agent used (or not) in this event.booleanuseTravelAgent()Gets whether or not the Travel Agent will be used.voiduseTravelAgent(boolean useTravelAgent)Sets whether or not the Travel Agent will be used.Methods inherited from class org.bukkit.event.entity.EntityTeleportEvent
getFrom, getTo, isCancelled, setCancelled, setFrom, setTo
-
Field Details
-
useTravelAgent
protected boolean useTravelAgent -
travelAgent
-
-
Constructor Details
-
Method Details
-
useTravelAgent
public void useTravelAgent(boolean useTravelAgent)Sets whether or not the Travel Agent will be used.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 theEntityTeleportEvent.getTo()Location.- Parameters:
useTravelAgent- whether to use the Travel Agent
-
useTravelAgent
public boolean useTravelAgent()Gets whether or not the Travel Agent will be used.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 theEntityTeleportEvent.getTo()Location.- Returns:
- whether to use the Travel Agent
-
getPortalTravelAgent
Gets the Travel Agent used (or not) in this event.- Returns:
- the Travel Agent used (or not) in this event
-
setPortalTravelAgent
Sets the Travel Agent used (or not) in this event.- Parameters:
travelAgent- the Travel Agent used (or not) in this event
-
getHandlers
- Overrides:
getHandlersin classEntityTeleportEvent
-
getHandlerList
-