PrismarineJS / mineflayer

Create Minecraft bots with a powerful, stable, and high level JavaScript API.
https://prismarinejs.github.io/mineflayer/
MIT License
5.1k stars 920 forks source link

Random teleportation #258

Closed demipixel closed 4 years ago

demipixel commented 9 years ago

Experience with my bot (some with rbot as well) has shown that on connection (most reliable) and at other random times, the bot will teleport downwards a certain amount (Around 15-20 blocks although I don't think this is very reliable) into a cave, lava, the void, etc. Any clue why this might be happening and how we can fix it?

rom1504 commented 9 years ago

I have noticed this too. I'm pretty sure it was due to lag since I only noticed this when connecting the bot to a distant server and not to localhost.

Basically I think the bot keep sending position update (moving forward for example) but the server get them only a few seconds later so in the vanilla client you only get them a few seconds later too, so it appears it's teleporting.

I think we should somehow check the latence and adapt physics.js accordingly.

rom1504 commented 9 years ago

Can we figure out a reproducible test case for this ? (I don't want to test this by waiting the bot to do this by himself 30min later)