MCPcopy
hub / github.com/PrismarineJS/mineflayer / putItem

Function putItem

examples/chest.js:305–317  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

303 }
304
305 async function putItem (name) {
306 const item = itemByName(table.window.items(), name)
307 if (item) {
308 try {
309 await table.putTargetItem(item)
310 bot.chat(`I put ${itemToString(item)}`)
311 } catch (err) {
312 bot.chat(`error putting ${itemToString(item)}`)
313 }
314 } else {
315 bot.chat(`unknown item ${name}`)
316 }
317 }
318
319 async function addLapis () {
320 const item = itemByType(table.window.items(), ['dye', 'purple_dye', 'lapis_lazuli'].filter(name => bot.registry.itemByName[name] !== undefined)

Callers 1

onChatFunction · 0.85

Calls 3

itemsMethod · 0.80
itemByNameFunction · 0.70
itemToStringFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…