Class PlayerSpawnLocationEvent


  • public class PlayerSpawnLocationEvent
    extends PlayerEvent
    Called when player is about to spawn in a world after joining the server.
    • Constructor Detail

      • PlayerSpawnLocationEvent

        public PlayerSpawnLocationEvent​(@NotNull
                                        Player who,
                                        @NotNull
                                        Location spawnLocation)
    • Method Detail

      • getSpawnLocation

        @NotNull
        public Location getSpawnLocation()
        Gets player's spawn location. If the player OfflinePlayer.hasPlayedBefore(), it's going to default to the location inside player.dat file. For new players, the default spawn location is spawn of the main Bukkit world.
        Returns:
        the spawn location
      • setSpawnLocation

        public void setSpawnLocation​(@NotNull
                                     Location location)
        Sets player's spawn location.
        Parameters:
        location - the spawn location
      • getHandlerList

        @NotNull
        public static HandlerList getHandlerList()