Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'boundingBox' of null #35

Open
PitPanda1 opened this issue Aug 6, 2018 · 5 comments
Open

TypeError: Cannot read property 'boundingBox' of null #35

PitPanda1 opened this issue Aug 6, 2018 · 5 comments

Comments

@PitPanda1
Copy link

PitPanda1 commented Aug 6, 2018

I want to create a little bot, which have to walk to a specific area, but I get a TypeError...

D:\mcbot\node_modules\minecraft-protocol\src\transforms\framing.js:66
          } else { throw e }
                   ^

TypeError: Cannot read property 'boundingBox' of null
    at isSafe (D:\mcbot\node_modules\mineflayer-navigate\index.js:349:18)
    at Object.getNeighbors [as neighbor] (D:\mcbot\node_modules\mineflayer-navigate\index.js:184:19)
    at aStar (D:\mcbot\node_modules\a-star\index.js:52:28)
    at findPathSync (D:\mcbot\node_modules\mineflayer-navigate\index.js:71:19)
    at EventEmitter.navigateTo [as to] (D:\mcbot\node_modules\mineflayer-navigate\index.js:148:19)
    at Bot.bot.on (D:\mcbot\walker.js:55:15)
    at emitNone (events.js:111:20)
    at Bot.emit (events.js:208:7)
    at Client.bot._client.on (D:\mcbot\node_modules\mineflayer\lib\plugins\health.js:22:11)
    at emitTwo (events.js:126:13)

Code:

bot.on('spawn', () => {
	var vector = new vec3(-5520.0, 66.0, 5564.0);
	console.log(vector);
	bot.navigate.to(vector);
});

I've tried several things with the Vector like parseFloat on each parameter, give a Float number (.0), I tried to instantiate with an Object {x, y, z}, but nothing seems to work.

I just want to build something like, First walk to xyz1, then walk to xyz2, etc. not a big deal???

Anyone can help me?

@rom1504
Copy link
Member

rom1504 commented Aug 7, 2018 via email

@PitPanda1
Copy link
Author

PitPanda1 commented Aug 7, 2018

Wow its just curious. I've tested again and now it works. The point was just 20 Blocks away from the spawning point. https://wyncode.co/wp-content/uploads/2014/08/171.jpg ¯\(ツ)/¯ Thanks for your help.

UPDATE:
Okay got the problem again that the bot didn't moved right after spawn event. I've just setup a timer of 3 Seconds until it will move, now it works 100% of the time. I'll just use it for my solution.

mineflayer latest
mineflayer-navigate latest
minecraft 1.8.8

@PitPanda1
Copy link
Author

PitPanda1 commented Aug 7, 2018

I have another Problem. :( I'm trying to walk through a nether portal, but this is not really a nether portal, its a warp, the bot just walks to the portal and then stops there. How can I force it to walk into it?

@rom1504
Copy link
Member

rom1504 commented Aug 7, 2018 via email

@PitPanda1
Copy link
Author

Well there is a lot of informations haha. I just bypassed my problem, I walk to the Portal and manually let the bot walk into it with setControlState.

bot.lookAt(lookingAt, true, () => {
	bot.setControlState('forward', true);
	setTimeout(() => {
		bot.clearControlStates()
		nextState();
	}, 2000);
});

I'll go a bit deeper into it when its not working now. O_O

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants