PrismarineJS / mineflayer

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

Bot fails to see cobblestone created from lava and water. #133

Closed LordTocs closed 10 years ago

LordTocs commented 11 years ago

When trying to write a bot to assist me in harvesting cobble on a skyblock server. I noticed that the bot does not recognize that new cobble has spawned, he instead sees the blocks as air.

I think the block updates are registering on the incorrect blocks.

I outputed block updates to see what the bot was seeing as he mined a block.

When my bot mines the block { x: -98, y: 123, z: 539 }. I get the following: From: stonebrick to stonebrick { x: -98, y: 123, z: 539 }

From: stonebrick to air { x: -98, y: 123, z: 539 }

From: air to air { x: -114, y: 123, z: 539 }

From: air to water { x: -113, y: 123, z: 539 }

From: fence to water { x: -114, y: 122, z: 539 }

From: air to lava { x: -114, y: 123, z: 538 }

From: water to water { x: -113, y: 123, z: 539 }

From: water to water { x: -114, y: 122, z: 539 }

From: lava to lava { x: -114, y: 123, z: 538 }

From: air to stonebrick { x: -114, y: 123, z: 539 }

From: water to water { x: -113, y: 123, z: 539 }

From: water to water { x: -114, y: 122, z: 539 }

From: water to water { x: -113, y: 123, z: 539 }

From: water to water { x: -114, y: 122, z: 539 }

From: lava to lava { x: -98, y: 123, z: 538 }

It's a very curious series of updates. I don't really know why I'm getting updates from the blocks that far away. But it happens consistently. I'll keep investigating.

When I test the block at { x: -98, y: 123, z: 539 } again in a few seconds I get air. When it should be cobble.

andrewrk commented 11 years ago

There are 3 open issues about incorrect block knowledge right now (see #140 and #97)

It's going to be tricky to solve them because it might involve having to predict block data instead of learning block data from the server.

I think I'm going to hold off on resolving these issues at least until the next update - maybe the minecraft update will resolve these for us.

After all, I've seen incorrect block knowledge in the vanilla client as well as mineflayer.

LordTocs commented 11 years ago

Sounds good, although I plan to sit down and give it a good debugging this week. I think there's some discrepancy with coordinates. I get the air to cobble update, but it's in the wrong location. I've also noticed discrepancies in coordinates when I have the bot output my player's current position. So if it's not minecraft's derpy protocol, it might be some minor error under a couple layers of stuff in mineflayer.

I'm hoping that the voxel.js plugin will help out in visualizing just what the bot is seeing in combination with some packet sniffing of minecraft I might find something. I'll keep you posted if I find anything. Thanks for this awesome library.

andrewrk commented 11 years ago

Sweet! Contributions are most welcome - this project is too big for one person to handle alone.

nevercast commented 10 years ago

Closed. See referenced issue.