chomens-bot-js/plugins/position.js

14 lines
351 B
JavaScript
Raw Normal View History

2022-08-14 05:51:45 -04:00
/* eslint-disable require-jsdoc */
const Vec3 = require('vec3');
function inject(bot) {
bot.position = new Vec3(null, null, null);
bot._client.on('position', (position) => {
bot.position = new Vec3(position.x, position.y, position.z);
bot.write('teleport_confirm', {teleportId: position.teleportId});
});
}
module.exports = {inject};