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
this is my code, it can stand on top of the slab which is what I want, but I cant get goal_reached to activate so I can click on it, I dont know why its not working
functionfindAndMoveToBlock(){constblockTypes=['wooden_slab','brick_slab','stone_brick_slab','nether_brick_slab','quartz_slab','stone_slab','sandstone_slab','purpur_slab','wooden_stairs','brick_stairs','stone_brick_stairs','nether_brick_stairs','quartz_stairs','stone_stairs','sandstone_stairs','purpur_stairs'];constblockIDs=blockTypes.map(type=>bot.registry.blocksByName[type]?.id).filter(id=>id!==undefined);conststartTime=performance.now();bot.findBlock({point: bot.entity.position,matching: blockIDs,maxDistance: 128,count: 10,},(err,blocks)=>{if(err){console.log('Error finding blocks:',err);return;}consttime=(performance.now()-startTime).toFixed(2);if(blocks.length>0){constblock=blocks[0];constmcData=require('minecraft-data')(bot.version);constmovements=newMovements(bot,mcData);movements.canDig=false;movements.scaffoldingBlocks=[];bot.pathfinder.setMovements(movements);constgoal=newGoalBlock(block.position.x,block.position.y,block.position.z);bot.pathfinder.setGoal(goal,true);bot.on('goal_reached',()=>{bot.chat(`Reached block at ${block.position.x}, ${block.position.y}, ${block.position.z} in ${time} ms.`);});}else{bot.chat(`No blocks found in ${time} ms.`);}});}```js
possible bugStage1just created by someone new to the project, we don't know yet if it deserves an implementation / a f
1 participant
Converted from issue
This discussion was converted from issue #3370 on May 12, 2024 21:44.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
this is my code, it can stand on top of the slab which is what I want, but I cant get goal_reached to activate so I can click on it, I dont know why its not working
Beta Was this translation helpful? Give feedback.
All reactions