mineflayer-web-inventory
mineflayer-web-inventory copied to clipboard
bot crashes if it has items when no Minecraft version in bot is specified
Web Inventory only works when the bot has no items. If it has an item it crashes. I tried it on Minecraft 1.18.2
Error message
mineflayer-web-inventory error. trying to continue
TypeError: mcData.version.<= is not a function
at addItemData (C:\projects\discord-minecraft-bot\node_modules\mineflayer-web-inventory\utils.js:47:29)
at emitWindow (C:\projects\discord-minecraft-bot\node_modules\mineflayer-web-inventory\index.js:96:40)
at Namespace.<anonymous> (C:\projects\discord-minecraft-bot\node_modules\mineflayer-web-inventory\index.js:103:5)
at Namespace.emit (node:events:527:28)
at C:\projects\discord-minecraft-bot\node_modules\socket.io\dist\namespace.js:135:27
at processTicksAndRejections (node:internal/process/task_queues:78:11)
C:\projects\discord-minecraft-bot\node_modules\mineflayer-web-inventory\utils.js:82
if ((itemMaxDurability = mcData.itemsByName[item.name].maxDurability) && item.durabilityUsed != null) {
^
TypeError: Cannot read properties of undefined (reading 'azure_bluet')
at addItemData (C:\projects\discord-minecraft-bot\node_modules\mineflayer-web-inventory\utils.js:82:46)
at emitWindow (C:\projects\discord-minecraft-bot\node_modules\mineflayer-web-inventory\index.js:96:40)
at Namespace.<anonymous> (C:\projects\discord-minecraft-bot\node_modules\mineflayer-web-inventory\index.js:103:5)
at Namespace.emit (node:events:527:28)
at C:\projects\discord-minecraft-bot\node_modules\socket.io\dist\namespace.js:135:27
at processTicksAndRejections (node:internal/process/task_queues:78:11)
Mineflayer versions:
"minecraft-assets": "^1.9.0",
"minecraft-data": "^3.5.0",
"mineflayer": "^4.3.0",
"mineflayer-armor-manager": "^1.4.2",
"mineflayer-pathfinder": "^2.1.1",
"mineflayer-pvp": "^1.2.1",
"mineflayer-web-inventory": "^1.8.2"
Are you specifying the minecraft version when creating the bot?
const bot = mineflayer.createBot({
// ...
version: '1.18.2' // <---------------------- This
})
If not, try to do that and check if it works.
Are you specifying the minecraft version when creating the bot?
const bot = mineflayer.createBot({ // ... version: '1.18.2' // <---------------------- This })
If not, try to do that and check if it works.
Thank you, I tried that and it solved it.