类 SleepingTimeCheckEvent


public class SleepingTimeCheckEvent extends PlayerEvent
This event is fired when the game checks if players can sleep at this time.
Failing this check will cause sleeping players to wake up and prevent awake players from sleeping.
This event has a result. Event.HasResult
setResult(ALLOW) informs game that player can sleep at this time.
setResult(DEFAULT) causes game to check !Level.isDay() instead.
  • 字段详细资料

  • 构造器详细资料

  • 方法详细资料

    • getSleepingLocation

      public Optional<BlockPos> getSleepingLocation()
      Note that the sleeping location may be an approximated one.
      返回:
      The player's sleeping location.