-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
I used getDroppedItem on entities in the bots render distance and got this error once
TypeError: Cannot read properties of undefined (reading 'blockId')
at Function.fromNotch (/home/pi/Documents/mineflayer-auto-shepherd/node_modules/prismarine-item/index.js:81:18)
at Entity.getDroppedItem (/home/pi/Documents/mineflayer-auto-shepherd/node_modules/prismarine-entity/index.js:44:19)
at /home/pi/Documents/mineflayer-auto-shepherd/dist/plugins/autoShepherd.js:27:98
at Array.filter (<anonymous>)
The server is running on paper 1.12.2 and there should not be any weird entities around.
I don't know how to reproduce that error as it only happened once
The code calling the function looks like this
const droppedItems = Object.values(bot.entities).filter(e => {
return e.name === 'item' && e.position.distanceTo(bot.entity.position) < 30 && e.getDroppedItem()?.name?.includes('wool')
})
Metadata
Metadata
Assignees
Labels
No labels