SleepingLocationCheck

Link to sleepinglocationcheck

This event is fired when checking if a sleeping player can continue to sleep in the current location. If has a result which determines the action.

Result:

  • Default, returns the default Vanilla response as found in the Bed tile entity
  • 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 bypass the default bed logic.

You will need to cast the event in the function header as this class:
crafttweaker.event.SleepingLocationCheck
You can, of course, also import the class before and use that name then.

Event interface extensions

Link to event-interface-extensions

SleepingLocationCheck 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