chomens-bot-js/plugins/position.js
2022-08-14 16:51:45 +07:00

13 lines
351 B
JavaScript

/* 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};