Class PlayerRespawnEvent

java.lang.Object
fr.fidorial.event.player.PlayerRespawnEvent
All Implemented Interfaces:
Event, PlayerEvent

public final class PlayerRespawnEvent extends Object implements PlayerEvent
Fired when a dead player clicks respawn, before they are placed back in the world.
Since:
0.1.0
  • Constructor Details

    • PlayerRespawnEvent

      public PlayerRespawnEvent(Player player, World world, Location location, PlayerRespawnEvent.Cause cause, boolean usedRespawnPoint)
      Creates an event.
      Parameters:
      player - the player about to respawn
      world - the world they are about to respawn in
      location - the position they are about to respawn at
      cause - what triggered the respawn
      usedRespawnPoint - whether the position comes from the player's respawn point
      Since:
      0.1.0
  • Method Details

    • player

      @Contract(pure=true) public Player player()
      Description copied from interface: PlayerEvent
      Returns the player involved in this event.
      Specified by:
      player in interface PlayerEvent
      Returns:
      the player involved in this event
    • world

      @Contract(pure=true) public World world()
      Returns:
      the world the player is about to respawn in
    • location

      @Contract(pure=true) public Location location()
      Returns:
      the position the player is about to respawn at
    • cause

      public PlayerRespawnEvent.Cause cause()
      Returns:
      what triggered this respawn
      Since:
      0.1.0
    • usedRespawnPoint

      public boolean usedRespawnPoint()
      Returns:
      true when the position comes from the player's respawn point, false when it is the world spawn
      Since:
      0.1.0
    • setRespawnLocation

      public void setRespawnLocation(World world, Location location)
      Parameters:
      world - the world to respawn in instead
      location - the position to respawn at instead
    • setRespawnLocation

      public void setRespawnLocation(Location location)
      Parameters:
      location - the position to respawn at instead, in the same world
    • setRespawnLocation

      public void setRespawnLocation(RespawnPoint point)
      Parameters:
      point - the point to respawn at instead
      Since:
      0.1.0