Class SleepFinishedTimeEvent

java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.level.LevelEvent
net.minecraftforge.event.level.SleepFinishedTimeEvent

public class SleepFinishedTimeEvent extends LevelEvent
This event is fired when all players are asleep and the time should be set to day.
setWakeUpTime(wakeUpTime) sets a new time that will be added to the dayTime.
  • Field Details

    • newTime

      private long newTime
    • minTime

      private final long minTime
  • Constructor Details

    • SleepFinishedTimeEvent

      public SleepFinishedTimeEvent(ServerLevel level, long newTime, long minTime)
  • Method Details

    • getNewTime

      public long getNewTime()
      Returns:
      the new time
    • setTimeAddition

      public boolean setTimeAddition(long newTimeIn)
      Sets the new time which should be set when all players wake up
      Parameters:
      newTimeIn - The new time at wakeup
      Returns:
      false if newTimeIn was lower than current time