Class SpawnEvent
java.lang.Object
org.bukkit.event.Event
com.palmergames.bukkit.towny.event.CancellableTownyEvent
com.palmergames.bukkit.towny.event.SpawnEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
- Direct Known Subclasses:
NationSpawnEvent, ResidentSpawnEvent, TownSpawnEvent
A class which provides the basis for spawn events.
- Author:
- Suneet Tipirneni (Siris)
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionSpawnEvent(org.bukkit.entity.Player player, org.bukkit.Location from, org.bukkit.Location to, double cost) Creates a Spawn event. -
Method Summary
Modifier and TypeMethodDescriptiondoublegetCost()Gets the cost that the player has paid to teleport.org.bukkit.LocationgetFrom()Gets the location from which the player is teleporting from.static org.bukkit.event.HandlerList@NotNull org.bukkit.event.HandlerListorg.bukkit.entity.PlayerGets the player whom is teleporting.org.bukkit.LocationgetTo()Gets the location to which the player is teleporting to.Methods inherited from class CancellableTownyEvent
getCancelMessage, getCancelTranslatable, isCancelled, setCancelled, setCancelMessage, setCancelMessageMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
SpawnEvent
public SpawnEvent(org.bukkit.entity.Player player, org.bukkit.Location from, org.bukkit.Location to, double cost) Creates a Spawn event.- Parameters:
player- The player spawning.from- The from location.to- The to location.cost- The amount paid to teleport.
-
-
Method Details
-
getFrom
public org.bukkit.Location getFrom()Gets the location from which the player is teleporting from.- Returns:
- The location being teleported from.
-
getTo
public org.bukkit.Location getTo()Gets the location to which the player is teleporting to.- Returns:
- The location being teleported to.
-
getPlayer
public org.bukkit.entity.Player getPlayer()Gets the player whom is teleporting.- Returns:
- The player teleporting.
-
getCost
public double getCost()Gets the cost that the player has paid to teleport.- Returns:
- the cost as a double.
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList() -
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlersin classorg.bukkit.event.Event
-