Package io.papermc.paper.event.player
Class AbstractRespawnEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
io.papermc.paper.event.player.AbstractRespawnEvent
- Direct Known Subclasses:
PlayerPostRespawnEvent
,PlayerRespawnEvent
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result
-
Field Summary
FieldsFields inherited from class org.bukkit.event.player.PlayerEvent
player
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractRespawnEvent
(Player respawnPlayer, Location respawnLocation, boolean isBedSpawn, boolean isAnchorSpawn, boolean missingRespawnBlock, PlayerRespawnEvent.RespawnReason respawnReason) -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Gets the current respawn location.Gets the reason this respawn event was called.boolean
Gets whether the respawn location is the player's respawn anchor.boolean
Gets whether the respawn location is the player's bed.boolean
Gets whether the player is missing a valid respawn block.Methods inherited from class org.bukkit.event.player.PlayerEvent
getPlayer
Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, getHandlers, isAsynchronous
-
Field Details
-
respawnLocation
-
-
Constructor Details
-
AbstractRespawnEvent
protected AbstractRespawnEvent(Player respawnPlayer, Location respawnLocation, boolean isBedSpawn, boolean isAnchorSpawn, boolean missingRespawnBlock, PlayerRespawnEvent.RespawnReason respawnReason)
-
-
Method Details
-
getRespawnLocation
Gets the current respawn location.- Returns:
- the current respawn location
-
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
-
isMissingRespawnBlock
public boolean isMissingRespawnBlock()Gets whether the player is missing a valid respawn block.This will occur if the players respawn block is obstructed, or it is the first death after it was either destroyed or in case of a respawn anchor, ran out of charges.
- Returns:
- whether the player is missing a valid respawn block
-
getRespawnReason
Gets the reason this respawn event was called.- Returns:
- the reason the event was called
-
getRespawnFlags
Deprecated.Gets the set of flags that apply to this respawn.- Returns:
- an immutable set of the flags that apply to this respawn
-
getRespawnReason()
/isBedSpawn
/isAnchorSpawn()