Class SleepAllowBedEvent
java.lang.Object
net.vitacraft.serverlibraries.api.event.events.entities.SleepAllowBedEvent
- All Implemented Interfaces:
Event
Called when an entity is allowed to sleep in a bed.
-
Constructor Summary
ConstructorsConstructorDescriptionSleepAllowBedEvent
(net.minecraft.entity.LivingEntity entity, net.minecraft.util.math.BlockPos pos, net.minecraft.block.BlockState state, boolean vanillaResult) -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.entity.LivingEntity
net.minecraft.util.math.BlockPos
getPos()
net.minecraft.block.BlockState
getState()
boolean
boolean
void
setCancelled
(boolean cancelled)
-
Constructor Details
-
SleepAllowBedEvent
public SleepAllowBedEvent(net.minecraft.entity.LivingEntity entity, net.minecraft.util.math.BlockPos pos, net.minecraft.block.BlockState state, boolean vanillaResult)
-
-
Method Details
-
getEntity
public net.minecraft.entity.LivingEntity getEntity()- Returns:
- the entity that is trying to sleep
-
getPos
public net.minecraft.util.math.BlockPos getPos()- Returns:
- the position of the bed the entity is trying to sleep in
-
getState
public net.minecraft.block.BlockState getState()- Returns:
- the state of the bed the entity 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
-