Package net.ess3.api.events
Class UserTeleportHomeEvent
java.lang.Object
org.bukkit.event.Event
net.ess3.api.events.UserTeleportHomeEvent
- All Implemented Interfaces:
Cancellable
Called when a user is teleported home via the /home command.
This is called before TeleportWarmupEvent
.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
The type of home location.Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result
-
Constructor Summary
ConstructorDescriptionUserTeleportHomeEvent
(IUser user, String homeName, Location target, UserTeleportHomeEvent.HomeType homeType) -
Method Summary
Modifier and TypeMethodDescriptionstatic HandlerList
Returns the location the user is teleporting to.Returns the name of the home being teleported to.Returns the home location type.getUser()
Returns the user who is being teleportedboolean
void
setCancelled
(boolean cancelled) Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
UserTeleportHomeEvent
public UserTeleportHomeEvent(IUser user, String homeName, Location target, UserTeleportHomeEvent.HomeType homeType)
-
-
Method Details
-
getHandlerList
-
getUser
Returns the user who is being teleported- Returns:
- The teleportee.
-
getHomeName
Returns the name of the home being teleported to.The behavior of this method varies based on the
UserTeleportHomeEvent.HomeType
as follows;UserTeleportHomeEvent.HomeType.HOME
- Returns name of home being teleported to.UserTeleportHomeEvent.HomeType.BED
- Returns "bed".UserTeleportHomeEvent.HomeType.SPAWN
- Returns null.- Returns:
- Name of home being teleported to, or null if the user had no homes set.
-
getHomeLocation
Returns the location the user is teleporting to.- Returns:
- Teleportation destination location.
-
getHomeType
Returns the home location type.UserTeleportHomeEvent.HomeType.HOME
- A user-set home location.UserTeleportHomeEvent.HomeType.BED
- A user's bed location.UserTeleportHomeEvent.HomeType.SPAWN
- The user's current world spawn.- Returns:
- Home location type.
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelled
in interfaceCancellable
-
setCancelled
public void setCancelled(boolean cancelled) - Specified by:
setCancelled
in interfaceCancellable
-
getHandlers
- Specified by:
getHandlers
in classEvent
-