public static interface SleepingEvent.Post extends SleepingEvent, Cancellable
SleepingEvent.Finish, SleepingEvent.Post, SleepingEvent.Pre, SleepingEvent.Tick
Modifier and Type | Method and Description |
---|---|
Optional<Transform<World>> |
getSpawnTransform()
Gets a copy of the spawn transform of the human when leaving the bed.
|
void |
setSpawnTransform(Transform<World> transform)
Sets the new spawn transform of the human leaving the bed.
|
boolean |
wasSpawnSet()
Gets whether the spawn transform for the human was set.
|
getBed
getTargetEntity
getCallbacks
getCause
isCancelled, setCancelled
boolean wasSpawnSet()
The case that spawn may have not been set includes:
Optional<Transform<World>> getSpawnTransform()
This may have not been set by the event, so checking
wasSpawnSet()
is advisable. If spawn has not been set,
it will return Optional.absent()
.
void setSpawnTransform(Transform<World> transform)
If spawn wasSpawnSet()
was not infact set by this event,
this does not override the return value. The given spawn should be
a valid location.
transform
- The new spawn transform for the human