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

@NullMarked public abstract class AbstractRespawnEvent extends PlayerEvent
  • Field Details

    • respawnLocation

      protected Location respawnLocation
  • Constructor Details

  • Method Details

    • getRespawnLocation

      public Location 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

      public PlayerRespawnEvent.RespawnReason getRespawnReason()
      Gets the reason this respawn event was called.
      Returns:
      the reason the event was called
    • getRespawnFlags

      Deprecated.
      in favour of getRespawnReason()/isBedSpawn/isAnchorSpawn()
      Gets the set of flags that apply to this respawn.
      Returns:
      an immutable set of the flags that apply to this respawn