Interface BlockEntityVolume

    • Method Detail

      • 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()