Interface BlockEntityVolume

All Superinterfaces:
BlockVolume, Volume
All Known Subinterfaces:
BlockEntityVolume.Modifiable<M>, BlockEntityVolume.Mutable, BlockEntityVolume.Streamable<T>, BlockEntityVolume.Unmodifiable<U>, Chunk<P>, ClientWorld, EnvironmentalVolume, GenerationChunk, GenerationRegion, PrimitiveGameVolume, Region<R>, ServerWorld, World<W,​L>, WorldChunk, WorldLike<P>

public interface BlockEntityVolume extends BlockVolume, Volume
  • Method Details

    • blockEntities

      Collection<? extends BlockEntity> blockEntities()
      Return a collection of block entities contained within this volume, possibly only returning block entities only in loaded areas.

      For world implementations, only some parts of the world is usually loaded, so this method will only return block entities within those loaded parts.

      Returns:
      A collection of entities
    • blockEntities

      default Collection<? extends BlockEntity> blockEntities(Predicate<? super BlockEntity> filter)
      Return a collection of block entities contained within this volume, possibly only returning block entities only in loaded areas. The returned block entities are filtered by the given Predicate before being returned.

      For world implementations, only some parts of the world is usually loaded, so this method will only return block entities within those loaded parts.

      Parameters:
      filter - The filter to apply to the returned entities
      Returns:
      A collection of filtered entities
    • blockEntity

      default Optional<? extends BlockEntity> blockEntity(Vector3i position)
      Gets the block entity at the given position, if it exists.
      Parameters:
      position - The position
      Returns:
      The block entity, or Optional.empty()
    • blockEntity

      Optional<? extends BlockEntity> blockEntity(int x, int y, int z)
      Gets the block entity at the given position, if it exists.
      Parameters:
      x - The X position
      y - The Y position
      z - The Z position
      Returns:
      The block entity, or Optional.empty()