Open antiaim opened 5 years ago
how did you try to click on the slot ?
how did you try to click on the slot ?
I tried bot.equip(axe, "hand") with axe being an Item instance from the window, and bot.clickWindow(2, 0, 0, function(cb) {console.log(cb)}), but neither do anything, and the callback for clickWindow is undefined.
A callback takes two argument. The first is the error, the second is the result. Check the second argument value.
Are you sure that 2 is the correct value for your slot ?
On Sun, Aug 4, 2019, 14:48 antiaim notifications@github.com wrote:
how did you try to click on the slot ?
I tried bot.equip(axe, "hand") with axe being an Item instance from the window, and bot.clickWindow(2, 0, 0, function(cb) {console.log(cb)}), but neither do anything, and the callback for clickWindow is undefined.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/PrismarineJS/mineflayer/issues/844?email_source=notifications&email_token=AAR437QEFLGKHXAGT2GNJ3DQC3FYVA5CNFSM4IJD7B72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3QBD4Q#issuecomment-518001138, or mute the thread https://github.com/notifications/unsubscribe-auth/AAR437RKJP2C24SAUNDPZGLQC3FYVANCNFSM4IJD7B7Q .
I'm trying to click the 3rd slot in the window. function(error, result) returns undefined for both.
I've also tried bot.clickWindow(3, 0, 0).
Try to check the difference between what's sent by vanilla client and what's sent with mineflayer (use node-minecraft-protocol proxy and debug mode for this)
minecraft-protocol read packet play.set_slot +0ms minecraft-protocol { minecraft-protocol "windowId": 1, minecraft-protocol "slot": 2, minecraft-protocol "item": { minecraft-protocol "blockId": 279, minecraft-protocol "itemCount": 1, minecraft-protocol "itemDamage": 0, minecraft-protocol "nbtData": { minecraft-protocol "type": "compound", minecraft-protocol "name": "", minecraft-protocol "value": { minecraft-protocol "display": { minecraft-protocol "type": "compound", minecraft-protocol "value": { minecraft-protocol "Lore": { minecraft-protocol "type": "list", minecraft-protocol "value": { minecraft-protocol "type": "string", minecraft-protocol "value": [ minecraft-protocol "§7Click to enter §aCreative§7 server" minecraft-protocol ] minecraft-protocol } minecraft-protocol }, minecraft-protocol "Name": { minecraft-protocol "type": "string", minecraft-protocol "value": "§a§lCreative Plots§f(516x516)" minecraft-protocol } minecraft-protocol } minecraft-protocol } minecraft-protocol } minecraft-protocol } minecraft-protocol } minecraft-protocol } +0ms
read packet play.close_window +0ms minecraft-protocol { minecraft-protocol "windowId": 1 minecraft-protocol } +0ms
Clicking window slot minecraft-protocol writing packet play.window_click +37ms minecraft-protocol { windowId: 0, minecraft-protocol slot: 2, minecraft-protocol mouseButton: 0, minecraft-protocol action: 0, minecraft-protocol mode: 0, minecraft-protocol item: { blockId: -1 } } +0ms
^using debug mode considering these are in order(and even if they are not) it seems like the mineflayer client is closing the opened window before attempting to click it.
I will update for vanilla client in a moment
well you can already see the issue, the window was closed...
Update, I fixed the closed window issue by removing the timeout - however, the click on the window still doesn't seem to register
Versions
mineflayer@2.9.0 minecraft-data@2.37.5 minecraft-protocol@1.9.0 server: bungeecord, not sure exactly but think its a 1.14 snapshot
Detailed description of a problem
I'm currently trying to make the bot use a server selector. Selecting the compass item and clicking it seems to work, logging the window shows a normal ContainerWindow with the item i need to click. However, I cannot click on the slot. Using bot.equip on a ContainerWindow (9 slots) does nothing. Attempting to use bot.clickWindow on the same window does nothing too, and callback is undefined.
Current code
Expected behavior
For the bot to click the 3rd slot in the window.
Additional context