You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to make a mining plugin for my bot. However, when I send it the mine command, it freezes and gets the error "Uncaught TypeError: undefined is not a function" on line 222 in index.js
Here is my code:
varmineflayer=require('mineflayer');varscaffoldPlugin=require('mineflayer-scaffold')(mineflayer);varblockFinderPlugin=require('mineflayer-blockfinder')(mineflayer);varvec3=mineflayer.vec3;module.exports.inject=inject;functioninject(bot){vardoMine=false;varfindIds=[16,15,14,21,56,73,74,129];////FunctionsfunctionfindPath(){bot.findBlock({point: bot.entity.position,matching: findIds,maxDistance: 64,count: 1,},function(err,blockPoints){if(err){fakeConsole("Error looking for blocks.","error")}if(blockPoints.length){bot.scaffold.to(blockPoints[0],function(err){if(err){doMine=falsefakeConsole("Didn't get to the ore.","error");}else{if(doMine===true){findPath();}else{fakeConsole("Ended mining task.","info");}}});}else{doMine=falsefakeConsole("No ores in range.","info");}});}////Commandsbot.on('whisper',function(username,message){if(message=="mine start"){if(doMine===false){doMine=true;fakeConsole("Started mining.","info");findPath();}else{fakeConsole("I am already mining!","error");}}if(message=="mine stop"){if(doMine===true){doMine=false;fakeConsole("Ending mining task...","info");}else{fakeConsole("I am not mining.","error");}}});//Fake consolefunctionfakeConsole(text,type){document=doc=window.documentvartext=arguments[0];vartype=arguments[1];varpara=document.createElement("P");vart=document.createTextNode(text);para.className=type;para.appendChild(t);document.getElementById('Space').appendChild(para);window.scrollTo(0,document.body.scrollHeight);}fakeConsole("Started mine plugin.","info")}
The text was updated successfully, but these errors were encountered:
I am trying to make a mining plugin for my bot. However, when I send it the mine command, it freezes and gets the error "Uncaught TypeError: undefined is not a function" on line 222 in index.js
Here is my code:
The text was updated successfully, but these errors were encountered: