ð§ąBlockService
Service for placement and removal of blocks.
Example usage:
Functions
placeBlock(blockType: ItemType, position: Vector3): bool
Placed a block at position. Returns true if block was placed.
Returns the block at the given position. Will return nil if no block exists at the position.
getAboveRandomBlock(aboveBlockTypes: ItemType[] | nil): Vector3
Returns a random position above a block. Can optionally specify a set of aboveBlockTypes
to get a position only above a block of those types.
destroyBlock(position: Vector3): bool
Destroys block at position. Returns true if a block was destroyed.
Returns all blocks in the world. If a set of blockTypes
is supplied it will only return blocks of that type. Warning: this function is very slow, especially when you do not supply a list of blockTypes
.
Returns blocks contained in a part centered at the specified center
with the specified size
. If a set of blockTypes
is supplied, it will only return blocks of that type.
Last updated