home / bedrock150 / types / slot
Slot
Informations about a slot, that, if not empty, contains an item id and meta, the count (0-255) and, optionally, an nbt tag for enchantments, custom name, colours and more.
Fields
Name | Type | Length | When |
---|---|---|---|
id | varint | ||
meta and count | varint | id is greater than 0 |
|
nbt | ubyte[] | ushort | id is greater than 0 |
can place on | string[] | ||
can destroy | string[] |
id
Item’s id or 0 if the slot is empty.
meta and count
Item’s meta or uses (unsigned short) left-shifted 8 times and the count (unisgned byte). Examples:
var encoded = item.meta << 8 | item.count
var meta = encoded >> 8
var count = count & 255
nbt
Optional nbt data encoded as a nameless little-endian compound tag.