Fix the new position plugin

This commit is contained in:
Chipmunk 2024-06-24 12:16:27 -04:00
parent a8ce3ecba3
commit b5b803e1e8

View file

@ -1,7 +1,7 @@
function inject (bot) {
bot.position = { x: null, y: null, z: null, yaw: null, pitch: null } // to prevent errors i guess
bot._client.on('position', (packet) => {
bot.on('packet.position', (packet) => {
const oldPos = { ...bot.position }
bot.position.x = packet.x + bot.position.x * !!(packet.flags & 1)