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
constmineflayer=require('mineflayer');constowner=process.argv[3]||"FedexxedeF"constpass=process.argv[4];constpvp=require('./mineflayer-pvp').pluginconstarmor_manager=require("./mineflayer-armor-manager")varisAttackingMobs="false"constpathfinder=require('mineflayer-pathfinder').pathfinderconstMovements=classMovements{constructor(bot,mcData){this.bot=botthis.canDig=falsethis.digCost=10}}const{ GoalNear, GoalBlock, GoalXZ, GoalY, GoalInvert, GoalFollow }=require('mineflayer-pathfinder').goalsconstoptions={host: process.argv[2],port: 25565,username: "Xbot",password: process.argv[4],}constbot=mineflayer.createBot(options)bot.once('spawn',()=>{bot.loadPlugin(pathfinder)bot.loadPlugin(pvp)// Once we've spawn, it is safe to access mcData because we know the versionconstmcData=require('minecraft-data')(bot.version)constmovements=newMovements(bot,mcData)movements.canDig=falsebot.pathfinder.setMovements(movements)bot.settings.viewDistance="tiny"bot.chat('/login '+pass)bot.chat('Xbot by Fede!')console.log("Connected")// We create different movement generators for different type of activityconstdefaultMove=newMovements(bot,mcData)//every 1 second go forward/* setInterval(function(){ bot.setControlState("back", false) bot.setControlState("forward", true) },1000) setInterval(function(){ bot.setControlState("forward", false) bot.setControlState("back", true) },1100) */});setInterval(()=>{if(isAttackingMobs==="false")returnconstmobFilter=e=>e.type==="mob"constmob=bot.nearestEntity(mobFilter)if(!mob)returnif(mob&&mob.kind.toString().toLowerCase().includes('hostile')){bot.pvp.attack(mob)}},1000);bot.on("kicked",(reason,loggedIn)=>{console.log("KICKED! "+reason)})bot.on("chat",function(username,message){consttarget=bot.players[username] ? bot.players[username].entity : nullvarpmessage=message.split(' ')if(message.split('_')[0]!=""){return}if(username===bot.username)returnif(username!=owner){console.log("Player "+username+" had not enough permissions to execute command!")bot.whisper(username,"You got not enough permissions to execute this command!")return}if(message==="_come"){bot.chat('/teleport '+bot.username+" "+username);bot.whisper(username,'Teleported to '+username);console.log("Teleported to "+username+"'s position");};if(message==="_follow"){if(!target){bot.chat('I don\'t see you !')return}bot.whisper(username,'Following you!');console.log("Following "+username);bot.pathfinder.setGoal(newGoalFollow(target,3),true)console.log(bot.players[username].entity.position)isAttackingMobs="false"};if(pmessage[0]==="_attack"){if(pmessage[1]==="hostiles"){isAttackingMobs="true"console.log("Attacking Hostiles!")bot.chat("Attacking hostiles!")}else{constplayer=bot.players[pmessage[1]]if(!player){bot.chat("I can't see "+player)return}if(pmessage[1]){bot.pvp.attack(player.entity)}}};/* if (message === '_fight') { const player = bot.players[username] if (!player) { bot.chat("I can't see you.") return } bot.chat('Prepare to fight!') bot.pvp.attack(player.entity) }*/});
error: TypeError: movements.countScaffoldingItems is not a function at Object.bot.pathfinder.getPathTo (C:\Users\Toshiba\node_modules\mineflayer-pathfinder\index.js:56:97) at EventEmitter.monitorMovement (C:\Users\Toshiba\node_modules\mineflayer-pathfinder\index.js:259:42) at EventEmitter.emit (events.js:327:22) at Timeout.doPhysics [as _onTimeout] (C:\Users\Toshiba\node_modules\mineflayer\lib\plugins\physics.js:63:13) at listOnTimeout (internal/timers.js:554:17) at processTimers (internal/timers.js:497:7)
The text was updated successfully, but these errors were encountered:
Version of mineflayer-pathfinder: latest
code:
error:
TypeError: movements.countScaffoldingItems is not a function at Object.bot.pathfinder.getPathTo (C:\Users\Toshiba\node_modules\mineflayer-pathfinder\index.js:56:97) at EventEmitter.monitorMovement (C:\Users\Toshiba\node_modules\mineflayer-pathfinder\index.js:259:42) at EventEmitter.emit (events.js:327:22) at Timeout.doPhysics [as _onTimeout] (C:\Users\Toshiba\node_modules\mineflayer\lib\plugins\physics.js:63:13) at listOnTimeout (internal/timers.js:554:17) at processTimers (internal/timers.js:497:7)
The text was updated successfully, but these errors were encountered: