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 Block getBed()
      Returns the bed block involved in this event.
      Returns:
      the bed block involved in this event
    • shouldSetSpawnLocation

      public boolean shouldSetSpawnLocation()
      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

      public void setSpawnLocation(boolean setBedSpawn)
      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 HandlerList getHandlers()
      Specified by:
      getHandlers in class Event
    • getHandlerList

      @NotNull public static HandlerList getHandlerList()