setBlock

open fun setBlock(block: BlockT, blockId: String): Boolean(source)

Sets the block with the given blockId in place of the empty block.


abstract fun setBlock(block: BlockT, blockId: String, payload: Any?): Boolean(source)

Sets the block with the given blockId configured with the payload in place of the empty block. To replace a block, break it first, so its registry can clean up.

Every implementation supports a String payload with block state properties, for example [facing=north]. Unsupported payload is ignored.

Returns false if the block is not empty, the ID is unknown, or the block can't be set.