BlockSelectMode

BlockSelectMode describes how blocks should be selected when using functions such as Block.Remove, Block.Replace or Block.AddNeighbor.

Builtin BlockSelectMode instances can be used, there's no way to create custom BlockSelectModes.

Built-in instances

Mode used to select all neighbor Blocks with the same color & aligned on a given BlockFace.
Blocks aren't considered in the selection if that BlockFace is covered by another cube.

-- Adds blocks on the whole surface composed by
-- touched block neighbors with the same color:
local impact = Player:CastRay()
if impact.Block ~= nil then
    local hitBlock = impact.Block
    hitBlock:AddNeighbor(hitBlock.PaletteIndex,
                        impact.FaceTouched,
                        BlockSelectMode.FaceSameColor)
end
BlockSelectMode One read-only

Mode used to select one single block.

-- Adds one block upon touched block face:
local impact = Player:CastRay()
if impact.Block ~= nil then
    local hitBlock = impact.Block
    hitBlock:AddNeighbor(hitBlock.PaletteIndex,
                        impact.FaceTouched,
                        BlockSelectMode.One)
end