Class CanPlayerSleepEvent


public class CanPlayerSleepEvent extends PlayerEvent

Fired when a player initially attempts to sleep. This can be used by mods to supplement or replace the vanilla logic for whether a sleep attempt is valid.

Mods which provide a AbstractBedBlock without the FACING property will almost always need to use this event to provide their own logic, because the vanilla logic is modified to assume success for those blocks.

This event is not cancellable.

This event is fired on the game event bus, only on the logical server.

See Also: