Minecraft-Pathfinding / minecraft-pathfinding

27 stars 3 forks source link

Error when running code #4

Open PetLuck opened 1 week ago

PetLuck commented 1 week ago

Hello, I am trying to run the code from the file "basic.js" which is located at the examples folder, and I run into this error. I also tried taking parts of the basic.js to put into my own code and I run into the same problem. Whenever the "bot.loadPlugin(pathfinder)" runs, this error occurs. When you have the time, please check this out:

C:\Users\Owner\Downloads\autogrinder\node_modules\@nxg-org\mineflayer-pathfinder\dist\mineflayer-specific\world\cacheWorld.js:241 referenceWorld.on('blockUpdate', (oldBlock, newBlock) => { ^

TypeError: Cannot read properties of undefined (reading 'on') at new CacheSyncWorld (C:\Users\Owner\Downloads\autogrinder\node_modules\@nxg-org\mineflayer-pathfinder\dist\mineflayer-specific\world\cacheWorld.js:241:24) at new ThePathfinder (C:\Users\Owner\Downloads\autogrinder\node_modules\@nxg-org\mineflayer-pathfinder\dist\ThePathfinder.js:112:73) at C:\Users\Owner\Downloads\autogrinder\node_modules\@nxg-org\mineflayer-pathfinder\dist\index.js:44:26 at C:\Users\Owner\Downloads\autogrinder\node_modules\mineflayer\lib\plugin_loader.js:41:7 at Array.forEach () at injectPlugins (C:\Users\Owner\Downloads\autogrinder\node_modules\mineflayer\lib\plugin_loader.js:40:16) at EventEmitter.onInjectAllowed (C:\Users\Owner\Downloads\autogrinder\node_modules\mineflayer\lib\plugin_loader.js:12:5) at Object.onceWrapper (node:events:633:28) at EventEmitter.emit (node:events:531:35) at Timeout._onTimeout (C:\Users\Owner\Downloads\autogrinder\node_modules\mineflayer\lib\loader.js:128:26)

Node.js v20.18.0

GenerelSchwerz commented 19 hours ago

I'll do my best to update this, I'm just pretty swamped with everything.

PetLuck commented 3 hours ago

All good :) the issue was I was running 1.8.9 and it doesn't say a specific version this should be ran on anywhere.