Class NationSpawnEvent
java.lang.Object
org.bukkit.event.Event
com.palmergames.bukkit.towny.event.CancellableTownyEvent
com.palmergames.bukkit.towny.event.SpawnEvent
com.palmergames.bukkit.towny.event.NationSpawnEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
An event called when nation 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
ConstructorsConstructorDescriptionNationSpawnEvent(org.bukkit.entity.Player player, org.bukkit.Location from, org.bukkit.Location to, double cost, boolean cancelled, String cancelMessage) Called when a player is teleported to a nation. -
Method Summary
Modifier and TypeMethodDescription@Nullable NationGets the nation the player is spawning from.static org.bukkit.event.HandlerList@NotNull org.bukkit.event.HandlerListGets the nation that the player to spawning to.Methods inherited from class SpawnEvent
getCost, getFrom, getPlayer, getToMethods inherited from class CancellableTownyEvent
getCancelMessage, isCancelled, setCancelled, setCancelMessageMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
NationSpawnEvent
public NationSpawnEvent(org.bukkit.entity.Player player, org.bukkit.Location from, org.bukkit.Location to, double cost, boolean cancelled, String cancelMessage) Called when a player is teleported to a nation.- Parameters:
player- The player being teleported.from- The location the player is teleporting from.to- The location the player is going to.
-
-
Method Details
-
getToNation
Gets the nation that the player to spawning to.- Returns:
- The nation being spawned to.
-
getFromNation
Gets the nation the player is spawning from.- Returns:
- null if the player is not standing in a nation owned townblock, the nation otherwise.
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList() -
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()- Overrides:
getHandlersin classSpawnEvent
-