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
A clear and concise description of what the problem is, with as much context as possible.
What are you building? What problem are you trying to solve?
What did you try yet?
I use the bot.dig(block, [forceLook = true], [digFace]) API to mine blocks, but it can only mine a block once. After the first mining, although the progress bar completes and the block appears to be mined on the client side, it is not actually mined on the server side. In Prismarine-viewer, the block will only briefly show as being mined before reverting to its original state.
To continue mining blocks, I have to disconnect from the server and reconnect, after which I can mine a block once again.
Throughout this process, there are no error messages reported.
Your current code
const{ pathfinder, Movements, goals }=require('mineflayer-pathfinder');const{ Vec3 }=require('vec3');// Function to find and dig all leaves within reachasyncfunctiondigLeavesAround2(){constleaves=bot.findBlocks({matching: block=>block.name.includes('leaves'),maxDistance: 5,// Adjust the distance as neededcount: 100});for(constpositionofleaves){block=bot.blockAt(position);if(block){while(block.name.includes('leaves')){awaitbot.dig(block,forceLook=false);awaitbot.waitForTicks(10);block=bot.blockAt(position);}// await bot.dig(block, forceLook = true);console.log(`Dug2 leaves at ${position}`);}// Wait a bit before digging the next block}}asyncfunctiondigLeavesAround(){constleaves=bot.findBlocks({matching: block=>block.name.includes('grass'),maxDistance: 5,// Adjust the distance as neededcount: 100});for(constpositionofleaves){constblock=bot.blockAt(position);if(block){// await bot.dig(block, forceLook = true);awaitbot.dig(block,forceLook=false,digFace='raycast');console.log(`Dug leaves at ${position}`);}// Wait a bit before digging the next blockawaitbot.waitForTicks(2);}}// Function to follow a path and dig leaves at each stopasyncfunctionfollowPathAndDig(path){for(constpositionofpath){awaitbot.pathfinder.goto(newgoals.GoalBlock(position.x,position.y,position.z));awaitdigLeavesAround();}}// Example path (replace with your actual path)constpath=[newVec3(10,64,10),newVec3(15,64,15),newVec3(20,64,20)];module.exports={ followPathAndDig, digLeavesAround, digLeavesAround2 };
Expected behavior
Under normal circumstances, calling digLeavesAround or digLeavesAround2 should remove all the surrounding grass and leaves, but after mining one, it fails to continue mining unless I re-enter the server.
Additional context
I'm not sure if this bug can be reproduced on all Folia servers. Here, I'll provide the server where this bug occurs: https://www.bilibili.com/video/BV1MkbFejEgP.
This is its description. To join this server, you need to bind a high-level QQ account. If you haven't used QQ before, don't attempt to connect to this server.
The text was updated successfully, but these errors were encountered:
I built myself a Folia server of version 1.20.6 and haven't been able to reproduce the issue (due to network issues, I failed to compile the Folia of version 1.20.1 and had to use a precompiled version from others).
This bug might not be caused by the server itself. It could be due to anti-cheat measures. I just tested on the server where the bug occurred, and I got kicked out, with the message: "FastPlace/FastBreak Hacks".
Versions
Detailed description of a problem
A clear and concise description of what the problem is, with as much context as possible.
What are you building? What problem are you trying to solve?
What did you try yet?
I use the
bot.dig(block, [forceLook = true], [digFace])
API to mine blocks, but it can only mine a block once. After the first mining, although the progress bar completes and the block appears to be mined on the client side, it is not actually mined on the server side. InPrismarine-viewer
, the block will only briefly show as being mined before reverting to its original state.To continue mining blocks, I have to disconnect from the server and reconnect, after which I can mine a block once again.
Throughout this process, there are no error messages reported.
Your current code
Expected behavior
Under normal circumstances, calling digLeavesAround or digLeavesAround2 should remove all the surrounding grass and leaves, but after mining one, it fails to continue mining unless I re-enter the server.
Additional context
I'm not sure if this bug can be reproduced on all Folia servers. Here, I'll provide the server where this bug occurs: https://www.bilibili.com/video/BV1MkbFejEgP.
This is its description. To join this server, you need to bind a high-level QQ account. If you haven't used QQ before, don't attempt to connect to this server.
The text was updated successfully, but these errors were encountered: