I got an error while using activateBlock #3251
Labels
possible bug
Stage1
just created by someone new to the project, we don't know yet if it deserves an implementation / a f
I got an error while using activateBlock
Here's my code
rightClickAt(bot) {
const targetPosition = new Vec3(8,4,8);
const blockAbove = bot.blockAt(targetPosition.offset(0, 1, 0));
bot.activateBlock(blockAbove);
}
This is an error
"C:\Program Files\nodejs\node.exe" ".\xin bot\index.js"
成功加入服务器
Uncaught TypeError TypeError: Cannot read properties of null (reading 'position')
at activateBlock (d:\Desktop\bot\node_modules\mineflayer\lib\plugins\inventory.js:160:28)
at rightClickAt (d:\Desktop\bot\xin bot\index.js:42:13)
at (d:\Desktop\bot\xin bot\index.js:17:9)
at emit (events:525:35)
at (d:\Desktop\bot\node_modules\mineflayer\lib\plugins\game.js:85:9)
at emit (events:525:35)
at emitPacket (d:\Desktop\bot\node_modules\minecraft-protocol\src\client.js:83:12)
at (d:\Desktop\bot\node_modules\minecraft-protocol\src\client.js:107:9)
at emit (events:513:28)
at addChunk (d:\Desktop\bot\node_modules\protodef\node_modules\readable-stream\lib_stream_readable.js:279:12)
at readableAddChunk (d:\Desktop\bot\node_modules\protodef\node_modules\readable-stream\lib_stream_readable.js:262:11)
at Readable.push (d:\Desktop\bot\node_modules\protodef\node_modules\readable-stream\lib_stream_readable.js:228:10)
at Transform.push (d:\Desktop\bot\node_modules\protodef\node_modules\readable-stream\lib_stream_transform.js:132:32)
at _transform (d:\Desktop\bot\node_modules\protodef\src\serializer.js:89:10)
at Transform._read (d:\Desktop\bot\node_modules\protodef\node_modules\readable-stream\lib_stream_transform.js:166:10)
at Transform._write (d:\Desktop\bot\node_modules\protodef\node_modules\readable-stream\lib_stream_transform.js:155:83)
at doWrite (d:\Desktop\bot\node_modules\protodef\node_modules\readable-stream\lib_stream_writable.js:390:139)
at writeOrBuffer (d:\Desktop\bot\node_modules\protodef\node_modules\readable-stream\lib_stream_writable.js:381:5)
at Writable.write (d:\Desktop\bot\node_modules\protodef\node_modules\readable-stream\lib_stream_writable.js:302:11)
at ondata (d:\Desktop\bot\node_modules\readable-stream\lib\internal\streams\readable.js:662:22)
at emit (events:513:28)
at addChunk (d:\Desktop\bot\node_modules\readable-stream\lib\internal\streams\readable.js:278:12)
at readableAddChunk (d:\Desktop\bot\node_modules\readable-stream\lib\internal\streams\readable.js:255:9)
at Readable.push (d:\Desktop\bot\node_modules\readable-stream\lib\internal\streams\readable.js:201:10)
at (d:\Desktop\bot\node_modules\minecraft-protocol\src\transforms\compression.js:69:14)
at zlibBufferOnEnd (zlib:161:10)
at emit (events:513:28)
at endReadableNT (internal/streams/readable:1359:12)
at processTicksAndRejections (internal/process/task_queues:82:21)
Process exited with code 1
The text was updated successfully, but these errors were encountered: