java.lang.Object
net.vitacraft.serverlibraries.api.event.events.entities.SleepAllowBedEvent
All Implemented Interfaces:
Event

public class SleepAllowBedEvent extends Object implements Event
Called when an entity is allowed to sleep in a bed.
  • 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 interface Event
    • setCancelled

      public void setCancelled(boolean cancelled)
      Specified by:
      setCancelled in interface Event