public class PlayerSleepInBedEvent extends PlayerEvent
EntityPlayer#trySleep(BlockPos)
.result
contains whether the player is able to sleep. Cancelable
.
HasResult
MinecraftForge.EVENT_BUS
.PlayerEvent.BreakSpeed, PlayerEvent.Clone, PlayerEvent.HarvestCheck, PlayerEvent.ItemCraftedEvent, PlayerEvent.ItemPickupEvent, PlayerEvent.ItemSmeltedEvent, PlayerEvent.LoadFromFile, PlayerEvent.NameFormat, PlayerEvent.PlayerChangedDimensionEvent, PlayerEvent.PlayerLoggedInEvent, PlayerEvent.PlayerLoggedOutEvent, PlayerEvent.PlayerRespawnEvent, PlayerEvent.SaveToFile, PlayerEvent.StartTracking, PlayerEvent.StopTracking, PlayerEvent.Visibility
LivingEvent.LivingJumpEvent, LivingEvent.LivingUpdateEvent
EntityEvent.CanUpdate, EntityEvent.EnteringChunk, EntityEvent.EntityConstructing, EntityEvent.EyeHeight
Modifier and Type | Field and Description |
---|---|
private java.util.Optional<BlockPos> |
pos |
private PlayerEntity.SleepResult |
result |
Constructor and Description |
---|
PlayerSleepInBedEvent(PlayerEntity player,
java.util.Optional<BlockPos> pos) |
Modifier and Type | Method and Description |
---|---|
java.util.Optional<BlockPos> |
getOptionalPos() |
BlockPos |
getPos() |
PlayerEntity.SleepResult |
getResultStatus() |
void |
setResult(PlayerEntity.SleepResult result) |
getPlayer
getEntityLiving
getEntity
private PlayerEntity.SleepResult result
private final java.util.Optional<BlockPos> pos
public PlayerSleepInBedEvent(PlayerEntity player, java.util.Optional<BlockPos> pos)
public PlayerEntity.SleepResult getResultStatus()
public void setResult(PlayerEntity.SleepResult result)
public BlockPos getPos()
public java.util.Optional<BlockPos> getOptionalPos()