node-minecraft-protocol-forge icon indicating copy to clipboard operation
node-minecraft-protocol-forge copied to clipboard

does not connect to the server with the installed mod on the TACZ weapon

Open lastuniverse opened this issue 7 months ago • 2 comments

I make proxies with plugins on node-minecraft-proprotocol

  • Servers are always 1.20.1
  • Mod Tacz (all versions)
    • https://github.com/mcmoddranchor/tacz/releases
    • https://modrinth.com/mod/taczaddon

It works great:

  • vanilla client => proxy => vanilla server
  • forge client => proxy => forge server (without mods)
  • forge client => proxy => forge server (with mods)

does not work:

  • forge client => proxy => forge server (with mods + TACZ)

I initialize something like this (autoVersionForge or forgeHandshake)

        this.#client = mc.createClient(this.#parseOptions(this.#options));
        forge.autoVersionForge(this.#client);
        // forge.forgeHandshake(this.#client);

I also tried to throw it on Server (autoVersionForge or forgeHandshake)

        this.#server = mc.createServer(...)
        forge.autoVersionForge(this.#server);
        // forge.forgeHandshake(this.#server);

in the proxy console (only with Forgehandshake on this.#client)

Chunk size is 129 but only 1 was read ; partial packet : {"name":26}; buffer :1a7f7b227472616e736c617465223a22646973636f6e6e6563742e67656e65726963526561736f6e222c2277697468223a5b22496e7465726e616c20457863657074696f6e3a206a6176612e6c616e672e4e756d626572466f726d6174457863657074696f6e3a20466f7220696e70757420737472696e673a205c225c22225d7d

in the server console (only at autoVervationforge on this.#client)

[03:00:47] [Netty Epoll Server IO #14/ERROR] [ne.mi.ne.NetworkRegistry/NETREGISTRY]: Channels [tacz:handshake,tacz:network] rejected vanilla connections
[03:00:47] [Netty Epoll Server IO #14/INFO] [ne.mi.se.ServerLifecycleHooks/SERVERHOOKS]: [/127.0.0.1:40730] Disconnecting VANILLA connection attempt: This server has mods that require Forge to be installed on the client. Contact your server admin for more details.

Tell me what can I do to work with Tacz? Is it possible to use it in the proxy mode?

lastuniverse avatar Jun 02 '25 23:06 lastuniverse

For the sake of a clean experiment, I took the code from readme.md

app.js

var mc = require('minecraft-protocol');
var autoVersionForge = require('minecraft-protocol-forge').autoVersionForge;
var client = mc.createClient({
    version: false,
    host: "127.0.0.1",
    port: 25565,
    username: "Ara",
    // password: password
});

autoVersionForge(client);

I installed node-minecraft-protocol-forge like this:

npm install minecraft-protocol-forge

In the package.json of the minecraft-protocol-forge package, the version is 1.0.0.

When running node app.js, I get the following in the Forge server console:

  • If there are no mods on the server, the client connects.
  • If the tacz mod is on the server, there's an error:
[23:45:07] [Netty Epoll Server IO #5/ERROR] [ne.mi.ne.NetworkRegistry/NETREGISTRY]: Channels [tacz:handshake,tacz:network] rejected vanilla connections
[23:45:07] [Netty Epoll Server IO #5/INFO] [ne.mi.se.ServerLifecycleHooks/SERVERHOOKS]: [/127.0.0.1:38674] Disconnecting VANILLA connection attempt: This server has mods that require Forge to be installed on the client. Contact your server admin for more details.

I installed node-minecraft-protocol-forge like this (latest commit from Git):

npm i PrismarineJS/node-minecraft-protocol-forge#d723566a5627b220a99e136b4b9cbc453c62e8bc

In the package.json of the minecraft-protocol-forge package, the version is 1.1.0 (apparently the latest beta commit, because there's no release tag).

When running node app.js, I get the following in the Forge server console:

  • If there are no mods on the server, there's an error:
[23:48:29] [Server thread/INFO] [minecraft/MinecraftServer]: Ara joined the game
[23:51:09] [Server thread/INFO] [minecraft/ServerGamePacketListenerImpl]: Ara lost connection: Disconnected
[23:51:09] [Server thread/INFO] [minecraft/MinecraftServer]: Ara left the game
[23:54:14] [Netty Epoll Server IO #3/ERROR] [ne.mi.ne.HandshakeHandler/FMLHANDSHAKE]: Recieved unexpected index 0 in client reply
  • If the tacz mod is on the server, the error is the same as with version 1.0.0:
[23:56:04] [Server thread/INFO] [ne.mi.se.pe.PermissionAPI/]: Successfully initialized permission handler forge:default_handler
[23:56:14] [Netty Epoll Server IO #1/ERROR] [ne.mi.ne.HandshakeHandler/FMLHANDSHAKE]: Recieved unexpected index 0 in client reply

Please, I kindly ask you to add support for complex mods like tacz to the package, or explain how I can add it myself. I haven't been able to figure it out on my own even after a day. I couldn't even understand whose responsibility this is: the node-minecraft-protocol-forge package, or if I need to add protocol data descriptions for the tacz mod to minecraft-protocol itself.

lastuniverse avatar Jun 04 '25 20:06 lastuniverse

The use of Forgehandshake3.js from the last commit was a little

С >>> - client to proxy С <<< - proxy to client S >>> - proxy to server S <<< - server to proxy ????????????????? fml:handshake - new 'login_plugin_request' !!!!!!!!!!!!!!!!! discriminatorName - type of discriminator in current 'login_plugin_request'

C >>> set_protocol { size: 22, name: 'set_protocol', state: 'handshaking' } {
  protocolVersion: 763,
  serverHost: 'localhost\x00FML3\x00',
  serverPort: 25565,
  nextState: 2
}
C >>> login_start { size: 22, name: 'login_start', state: 'login' } { username: 'Ara', playerUUID: '17e140fc-6646-47fe-88cc-65351307c6a7' }
C <<< compress { threshold: 256 }
C <<< success {
  uuid: '8071d069-9596-337c-a863-56c5e0641874',
  username: 'Ara',
  properties: []
}

Load plugins for server: 'local_vanilla'
Plugin loaded: [Rcon]
Plugin loaded: [Users]
Plugin loaded: [ExpFix]
Plugin loaded: [UsersState]
Plugin loaded: [Permissions]
Plugin loaded: [Teleport]
Plugin loaded: [Completer]
Plugin loaded: [Areas]
Plugin loaded: [Economy]
Plugin loaded: [EconomyComands]
Plugin loaded: [Signs]
Plugin loaded: [SignsCommands]
Plugin loaded: [MultiServers]
Plugin loaded: [ExpChange]
Plugin loaded: [Test]
Plugin loaded: [Spawn]
Plugin loaded: [Home]
Plugin loaded: [Warps]
Plugin loaded: [Jumper]
Plugin loaded: [Plugins]
Plugin loaded: [VipTools]
Plugin loaded: [SimpleAuth]
Plugin loaded: [Backup]

Start plugins for server: 'local_vanilla'
Plugin started: [Rcon]
Plugin started: [Users]
Plugin started: [ExpFix]
Plugin started: [UsersState]
Plugin started: [Permissions]
Plugin started: [Teleport]
Plugin started: [Completer]
Plugin started: [Areas]
Plugin started: [Economy]
Plugin started: [EconomyComands]
Plugin started: [Signs]
Plugin started: [SignsCommands]
Plugin started: [MultiServers]
Plugin started: [ExpChange]
Plugin started: [Test]
Plugin started: [Spawn]
Plugin started: [Home]
Plugin started: [Warps]
Plugin started: [Jumper]
Plugin started: [Plugins]
Plugin started: [VipTools]
Plugin started: [SimpleAuth]
Plugin started: [Backup]
>>>>>>>>>>>>>> client.connect Ara 8071d069-9596-337c-a863-56c5e0641874
(node:161919) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 terminate listeners added to [EventEmitter]. MaxListeners is 10. Use emitter.setMaxListeners() to increase limit
(Use `node --trace-warnings ...` to show where the warning was created)
S >>> set_protocol {
  protocolVersion: 763,
  serverHost: '127.0.0.1\x00FML3\x00',
  serverPort: 25566,
  nextState: 2
}
S >>> login_start {
  username: 'Ara',
  signature: null,
  playerUUID: '8071d069-9596-337c-a863-56c5e0641874'
}
S <<< login_plugin_request { size: 82, name: 'login_plugin_request', state: 'login' } {
  messageId: 0,
  channel: 'fml:loginwrapper',
  data: <Buffer 0d 66 6d 6c 3a 68 61 6e 64 73 68 61 6b 65 30 05 02 09 6d 69 6e 65 63 72 61 66 74 09 4d 69 6e 65 63 72 61 66 74 06 31 2e 32 30 2e 31 05 66 6f 72 67 65 ... 13 more bytes>
}
S <<< =========================
S <<< login_plugin_request {
  messageId: 0,
  channel: 'fml:loginwrapper',
  data: <Buffer 0d 66 6d 6c 3a 68 61 6e 64 73 68 61 6b 65 30 05 02 09 6d 69 6e 65 63 72 61 66 74 09 4d 69 6e 65 63 72 61 66 74 06 31 2e 32 30 2e 31 05 66 6f 72 67 65 ... 13 more bytes>
}
S <<< loginwrapper {
  channel: 'fml:handshake',
  data: <Buffer 05 02 09 6d 69 6e 65 63 72 61 66 74 09 4d 69 6e 65 63 72 61 66 74 06 31 2e 32 30 2e 31 05 66 6f 72 67 65 05 46 6f 72 67 65 06 34 37 2e 34 2e 30>
}


????????????????? fml:handshake


!!!!!!!!!!!!!!!!! ModData
S <<< handshake { discriminator: 'ModData', data: { mods: [ [Object], [Object] ] } }
S >>> login_plugin_response {
  messageId: 0,
  data: <Buffer 0d 66 6d 6c 3a 68 61 6e 64 73 68 61 6b 65 01 63>
}
S <<< login_plugin_request { size: 625, name: 'login_plugin_request', state: 'login' } {
  messageId: 1,
  channel: 'fml:loginwrapper',
  data: <Buffer 0d 66 6d 6c 3a 68 61 6e 64 73 68 61 6b 65 ce 04 01 02 09 6d 69 6e 65 63 72 61 66 74 05 66 6f 72 67 65 07 10 66 6d 6c 3a 6c 6f 67 69 6e 77 72 61 70 70 ... 556 more bytes>
}
S <<< =========================
S <<< login_plugin_request {
  messageId: 1,
  channel: 'fml:loginwrapper',
  data: <Buffer 0d 66 6d 6c 3a 68 61 6e 64 73 68 61 6b 65 ce 04 01 02 09 6d 69 6e 65 63 72 61 66 74 05 66 6f 72 67 65 07 10 66 6d 6c 3a 6c 6f 67 69 6e 77 72 61 70 70 ... 556 more bytes>
}
S <<< loginwrapper {
  channel: 'fml:handshake',
  data: <Buffer 01 02 09 6d 69 6e 65 63 72 61 66 74 05 66 6f 72 67 65 07 10 66 6d 6c 3a 6c 6f 67 69 6e 77 72 61 70 70 65 72 04 46 4d 4c 33 12 66 6f 72 67 65 3a 74 69 ... 540 more bytes>
}


????????????????? fml:handshake


!!!!!!!!!!!!!!!!! ModList
S <<< handshake {
  discriminator: 'ModList',
  data: {
    modNames: [ 'minecraft', 'forge' ],
    channels: [
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object]
    ],
    registries: [
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object]
    ],
    dataPackRegistries: []
  }
}
S <<< modlist {
  modNames: [ 'minecraft', 'forge' ],
  channels: [
    { name: 'fml:loginwrapper', marker: 'FML3' },
    { name: 'forge:tier_sorting', marker: '1.0' },
    { name: 'fml:handshake', marker: 'FML3' },
    { name: 'minecraft:unregister', marker: 'FML3' },
    { name: 'fml:play', marker: 'FML3' },
    { name: 'minecraft:register', marker: 'FML3' },
    { name: 'forge:split', marker: '1.1' }
  ],
  registries: [
    { name: 'minecraft:block' },
    { name: 'minecraft:fluid' },
    { name: 'minecraft:item' },
    { name: 'minecraft:mob_effect' },
    { name: 'minecraft:sound_event' },
    { name: 'minecraft:potion' },
    { name: 'minecraft:enchantment' },
    { name: 'minecraft:entity_type' },
    { name: 'minecraft:block_entity_type' },
    { name: 'minecraft:particle_type' },
    { name: 'minecraft:menu' },
    { name: 'minecraft:painting_variant' },
    { name: 'minecraft:recipe_serializer' },
    { name: 'minecraft:stat_type' },
    { name: 'minecraft:command_argument_type' },
    { name: 'minecraft:villager_profession' },
    { name: 'forge:entity_data_serializers' },
    { name: 'forge:fluid_type' },
    { name: 'forge:display_contexts' }
  ],
  dataPackRegistries: []
}

S >>> login_plugin_response {
  messageId: 1,
  data: <Buffer 0d 66 6d 6c 3a 68 61 6e 64 73 68 61 6b 65 b0 04 02 02 09 6d 69 6e 65 63 72 61 66 74 05 66 6f 72 67 65 02 12 66 6f 72 67 65 3a 74 69 65 72 5f 73 6f 72 ... 526 more bytes>
}
S <<< login_plugin_request { size: 1194, name: 'login_plugin_request', state: 'login' } {
  messageId: 2,
  channel: 'fml:loginwrapper',
  data: <Buffer 0d 66 6d 6c 3a 68 61 6e 64 73 68 61 6b 65 87 09 03 1f 6d 69 6e 65 63 72 61 66 74 3a 63 6f 6d 6d 61 6e 64 5f 61 72 67 75 6d 65 6e 74 5f 74 79 70 65 01 ... 1125 more bytes>
}
S <<< =========================
S <<< login_plugin_request {
  messageId: 2,
  channel: 'fml:loginwrapper',
  data: <Buffer 0d 66 6d 6c 3a 68 61 6e 64 73 68 61 6b 65 87 09 03 1f 6d 69 6e 65 63 72 61 66 74 3a 63 6f 6d 6d 61 6e 64 5f 61 72 67 75 6d 65 6e 74 5f 74 79 70 65 01 ... 1125 more bytes>
}
S <<< loginwrapper {
  channel: 'fml:handshake',
  data: <Buffer 03 1f 6d 69 6e 65 63 72 61 66 74 3a 63 6f 6d 6d 61 6e 64 5f 61 72 67 75 6d 65 6e 74 5f 74 79 70 65 01 35 0e 62 72 69 67 61 64 69 65 72 3a 62 6f 6f 6c ... 1109 more bytes>
}

????????????????? fml:handshake

At this moment it freezes about 30 seconds then the client falls off.

Here is a piece of code where it happens

        case 'fml:handshake': {
          debugLog('\n\n?????????????????', 'fml:handshake');
          
          const { data: handshake } = proto.parsePacketBuffer(
            PROTODEF_TYPES.HANDSHAKE,
            loginwrapper.data
          )
          debugLog('\n\n!!!!!!!!!!!!!!!!!', handshake.discriminator);

It is obvious that he can not steam the buffer with Messageid: 2 I really understand where and how to look for information about the insides of the protocol, I tried to watch Forge sources, but for me this is a dark forest.

I’ll probably finish this, I hope that the features I have found will help someone to finalize this module.

lastuniverse avatar Jun 06 '25 12:06 lastuniverse