Class PlayerSleepInBedEvent

public class PlayerSleepInBedEvent extends PlayerEvent
PlayerSleepInBedEvent is fired when a player sleeps in a bed.
This event is fired whenever a player sleeps in a bed in EntityPlayer#trySleep(BlockPos).

result contains whether the player is able to sleep.

This event does not have a result. Event.HasResult
This event is fired on the MinecraftForge.EVENT_BUS.