mineflayer icon indicating copy to clipboard operation
mineflayer copied to clipboard

HandshakeReset error

Open murilopereirame opened this issue 2 years ago • 3 comments

  • [x] The FAQ doesn't contain a resolution to my issue

Versions

  • mineflayer: 4.3.0
  • server: spigot with ajQueue
  • node: 16 LTS
  • minecraft: 1.12.2

Detailed description of a problem

When I try to connect to another server through /queue the bot crashes with the error

Error: Read error for unknown : HandshakeReset has no associated fieldInfo in switch

Your current code

/**
 * A quick and easy implementation of the collect block plugin. (Requires mineflayer-pathfinder and mineflayer-collectblock)
 */
var mc = require("minecraft-protocol");
var forgeHandshake = require("minecraft-protocol-forge").forgeHandshake;
const pathfinder = require("mineflayer-pathfinder").pathfinder;
const { mineflayer: mineflayerViewer } = require("prismarine-viewer");

const mineflayer = require("mineflayer");

const bot = mineflayer.createBot({
  host: "<server_ip>",
  username: "<user_name>",
  version: "1.12.2",
});

forgeHandshake(bot._client, {
  forgeMods: [
    { modid: "minecraft", version: "1.12.2" },
    { modid: "mcp", version: "9.42" },
    { modid: "FML", version: "8.0.99.99" },
    { modid: "Forge", version: "14.23.5.2860" },
    { modid: "storagenetwork", version: "1.8.3" },
    { modid: "locks", version: "3.0.0" },
    { modid: "ironchest", version: "7.0.72.847" },
    { modid: "foamfix", version: "0.10.14" },
    { modid: "betterfurnacesreforged", version: "1.5" },
    { modid: "pixelmon", version: "8.4.0" },
    { modid: "travelersbackpack", version: "1.0.35" },
    { modid: "jei", version: "4.16.1.301" },
  ],
});

bot.loadPlugin(pathfinder);

// Load mc data
let mcData;
bot.once("spawn", () => {
  mcData = require("minecraft-data")(bot.version);
  mineflayerViewer(bot, { port: 3000 });
  console.log("Spawned!");

  bot.chat("/login 12345678");

  setTimeout(() => {
    bot.chat("/queue server_one");
  }, 5000);
});

The Latest Packet received before crashing

  minecraft-protocol read packet play.transaction +26ms
  minecraft-protocol {
  minecraft-protocol   "windowId": 0,
  minecraft-protocol   "action": -25738,
  minecraft-protocol   "accepted": false
  minecraft-protocol } +0ms
  minecraft-protocol writing packet play.transaction +0ms
  minecraft-protocol { windowId: 0, action: -25738, accepted: true } +0ms
  minecraft-protocol read packet play.custom_payload +15ms
  minecraft-protocol {
  minecraft-protocol   "channel": "FML|HS",
  minecraft-protocol   "data": {
  minecraft-protocol     "type": "Buffer",
  minecraft-protocol     "data": [
  minecraft-protocol       254,
  minecraft-protocol       0
  minecraft-protocol     ]
  minecraft-protocol   }
  minecraft-protocol } +0ms

Expected behavior

Be teleported to the server without crashing

murilopereirame avatar May 06 '22 03:05 murilopereirame

Possible solution node-minecraft-protocol-forge PR

murilopereirame avatar May 06 '22 14:05 murilopereirame

Getting the same exact error attempting to do the same thing

tcortega avatar Apr 06 '24 05:04 tcortega

Apparently minecraft-protocol-forge is outdated on npm

tcortega avatar Apr 06 '24 05:04 tcortega