Class CanPlayerSleepEvent


public class CanPlayerSleepEvent extends PlayerEvent
Called from ServerPlayer.startSleepInBed(BlockPos) when a player attempts to sleep.

This event receives the result of vanilla checking if the sleep attempt is valid, and permits overriding it.

This event is only fired on the logical server.