Interface EntitySleepEvents.AllowBed

Enclosing class:
EntitySleepEvents
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface EntitySleepEvents.AllowBed
  • Method Summary

    Modifier and Type
    Method
    Description
    allowBed(LivingEntity entity, BlockPos sleepingPos, BlockState state, boolean vanillaResult)
    Checks whether a block is a valid bed for the entity.
  • Method Details

    • allowBed

      ActionResult allowBed(LivingEntity entity, BlockPos sleepingPos, BlockState state, boolean vanillaResult)
      Checks whether a block is a valid bed for the entity.

      Non-passing return values cancel further callbacks.

      Parameters:
      entity - the sleeping entity
      sleepingPos - the position of the block
      state - the block state to check
      vanillaResult - true if vanilla allows the block, false otherwise
      Returns:
      ActionResult.SUCCESS if the bed is valid, ActionResult.FAIL if it's not, ActionResult.PASS to fall back to other callbacks