Mineflayer bot.look at a direction

801 views Asked by At

Ok so im making a minecraft bot app and im using mineflayer but I cant seem to figure out on how do I make the bot look at a direction such a north or south I tried doing bot.lookAt(north) but that didnt work I searched the api documentation but couldnt find any answers . Any help related would be appreciated

1

There are 1 answers

0
7Solomon On

bot.lookAt needs a vec3 direction as input.

So you cant just say north. You can give it sth like (0,1,0)

https://github.com/PrismarineJS/mineflayer/blob/master/docs/api.md#botlookatpoint-force

If you code with JavaScript like this

var Vec3 = require('vec3').Vec3;
var v1 = new Vec3(1, 2, 3);
bot.lookAt(v1)