-
-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong client version #1024
Comments
Use the UserLoginEvent from packetevents to ensure correct client version at the right time. |
Thanks, but that isn't possible in my case. I need it to be available in PlayerJoinEvent. Is that really not possible? |
Packetevents doesn't track client versions on spigot servers. |
Use the ViaVersion API for determining the client version of a player: version = serverIsUsingViaVersion
? ClientVersion.getById(Via.getAPI().getPlayerVersion(user.getUUID()))
: user.getClientVersion(); |
@EventHandler
public void join(PlayerJoinEvent event) {
Player player = event.getPlayer();
ClientVersion viaVersion = ClientVersion.getById(Via.getAPI().getPlayerVersion(player.getUniqueId()));
ClientVersion packetEvents = PacketEvents.getAPI().getPlayerManager().getClientVersion(player);
player.sendMessage("Your client version (PacketEvents): " + packetEvents);
player.sendMessage("Your client version (ViaVersion): " + viaVersion);
} |
UserLoginEvent is powered by the PlayerJoinEvent. |
I'll look at it in a moment again. |
The reason I need it in PlayerJoinEvent is because I want to use getClientVersion inside a library but don't want to force users to switch to UserLoginEvent. It would be unintuitive and also a breaking change. |
Describe the bug
PacketEvents incorrectly identifies the client version of a 1.20.4 client on a 1.8.8 server as
V_1_8
.Software brand
SportPaper 1.8
Plugins
ViaVersion 5.0.3 and test plugin
How To Reproduce
Expected behavior
It should say
Your client version: V_1_20_3
Screenshots
Additional context
n/a
The text was updated successfully, but these errors were encountered: