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 tried to make an auto miner but each time when bot is looking at block it cancels the mining
What did you try yet?
Did you try any method from the API? yes
Did you try any example? Any error from those? yes, i tried but same
Your current code
asyncfunctionmineOre(username,oreName){if(!oreName){bot.chat("Please specify the ore to mine");return;}console.log(bot.version)current_task=`Mining ${oreName} for ${username}`;bot.chat(`Started mining ${oreName}`);constfindOreBlock=()=>bot.findBlock({matching: mcData.blocksByName[oreName].id,maxDistance: 64});try{while(!stopMining){constoreBlock=findOreBlock();if(oreBlock&&bot.canDigBlock(oreBlock)){awaitbot.pathfinder.setGoal(newGoalBlock(oreBlock.position.x,oreBlock.position.y,oreBlock.position.z));target=bot.lookAt(oreBlock.position.x,oreBlock.position.y+0.3,oreBlock.position.z)bot.targetDigBlock=oreBlock;// Set the target blockawaitbot.dig(oreBlock,false);awaitbot.collectBlock.collect(oreBlock);bot.targetDigBlock=null;}else{bot.chat(`Could not find any more ${oreName}`);break;}}oreMined(username);}catch(err){if(err.message==='Digging aborted'){bot.chat(`Mining ${oreName} was stopped.`);}else{bot.chat(`Error mining ${oreName}: ${err.message}`);console.error(`Error mining ${oreName}:`,err);}stopTask();}}
Expected behavior
it goes to block and hits:
if(err.message==='Digging aborted'){bot.chat(`Mining ${oreName} was stopped.`);
I tried to comment it fro digger.js src, but bot does not update view angle for next block and gets stuck in infinite animation
The text was updated successfully, but these errors were encountered:
Versions
Detailed description of a problem
I tried to make an auto miner but each time when bot is looking at block it cancels the mining
What did you try yet?
Did you try any method from the API? yes
Did you try any example? Any error from those? yes, i tried but same
Your current code
Expected behavior
it goes to block and hits:
I tried to comment it fro digger.js src, but bot does not update view angle for next block and gets stuck in infinite animation
The text was updated successfully, but these errors were encountered: