Item details

Several functions in CC: Tweaked, such as turtle.getItemDetail and inventory.getItemDetail provide a way to get information about an item stack. This page details information about items that CC: Tweaked may return.

Some methods (such as inventory.list and turtle.getItemDetail without the detailed flag), will only return the "Basic information" about the item.

Basic information

Item information will always contain:

Example

A stack of 32 Stripped Acacia Logs:

{
    name = "minecraft:stripped_acacia_log",
    count = 32,
}

A turtle with an upgrade attached:

{
    name = "computercraft:turtle_normal",
    count = 1,
    nbt = "a33095c2eb17c10e12f2b970c4e1b2bb",
}

Display information

Common information shown in the item's tooltip:

Example

A stack of Stripped Acacia Logs:

{
    name = "minecraft:stripped_acacia_log",
    count = 32,
    displayName = "Stripped Acacia Log",
}

Max count

The maximum number of items this item can stack to:

Example

A stack of Stripped Acacia Logs:

{
    name = "minecraft:stripped_acacia_log",
    count = 32,
    maxCount = 64,
}

Item tags

The tags an item has.

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

--- Check if the item in the turtle's inventory is a log.
local function is_log(slot)
    local ok, block = turtle.getItemDetails(slot, true)
    return ok and block.tags["minecraft:logs"]
end

Example

A stack of Stripped Acacia Logs:

{
    name = "minecraft:stripped_acacia_log",
    count = 32,
    tags = {
        ["minecraft:acacia_logs"] = true,
        ["minecraft:logs"] = true,
        ["minecraft:logs_that_burn"] = true,
    }
}

Item groups

The creative tabs this item appears on:

Version differences

This information is not available on Minecraft 1.19.3 to 1.20.3. This field is present, but empty on those versions.

Example

A stack of Stripped Acacia Logs:

{
    name = "minecraft:stripped_acacia_log",
    count = 32,
    itemGroups = {
        {
            id = "minecraft:building_blocks",
            displayName = "Building Blocks"
        }
    }
}

Damage and durability

If this item can be damaged (e.g. a pickaxe), then its damage and durability will be available:

Example

An unused diamond pickaxe:

{
    name = "minecraft:diamond_pickaxe",
    count = 1,
    damage = 0,
    maxDamage = 1561,
}

A half-used wooden pickaxe:

{
    name = "minecraft:wooden_pickaxe",
    count = 1,
    damage = 21,
    maxDamage = 59,
    durability = 0.615,
}

Enchantments

The enchantments this item has. This includes both tools and enchanted books.

Example

A diamond pickaxe with Efficiency V:

{
    name = "minecraft:diamond_pickaxe",
    count = 1,
    enchantments = {
        {
            name = "minecraft:efficiency",
            level = 5,
            displayName = "Efficiency V",
        }
    }
}

Potion effects

The effects this potion (or potion-embued item, such as a tipped arrow) has:

Example

A basic Potion of Healing:

{
    name = "minecraft:potion",
    displayName = "Potion of Healing",
    potionEffects = {
        {
            name = "minecraft:instant_health",
            displayName = "Instant Health",
        },
    },
}

An upgraded Potion of Regeneration:

{
    name = "minecraft:potion",
    displayName = "Potion of Regeneration",
    potionEffects = {
        {
            name = "minecraft:regeneration",
            displayName = "Regeneration II",
            duration = 22.5,
            potency = 2,
        },
    },
}

Map colour

The colour the item's block form will appear on the map, if specified.

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

Example

A stack of Stripped Acacia Logs:

{
    name = "minecraft:stripped_acacia_log",
    count = 32,
    mapColour = 14188339,
    mapColor = 14188339,
}

Changes