Package org.bukkit.event.player

# Class PlayerRespawnEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
org.bukkit.event.player.PlayerRespawnEvent

public class PlayerRespawnEvent extends PlayerEvent
Called when a player respawns.

If changing player state, see `PlayerPostRespawnEvent` because the player is "reset" between this event and that event and some changes won't persist.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`PlayerRespawnEvent.RespawnFlag`

## Nested classes/interfaces inherited from class org.bukkit.event.Event

`Event.Result`

## Field Summary

### Fields inherited from class org.bukkit.event.player.PlayerEvent

`player`

## Constructor Summary

Constructors
Constructor
Description
`PlayerRespawnEvent(@NotNull Player respawnPlayer, @NotNull Location respawnLocation, boolean isBedSpawn)`
Deprecated.
`PlayerRespawnEvent(@NotNull Player respawnPlayer, @NotNull Location respawnLocation, boolean isBedSpawn, boolean isAnchorSpawn)`
Deprecated.
`PlayerRespawnEvent(@NotNull Player respawnPlayer, @NotNull Location respawnLocation, boolean isBedSpawn, boolean isAnchorSpawn, ImmutableSet.Builder<PlayerRespawnEvent.RespawnFlag> respawnFlags)`

## Method Summary

Modifier and Type
Method
Description
`static @NotNull HandlerList`
`getHandlerList()`
`@NotNull HandlerList`
`getHandlers()`
`Set<PlayerRespawnEvent.RespawnFlag>`
`getRespawnFlags()`
Get the set of flags that apply to this respawn.
`@NotNull Location`
`getRespawnLocation()`
Gets the current respawn location
`boolean`
`isAnchorSpawn()`
Gets whether the respawn location is the player's respawn anchor.
`boolean`
`isBedSpawn()`
Gets whether the respawn location is the player's bed.
`void`
`setRespawnLocation(@NotNull Location respawnLocation)`
Sets the new respawn location

### Methods inherited from class org.bukkit.event.player.PlayerEvent

`getPlayer`

### Methods inherited from class org.bukkit.event.Event

`callEvent, getEventName, isAsynchronous`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### PlayerRespawnEvent

@Deprecated public PlayerRespawnEvent(@NotNull @NotNull Player respawnPlayer, @NotNull @NotNull Location respawnLocation, boolean isBedSpawn)
Deprecated.

### PlayerRespawnEvent

@Deprecated public PlayerRespawnEvent(@NotNull @NotNull Player respawnPlayer, @NotNull @NotNull Location respawnLocation, boolean isBedSpawn, boolean isAnchorSpawn)
Deprecated.

### PlayerRespawnEvent

public PlayerRespawnEvent(@NotNull @NotNull Player respawnPlayer, @NotNull @NotNull Location respawnLocation, boolean isBedSpawn, boolean isAnchorSpawn, @NotNull ImmutableSet.Builder<PlayerRespawnEvent.RespawnFlag> respawnFlags)

## Method Details

### getRespawnLocation

@NotNull public @NotNull Location getRespawnLocation()
Gets the current respawn location

Returns:
  Location current respawn location

### setRespawnLocation

public void setRespawnLocation(@NotNull @NotNull Location respawnLocation)
Sets the new respawn location

Parameters:
  `respawnLocation` - new location for the respawn

### isBedSpawn

public boolean isBedSpawn()
Gets whether the respawn location is the player's bed.

Returns:
  true if the respawn location is the player's bed.

### isAnchorSpawn

public boolean isAnchorSpawn()
Gets whether the respawn location is the player's respawn anchor.

Returns:
  true if the respawn location is the player's respawn anchor.

### getHandlers

@NotNull public @NotNull HandlerList getHandlers()

Specified by:
  `getHandlers` in class `Event`

### getHandlerList

@NotNull public static @NotNull HandlerList getHandlerList()

### getRespawnFlags

@NotNull public Set<PlayerRespawnEvent.RespawnFlag> getRespawnFlags()
Get the set of flags that apply to this respawn.

Returns:
  an immutable set of the flags that apply to this respawn