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
    net.minecraft.util.ActionResult
    allowBed(net.minecraft.entity.LivingEntity entity, net.minecraft.util.math.BlockPos sleepingPos, net.minecraft.block.BlockState state, boolean vanillaResult)
    Checks whether a block is a valid bed for the entity.
  • Method Details

    • allowBed

      net.minecraft.util.ActionResult allowBed(net.minecraft.entity.LivingEntity entity, net.minecraft.util.math.BlockPos sleepingPos, net.minecraft.block.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