Class PlayerBedLeaveEvent

All Implemented Interfaces:
Cancellable

public class PlayerBedLeaveEvent extends PlayerEvent implements Cancellable
This event is fired when the player is leaving a bed.
  • Constructor Details

  • Method Details

    • getBed

      @NotNull public @NotNull Block getBed()
      Returns the bed block involved in this event.
      Returns:
      the bed block involved in this event
    • shouldSetSpawnLocation

      @Deprecated(forRemoval=true) public boolean shouldSetSpawnLocation()
      Deprecated, for removal: This API element is subject to removal in a future version.
      the respawn point is now set when the player enter the bed and this option doesn't work since MC 1.15.
      Get if this event should set the new spawn location for the Player.
      This does not remove any existing spawn location, only prevent it from being changed (if true).
      To change a Player's spawn location, use Player.setBedSpawnLocation(Location).
      Returns:
      true if the spawn location will be changed
    • setSpawnLocation

      @Deprecated(forRemoval=true) public void setSpawnLocation(boolean setBedSpawn)
      Deprecated, for removal: This API element is subject to removal in a future version.
      the respawn point is now set when the player enter the bed and this option doesn't work since MC 1.15.
      Set if this event should set the new spawn location for the Player.
      This will not remove any existing spawn location, only prevent it from being changed (if true).
      To change a Player's spawn location, use Player.setBedSpawnLocation(Location).
      Parameters:
      setBedSpawn - true to change the new spawn location
    • isCancelled

      public boolean isCancelled()
      Description copied from interface: Cancellable
      Gets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins
      Specified by:
      isCancelled in interface Cancellable
      Returns:
      true if this event is cancelled
    • setCancelled

      public void setCancelled(boolean cancelled)
      Description copied from interface: Cancellable
      Sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.
      Specified by:
      setCancelled in interface Cancellable
      Parameters:
      cancelled - true if you wish to cancel this event
    • getHandlers

      @NotNull public @NotNull HandlerList getHandlers()
      Specified by:
      getHandlers in class Event
    • getHandlerList

      @NotNull public static @NotNull HandlerList getHandlerList()