node-minecraft-protocol
node-minecraft-protocol copied to clipboard
Slot data documentation
Issue
Documentation is wrong about slot datas (i assume)

Solution
I spent almost an hour to understand that content was in fact just a prismarine item.toNotch.
Would be nice for new users to precise explicitly this matter in docs somehow.
The correct format is the following (or maybe i just don't know how to read the doc table ?)
import prismarineItem from "prismarine-item"
const Item = prismarineItem('1.12.1')
const stick = new Item(280, 5)
const notchStick = Item.toNotch(stick)
this.client.write('window_items', {
windowId: 0,
items: [0, 0, 0, notchStick, notchStick, 0, notchStick],
})

slot is defined here https://github.com/PrismarineJS/minecraft-data/blob/master/data/pc/1.13.2/protocol.json#L32
The documentation cannot be "wrong" because it's based on the file nmp is implemented with (protocol.json). However yes, it's missing information. See https://github.com/PrismarineJS/minecraft-data/issues/123