Class AllowNearbyMonstersSleepEvent
java.lang.Object
net.vitacraft.serverlibraries.api.event.events.entities.AllowNearbyMonstersSleepEvent
- All Implemented Interfaces:
Event
Event that is fired when a player tries to sleep in a bed and there are monsters nearby.
-
Constructor Summary
ConstructorsConstructorDescriptionAllowNearbyMonstersSleepEvent
(net.minecraft.entity.LivingEntity entity, net.minecraft.util.math.BlockPos sleepingPos, boolean vanillaResult) -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.entity.LivingEntity
net.minecraft.util.math.BlockPos
boolean
boolean
void
setCancelled
(boolean cancelled)
-
Constructor Details
-
AllowNearbyMonstersSleepEvent
public AllowNearbyMonstersSleepEvent(net.minecraft.entity.LivingEntity entity, net.minecraft.util.math.BlockPos sleepingPos, boolean vanillaResult)
-
-
Method Details
-
getEntity
public net.minecraft.entity.LivingEntity getEntity()- Returns:
- the entity that is trying to sleep
-
getSleepingPos
public net.minecraft.util.math.BlockPos getSleepingPos()- Returns:
- the position 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
-