Changes a block at the given overworld coordinates.
| Name | Type | Description |
|---|---|---|
x, y, z | number | Block coordinates. |
blockId | number | The new block ID. Use 0 for air. |
metadata | number, optional | Optional block data value. |
A boolean indicating success.
local x, y, z = world.spawn()
local success = world.set(x, y + 5, z, 89) -- places a glowstone block
if success then
log('Block placed successfully')
end