Class TownSpawnEvent
java.lang.Object
org.bukkit.event.Event
com.palmergames.bukkit.towny.event.CancellableTownyEvent
com.palmergames.bukkit.towny.event.SpawnEvent
com.palmergames.bukkit.towny.event.TownSpawnEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
An event called when town spawns occur.
- Author:
- Suneet Tipirneni (Siris)
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result
-
Constructor Summary
ConstructorDescriptionTownSpawnEvent
(org.bukkit.entity.Player player, org.bukkit.Location from, org.bukkit.Location to, boolean cancelled, String cancelMessage) -
Method Summary
Modifier and TypeMethodDescription@Nullable Town
Gets the town being teleported from.Gets the town that the player is teleporting to.Methods inherited from class com.palmergames.bukkit.towny.event.SpawnEvent
getFrom, getHandlerList, getHandlers, getPlayer, getTo
Methods inherited from class com.palmergames.bukkit.towny.event.CancellableTownyEvent
getCancelMessage, isCancelled, setCancelled, setCancelMessage
Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
TownSpawnEvent
public TownSpawnEvent(org.bukkit.entity.Player player, org.bukkit.Location from, org.bukkit.Location to, boolean cancelled, String cancelMessage)
-
-
Method Details
-
getToTown
Gets the town that the player is teleporting to.- Returns:
- The Town being teleported to.
-
getFromTown
Gets the town being teleported from.- Returns:
- null if the player was not standing in a townblock, the town they were standing in otherwise.
-