You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[x] The FAQ doesn't contain a resolution to my issue
Versions
minecraft-protocol: 1.51.0
server: vanilla
node: 21.0.0
Detailed description of a problem
once i run the code and connect to the localhost, it is stuck at Joining world until it times out, however the client does connect to the server and receives packets but the minecraft window is stuck at "Joining World..."
once i connect:
Incoming connection (::ffff:127.0.0.1)
after few seconds:
Connection closed by client (::ffff:127.0.0.1)
Connection closed by server (::ffff:127.0.0.1)
i dont get any error, i have tried multiple servers
Could it be my game error or the code? i am not sure
also when using 1.8.9 it seems to work normally on any server
Current code
constmc=require('minecraft-protocol')conststates=mc.statesconstsrv=mc.createServer({'online-mode': false,port: 25565,keepAlive: false,version: '1.21.1'})srv.on('login',function(client){constaddr=client.socket.remoteAddressconsole.log('Incoming connection','('+addr+')')letendedClient=falseletendedTargetClient=falseclient.on('end',function(){endedClient=trueconsole.log('Connection closed by client','('+addr+')')if(!endedTargetClient){targetClient.end('End')}})client.on('error',function(err){endedClient=trueconsole.log('Connection error by client','('+addr+')')console.log(err.stack)if(!endedTargetClient){targetClient.end('Error')}})consttargetClient=mc.createClient({host: 'nmpTEST.aternos.me',port: 25565,username: 'abcadf324',keepAlive: false,version: '1.21.1'})client.on('packet',function(data,meta){if(targetClient.state===states.PLAY&&meta.state===states.PLAY){if(!endedTargetClient){targetClient.write(meta.name,data)}}})targetClient.on('packet',function(data,meta){if(meta.state===states.PLAY&&client.state===states.PLAY){if(!endedClient){client.write(meta.name,data)if(meta.name==='set_compression'){client.compressionThreshold=data.threshold}}}})targetClient.on('end',function(){endedTargetClient=trueconsole.log('Connection closed by server','('+addr+')')if(!endedClient){client.end('End')}})targetClient.on('error',function(err){endedTargetClient=trueconsole.log('Connection error by server','('+addr+') ',err)console.log(err.stack)if(!endedClient){client.end('Error')}})})
The text was updated successfully, but these errors were encountered:
it seems client.state is always at "configuration" where targetClient.state is "play", when removing && client.state === states.PLAY it is still stuck at "Joining World"
[x] The FAQ doesn't contain a resolution to my issue
Versions
Detailed description of a problem
once i run the code and connect to the localhost, it is stuck at Joining world until it times out, however the client does connect to the server and receives packets but the minecraft window is stuck at "Joining World..."
once i connect:
Incoming connection (::ffff:127.0.0.1)
after few seconds:
Connection closed by client (::ffff:127.0.0.1)
Connection closed by server (::ffff:127.0.0.1)
i dont get any error, i have tried multiple servers
Could it be my game error or the code? i am not sure
also when using 1.8.9 it seems to work normally on any server
Current code
The text was updated successfully, but these errors were encountered: