Class SleepAllowTimeEvent
java.lang.Object
net.vitacraft.serverlibraries.api.event.events.entities.SleepAllowTimeEvent
- All Implemented Interfaces:
Event
Event that is fired when a player tries to sleep in a bed.
-
Constructor Summary
ConstructorsConstructorDescriptionSleepAllowTimeEvent
(net.minecraft.entity.player.PlayerEntity entity, net.minecraft.util.math.BlockPos pos, boolean vanillaResult) -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.entity.player.PlayerEntity
net.minecraft.util.math.BlockPos
getPos()
boolean
boolean
void
setCancelled
(boolean cancelled)
-
Constructor Details
-
SleepAllowTimeEvent
public SleepAllowTimeEvent(net.minecraft.entity.player.PlayerEntity entity, net.minecraft.util.math.BlockPos pos, boolean vanillaResult)
-
-
Method Details
-
getEntity
public net.minecraft.entity.player.PlayerEntity getEntity()- Returns:
- the player that is trying to sleep
-
getPos
public net.minecraft.util.math.BlockPos getPos()- Returns:
- the position of the bed the player is trying to sleep in
-
getVanillaResult
public boolean getVanillaResult()- Returns:
- the result of the vanilla check for nearby monsters
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelled
in interfaceEvent
-
setCancelled
public void setCancelled(boolean cancelled) - Specified by:
setCancelled
in interfaceEvent
-