Skip to content

@minecraft/server


@minecraft/server / BlockLocationIterator

Class: BlockLocationIterator ​

Defined in: @minecraft/server/index.d.ts:4980

A BlockLocationIterator returns the next block location of the block volume across which it is iterating. The BlockLocationIterator is used to abstract the shape of the block volume it was fetched from (so it can represent all the block locations that make up rectangles, cubes, spheres, lines and complex shapes). Each iteration pass returns the next valid block location in the parent shape. Unless otherwise specified by the parent shape - the BlockLocationIterator will iterate over a 3D space in the order of increasing X, followed by increasing Z followed by increasing Y. (Effectively stepping across the XZ plane, and when all the locations in that plane are exhausted, increasing the Y coordinate to the next XZ slice)

Implements ​

Methods ​

[iterator]() ​

[iterator](): Iterator<Vector3>

Defined in: @minecraft/server/index.d.ts:4987

Returns ​

Iterator<Vector3>

Remarks ​

This function can't be called in restricted-execution mode.

Implementation of ​

Iterable.[iterator]


next() ​

next(): IteratorResult<Vector3>

Defined in: @minecraft/server/index.d.ts:4993

Returns ​

IteratorResult<Vector3>

Remarks ​

This function can't be called in restricted-execution mode.