Class PlayerBedLeaveEvent


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

      • PlayerBedLeaveEvent

        public PlayerBedLeaveEvent​(@NotNull
                                   @NotNull Player who,
                                   @NotNull
                                   @NotNull Block bed,
                                   boolean setBedSpawn)
    • Method Detail

      • getBed

        @NotNull
        public @NotNull 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 HumanEntity.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 HumanEntity.setBedSpawnLocation(Location).
        Parameters:
        setBedSpawn - true to change the new spawn location
      • getHandlerList

        @NotNull
        public static @NotNull HandlerList getHandlerList()