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.
-
Method Summary
Modifier and TypeMethodDescriptionallowBed(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 entitysleepingPos- the position of the blockstate- the block state to checkvanillaResult-trueif vanilla allows the block,falseotherwise- Returns:
ActionResult.SUCCESSif the bed is valid,ActionResult.FAILif it's not,ActionResult.PASSto fall back to other callbacks
-