MCCTeam / Minecraft-Console-Client

Lightweight console for Minecraft chat and automated scripts
https://mccteam.github.io
Other
1.67k stars 402 forks source link

[BUG] Joining a 1.21 server works but get kicked immediately #2749

Open BurkenDev opened 4 months ago

BurkenDev commented 4 months ago

Prerequisites

Minecraft Version

1.20.6 / 1.20.4 / 1.21

Console Client Version

Latest

Expected Behavior

Be able to join the server

Actual Behavior

Joining a server works but get kicked immediately

Steps to Reproduce the bug

Join a 1.21 server which also runs the latest version of ViaVersion should work with an older client like this.

Attach screenshot here (If applicable)

Connecting to Microsoft... Using Minecraft version 1.20 (protocol v763) Cached profile key needs to be refreshed. Fetching profile key from Microsoft. [MCC] Version is supported. Logging in... [MCC] Checking Session... [MCC] Server was successfully joined. Type '/quit' to leave the server. ▌ has joined the network. (smp4)

Unhandled exception. System.IO.InvalidDataException: Failed to process incoming packet of type JoinGame. (PacketID: 40, Protocol: 763, LoginPhase: False, InnerException: System.Collections.Generic.KeyNotFoundException). ---> System.Collections.Generic.KeyNotFoundException: The given key 'minecraft:chat_type' was not present in the dictionary. at System.Collections.Generic.Dictionary2.get_Item(TKey key) at MinecraftClient.Protocol.Message.ChatParser.ReadChatType(Dictionary2 registryCodec) at MinecraftClient.Protocol.Handlers.Protocol18Handler.HandlePlayPackets(Int32 packetId, Queue1 packetData) at MinecraftClient.Protocol.Handlers.Protocol18Handler.HandlePacket(Int32 packetId, Queue1 packetData) --- End of inner exception stack trace --- at MinecraftClient.Protocol.Handlers.Protocol18Handler.HandlePacket(Int32 packetId, Queue`1 packetData) at MinecraftClient.Protocol.Handlers.Protocol18Handler.Updater(Object o) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) Aborted

Anythings that could help diagnosing the bug

No response

Device

Other

Operating System

Linux

Server Address (If applicable)

No response

milutinke commented 4 months ago

Join our discord, refer to this message on how to fix this: https://discord.com/channels/1018553894831403028/1250864891993129080/1256971761900326937

Xitee1 commented 4 months ago

How are you able to connect to 1.21 servers in the first place? I'm always getting the message "This version is not supported!" (built by myself from lastest master branch).

C0j23T commented 4 months ago

I tried Minecraft 1.18 and it worked. The server runs ViaVersion and ViaBackwards.

Server version : Velocity 1.7.2-1.21 (protocol v767)
Cannot connect to the server : This version is not supported !
Server version :
Restarting Minecraft Console Client...
Settings have been loaded from MinecraftClient.ini
You chose to run in offline mode.
Using Minecraft version 1.18 (protocol v757)
[MCC] Version is supported.
Logging in...
[MCC] Server is in offline mode.
[MCC] Server was successfully joined.
Type '/quit' to leave the server.
fakeplayer1 joined the game
Xitee1 commented 4 months ago

The server needs to add ViaVersion and ViaBackwards

Ok, I thought there already is support for 1.21. Using ViaBackwards and version 1.19 I can join the server. A bit overkill for my server having to install 3 additional plugins (+ViaVersionStatus for unaware players) but at least it works and I can AFK at my farms again.

theabab2333 commented 4 months ago

加入我们的 discord,请参阅此消息以了解如何解决此问题:https://discord.com/channels/1018553894831403028/1250864891993129080/1256971761900326937

I can't join the discord because the invitation in GitHub is no longer valid and can't get help

milutinke commented 4 months ago

加入我们的 discord,请参阅此消息以了解如何解决此问题:https://discord.com/channels/1018553894831403028/1250864891993129080/1256971761900326937

I can't join the discord because the invitation in GitHub is no longer valid and can't get help

https://discord.gg/HGeUZhF2

theabab2333 commented 4 months ago

加入我们的 discord,请参阅此消息以了解如何解决此问题:https://discord.com/channels/1018553894831403028/1250864891993129080/1256971761900326937

I can't join the discord because the invitation in GitHub is no longer valid and can't get help

https://discord.gg/HGeUZhF2

thanks

Xitee1 commented 2 months ago

The server needs to add ViaVersion and ViaBackwards

Ok, I thought there already is support for 1.21. Using ViaBackwards and version 1.19 I can join the server. A bit overkill for my server having to install 3 additional plugins (+ViaVersionStatus for unaware players) but at least it works and I can AFK at my farms again.

I don't know what happened but it no longer works with ViaVersion for me. I am able to join the server and stay connected for about 3 seconds. Then I get kicked with this error message:

Using Minecraft version 1.19.0 (protocol v759)
§8Cached profile key is still valid for (removed).
§8[MCC] Version is supported.
Logging in...
§8[MCC] Checking Session...
§8[MCC] Server was successfully joined.
Type '/quit' to leave the server.
> Unhandled exception. System.IO.InvalidDataException: Failed to process incoming packet of type JoinGame. (PacketID: 35, Protocol: 759, LoginPhase: False, InnerException: System.Collections.Generic.KeyNotFoundException).
 ---> System.Collections.Generic.KeyNotFoundException: The given key 'minecraft:dimension_type' was not present in the dictionary.
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at MinecraftClient.Mapping.World.StoreDimensionList(Dictionary`2 registryCodec) in /home/runner/work/Minecraft-Console-Client/Minecraft-Console-Client/MinecraftClient/Mapping/World.cs:line 62
   at MinecraftClient.Protocol.Handlers.Protocol18Handler.HandlePlayPackets(Int32 packetId, Queue`1 packetData) in /home/runner/work/Minecraft-Console-Client/Minecraft-Console-Client/MinecraftClient/Protocol/Handlers/Protocol18.cs:line 601
   at MinecraftClient.Protocol.Handlers.Protocol18Handler.HandlePacket(Int32 packetId, Queue`1 packetData) in /home/runner/work/Minecraft-Console-Client/Minecraft-Console-Client/MinecraftClient/Protocol/Handlers/Protocol18.cs:line 457
   --- End of inner exception stack trace ---
   at MinecraftClient.Protocol.Handlers.Protocol18Handler.HandlePacket(Int32 packetId, Queue`1 packetData) in /home/runner/work/Minecraft-Console-Client/Minecraft-Console-Client/MinecraftClient/Protocol/Handlers/Protocol18.cs:line 489
   at MinecraftClient.Protocol.Handlers.Protocol18Handler.Updater(Object o) in /home/runner/work/Minecraft-Console-Client/Minecraft-Console-Client/MinecraftClient/Protocol/Handlers/Protocol18.cs:line 259
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
Aborted (core dumped)

Is there any progess for 1.21?