Open flowl opened 4 years ago
I found out the server doesn't like receiving "equip item" every 50ms, using 1000ms works but unstable, 5000ms seems ok. So I would confirm this is not a mineflayer bug, but it's unclear at first why the example is not working.
Might be a good idea to check if the item is already in the bot's hand before triggering a new equip event.
this is still happening in mineflayer 3.7.0
setInterval(() => {
if (mcData.itemsByName.totem_of_undying && bot.inventory.slots[45] == null) {
const totem = bot.inventory.findInventoryItem(mcData.itemsByName.totem_of_undying.id, null, null);
if (totem) {
equip(totem, 'off-hand')
}
}
}, 10000)
(node:44365) Error: Server rejected transaction for clicking on slot 41, on window [
null,
null,
...
{
"type": 449,
"count": 1,
"metadata": 0,
"nbt": null,
"name": "totem_of_undying",
"displayName": "Totem of Undying",
"stackSize": 1,
"slot": 41
},
{
"type": 449,
"count": 1,
"metadata": 0,
"nbt": null,
"name": "totem_of_undying",
"displayName": "Totem of Undying",
"stackSize": 1,
"slot": 42
},
null,
null,
null
].
at clickWindow (/home/hub/projects/annoyance-bot/node_modules/mineflayer/lib/plugins/inventory.js:416:13)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async moveSlotItem (/home/hub/projects/annoyance-bot/node_modules/mineflayer/lib/plugins/inventory.js:431:5)
at async equip (/home/hub/projects/annoyance-bot/node_modules/mineflayer/lib/plugins/simple_inventory.js:108:7)
(node:44365) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
at emitDeprecationWarning (internal/process/promises.js:180:11)
at processPromiseRejections (internal/process/promises.js:249:13)
at processTicksAndRejections (internal/process/task_queues.js:96:32)
Versions
Detailed description of a problem
The example
auto_totem.js
is leading to rejected frame when the bot has a totem in the inventory.Stacktrace