Item Info
Look up the static metadata baked into the client for any block id. Backed by the live ConfigData table when present (full flags + collision), with a fallback to the bundled block_types.json so scripts always get at least an id + name even before any bot has connected.
local item = getInfo(1) -- 1 = Solid Block
item.id -- block type
item.name -- display name
item.flags -- bitfield: 0x1 untradeable, 0x2 trashable
item.collision -- 0x0 none, 0x1 collidable, 0x2 oneway, 0x4 hot, 0x8 death
Lookups
getInfo(id)
| Field | Type |
|---|---|
| Signature | (id: number) → ItemInfo? |
| Returns | ItemInfo? — nil when neither the live ConfigData table nor the fallback catalog has the id |
| Async | no |
local info = getInfo(9)
if info then
print(info.name) -- "Obsidian"
end
getInfos()
| Field | Type |
|---|---|
| Signature | () → {ItemInfo} |
| Returns | {ItemInfo} — 1-indexed list of every block the runtime knows about |
| Async | no |
Source priority: ConfigData (live, full flags) → bundled block_types.json (fallback, id + name only). Returns an empty table when neither has populated yet.
for _, item in pairs(getInfos()) do
-- ...
end
ItemInfo fields
| Field | Type | Notes |
|---|---|---|
id | number | Block id (matches InventoryItem.id and world:findTiles(blockType)). |
name | string | Display name. Falls back to "#<id>" — never nil. |
flags | number | Bitmask. 0 when ConfigData hasn't arrived. |
collision | number | Bitmask. 0 when ConfigData hasn't arrived. |
flags bits
| Bit | Meaning |
|---|---|
0x1 | untradeable (player can't list / send via chat) |
0x2 | trashable (default for every block — rarely cleared) |
collision bits
| Bit | Meaning |
|---|---|
0x0 | no collider |
0x1 | collidable (solid) |
0x2 | one-way (platform — pass from below, block from above) |
0x4 | hot (damage on contact, e.g. fire) |
0x8 | death (instant-kill, e.g. spike, lava) |
Combine via bitwise AND:
local UNTRADEABLE = 0x1
if bit32.band(info.flags, UNTRADEABLE) ~= 0 then
print(info.name, "is untradeable")
end