Closed deathcap closed 8 years ago
bot.entity is defined when the login packet (http://prismarinejs.github.io/minecraft-data/?d=protocol#toClient_login http://wiki.vg/Protocol#Join_Game ) is received (https://github.com/PrismarineJS/mineflayer/blob/master/lib/plugins/entities.js#L67)
it seems like glowstone send window_items before this packet.
To handle this we'd have to define bot.entity before I guess, but that would be a bit weird because we don't know the entity id before getting that login packet.
I guess I'll try running mineflayer on glowstone and try some things.
Dug into this some more, I believe it is a Glowstone++ server bug.
It sends window_items, login, and then another window_items. The first window_items appears to be an error, because it is called in the constructor and is sent in join() anyway. Removing it allows mineflayer to login, and we still get updated inventories: https://github.com/GlowstonePlusPlus/GlowstonePlusPlus/pull/147 - if my analysis is correct (awaiting feedback on the Glowstone++ PR), then this issue on mineflayer can be closed.
Fixed in Glowstone++ https://github.com/GlowstonePlusPlus/GlowstonePlusPlus/pull/147
Attempting to use latest mineflayer (c3f67f9 from git) with latest Glowstone++
(65111e) from git), usually I hit another issue and cannot login: https://github.com/GlowstonePlusPlus/GlowstonePlusPlus/issues/146(update: no longer hit this issue with build 511) - but after retrying several times,sometimesconsistently mineflayer gets further but then crashes in the "inventory" plugin:unsure if this is a client (mineflayer) or server (Glowstone++) bug, but at first glance it seems to me to be a possible timing/synchronization or packet ordering issue?
(Originally saw this when using mineflayer through https://github.com/vogonistic/mineflayer-voxel/pull/1)