Block details

Several functions in CC: Tweaked, such as turtle.inspect and commands.getBlockInfo provide a way to get information about a block in the world. This page details information about blocks that CC: Tweaked may return.

Basic information

Block information will always contain:

Example

A fully hydrated block of farmland:

{
    name = "minecraft:farmland",
    state = {
        moisture = 7
    }
}

An extended piston, facing upwards:

{
    name = "minecraft:piston",
    state = {
        facing = "up",
        extended = true
    }
}

Block tags

The tags a block has.

While the representation of tags is a little more complicated then a single list, this makes it very easy to check if a block has a certain tag:

--- Check if the block in front of the turtle is a log.
local function is_log()
    local ok, block = turtle.inspect()
    return ok and block.tags["minecraft:logs"]
end

Example

A fully hydrated block of farmland:

{
    name = "minecraft:farmland",
    state = { ... },
    tags = {
        ["minecraft:mineable/shovel"] = true,
    }
}

Map colour

The colour the block will appear on the map, if specified.

The map colour is just returned as a plain number (e.g. 9923917 for farmland). It can either be displayed in hex with string.format, or converted to individual RGB values with colors.unpackRGB.

Example

A fully hydrated block of farmland:

{
    name = "minecraft:farmland",
    state = { ... },
    mapColour = 9923917,
    mapColor = 9923917,
}

Changes