Class SleepFinishedTimeEvent

java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.world.WorldEvent
net.minecraftforge.event.world.SleepFinishedTimeEvent

public class SleepFinishedTimeEvent extends WorldEvent
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.
  • Nested Class Summary

    Nested classes/interfaces inherited from class net.minecraftforge.event.world.WorldEvent

    WorldEvent.CreateSpawnPosition, WorldEvent.Load, WorldEvent.Save, WorldEvent.Unload

    Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event

    net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private long
     
    private long
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    SleepFinishedTimeEvent​(ServerLevel worldIn, long newTimeIn, long minTimeIn)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    long
     
    boolean
    setTimeAddition​(long newTimeIn)
    Sets the new time which should be set when all players wake up

    Methods inherited from class net.minecraftforge.event.world.WorldEvent

    getWorld

    Methods inherited from class net.minecraftforge.eventbus.api.Event

    getListenerList, getParentListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult, setup

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • newTime

      private long newTime
    • minTime

      private final long minTime
  • Constructor Details

    • SleepFinishedTimeEvent

      public SleepFinishedTimeEvent(ServerLevel worldIn, long newTimeIn, long minTimeIn)
  • 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