Class PlayerSleepInBedEvent
- java.lang.Object
-
- net.minecraftforge.eventbus.api.Event
-
- net.minecraftforge.event.entity.EntityEvent
-
- net.minecraftforge.event.entity.living.LivingEvent
-
- net.minecraftforge.event.entity.player.PlayerEvent
-
- net.minecraftforge.event.entity.player.PlayerSleepInBedEvent
-
public class PlayerSleepInBedEvent extends PlayerEvent
PlayerSleepInBedEvent is fired when a player sleeps in a bed.
This event is fired whenever a player sleeps in a bed inEntityPlayer#trySleep(BlockPos)
.
result
contains whether the player is able to sleep.
This event does not have a result.Event.HasResult
This event is fired on theMinecraftForge.EVENT_BUS
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.player.PlayerEvent
PlayerEvent.BreakSpeed, PlayerEvent.Clone, PlayerEvent.HarvestCheck, PlayerEvent.ItemCraftedEvent, PlayerEvent.ItemPickupEvent, PlayerEvent.ItemSmeltedEvent, PlayerEvent.LoadFromFile, PlayerEvent.NameFormat, PlayerEvent.PlayerChangedDimensionEvent, PlayerEvent.PlayerChangeGameModeEvent, PlayerEvent.PlayerLoggedInEvent, PlayerEvent.PlayerLoggedOutEvent, PlayerEvent.PlayerRespawnEvent, PlayerEvent.SaveToFile, PlayerEvent.StartTracking, PlayerEvent.StopTracking, PlayerEvent.TabListNameFormat, PlayerEvent.Visibility
-
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.living.LivingEvent
LivingEvent.LivingJumpEvent, LivingEvent.LivingUpdateEvent, LivingEvent.LivingVisibilityEvent
-
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.EntityEvent
EntityEvent.CanUpdate, EntityEvent.EnteringChunk, EntityEvent.EntityConstructing, EntityEvent.Size
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Optional<BlockPos>
pos
private PlayerEntity.SleepResult
result
-
Constructor Summary
Constructors Constructor Description PlayerSleepInBedEvent(PlayerEntity player, java.util.Optional<BlockPos> pos)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<BlockPos>
getOptionalPos()
BlockPos
getPos()
PlayerEntity.SleepResult
getResultStatus()
void
setResult(PlayerEntity.SleepResult result)
-
Methods inherited from class net.minecraftforge.event.entity.player.PlayerEvent
getPlayer
-
Methods inherited from class net.minecraftforge.event.entity.living.LivingEvent
getEntityLiving
-
Methods inherited from class net.minecraftforge.event.entity.EntityEvent
getEntity
-
-
-
-
Field Detail
-
result
private PlayerEntity.SleepResult result
-
pos
private final java.util.Optional<BlockPos> pos
-
-
Constructor Detail
-
PlayerSleepInBedEvent
public PlayerSleepInBedEvent(PlayerEntity player, java.util.Optional<BlockPos> pos)
-
-
Method Detail
-
getResultStatus
public PlayerEntity.SleepResult getResultStatus()
-
setResult
public void setResult(PlayerEntity.SleepResult result)
-
getPos
public BlockPos getPos()
-
getOptionalPos
public java.util.Optional<BlockPos> getOptionalPos()
-
-