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.
|
boolean |
isSpawnSet()
Gets whether the spawn transform for the human was set.
|
void |
setSpawnTransform(Transform<World> transform)
Sets the new spawn transform of the human leaving the bed.
|
getBed
getTargetEntity
getCause, getContext, getSource
isCancelled, setCancelled
boolean isSpawnSet()
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
isSpawnSet()
is advisable. If spawn has not been set,
it will return Optional.empty()
.
void setSpawnTransform(Transform<World> transform)
If spawn isSpawnSet()
was not in fact 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