SleepingTimeCheck

Link to sleepingtimecheck

This event is fired when checking if a sleeping player can continue to sleep at a specified time. If has a result which determines the action.

Result:

  • Default, causes the Vanilla logic of World::isDaytime to be consulted.
  • Allow, allows the player to continue sleeping regardless
  • Deny is specifically ignored in this instance and does nothing.

Thus, this event allows you to keep the player sleeping, but it does not allow you to specifically stop them from sleeping.

You will need to cast the event in the function header as this class:
crafttweaker.event.SleepingTimeCheckEvent

You can, of course, also import the class before and use that name then.

Event interface extensions

Link to event-interface-extensions

SleepingTimeCheck Events implement the following interfaces and are able to call all of their methods/getters/setters as well:

ZenGetters/ZenSetters/ZenMethods from extensions

Link to zengetterszensetterszenmethods-from-extensions

The following information can be retrieved/set during the event:

ZenGetterZenSetterType
ZenGetter
result
ZenSetter
Type
string with value of default, deny or allow
ZenGetter
position
ZenSetter
Type
IBlockPos
ZenGetter
x
ZenSetter
Type
int
ZenGetter
y
ZenSetter
Type
int
ZenGetter
z
ZenSetter
Type
int
ZenGetter
player
ZenSetter
Type
IPlayer

ZenMethods

  • event.deny() Method, sets the event's result to deny

  • event.allow() Method, sets the event's result to allow

  • event.default() Method, sets the event's result to default

  • Extensions from extensions

    Link to extensions-from-extensions

The following information can be retrieved/set during the event:

ZenGetterZenSetterType
ZenGetter
entityLivingBase
ZenSetter
Type
IEntityLivingBase