You can recognize the version of the player based on the ProtocolVersion obtained by ViaVersion, etc.
import xyz.mlserver.mcversion.MCVersion;
public class Example {
public static void example() {
MCVersion version = MCVersion.fromProtocolVersion(47);
System.out.println(version);
}
}
import xyz.mlserver.mcversion.MCVersion;
public class Example implements Listener {
@EventHandler
public void on(PlayerJoinEvent e) {
Player player = e.getPlayer();
int protocolVersion = Via.getAPI().getPlayerVersion(uuid);
version = MCVersion.getByProtocolVersion(protocolVersion).getName();
System.out.println(version);
}
}
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<dependency>
<groupId>xyz.mlserver</groupId>
<artifactId>MCVersion</artifactId>
<version>VERSION</version>
</dependency>
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'xyz.mlserver:MCVersion:VERSION'
}
mvn javadoc:javadoc