Class CustomRespawnTest.CustomRespawnBlock

All Implemented Interfaces:
ItemLike, IForgeBlock, IForgeRegistryEntry<Block>
Enclosing class:
CustomRespawnTest

public static class CustomRespawnTest.CustomRespawnBlock extends Block
  • Constructor Details

  • Method Details

    • use

      public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult blockHitResult)
      Overrides:
      use in class BlockBehaviour
    • getRespawnPosition

      public Optional<Vec3> getRespawnPosition(BlockState state, EntityType<?> type, LevelReader levelReader, BlockPos pos, float orientation, @Nullable LivingEntity entity)
      Description copied from interface: IForgeBlock
      Returns the position that the entity is moved to upon respawning at this block.
      Parameters:
      state - The current state
      type - The entity type used when checking if a dismount blockstate is dangerous. Currently always PLAYER.
      levelReader - The current level
      pos - Block position in level
      orientation - The angle the entity had when setting the respawn point
      entity - The entity respawning, often null
      Returns:
      The spawn position or the empty optional if respawning here is not possible