/
Version Numbering Converter (VNC) is a Java library for working with Minecraft versions across both numbering families:
1.20.6 and 1.21.1124.1, 25.4, and 26.1.1It covers two use cases:
MinecraftVersion, VersionScheme, and MappingTableVNC, including server constants, player version resolution, protocol lookup, and version comparisons1.0.0 through 1.21.1125.4, 26.1, and 26.1.1SERVER_VERSION1.20.5MinecraftVersion classic = MinecraftVersion.parse("1.21.11");
MinecraftVersion drop = MinecraftVersion.parse("26.1");
classic.isClassic(); // true
classic.getVersion(); // "1.21.11"
classic.getProtocol(); // 774
classic.supportsHex(); // true
drop.isClassic(); // false
drop.getVersion(); // "26.1"
drop.getProtocol(); // 775
String dropName = VersionScheme.MOJANG.toDrop("1.20.3"); // "23.2"
String classicName = VersionScheme.MOJANG.toClassic("25.2.2"); // "1.21.8"
String customClassic = VersionScheme.CROA_CUSTOM.toClassic("25.4"); // "1.22"
String customDrop = VersionScheme.CROA_CUSTOM.toDrop("1.22.1"); // "25.4.1"
MappingTable table = new MappingTable()
.registerLine(30, 1, "1.50", "1.50.1")
.registerMapping("1.51", "30.2");
VersionScheme scheme = VersionScheme.mapped(table);
scheme.toDrop("1.50.1"); // "30.1.1"
scheme.toClassic("30.2"); // "1.51"
Integer protocol = MinecraftVersion.protocolForIdentifier("1.20.6"); // 766
Integer snapshot = MinecraftVersion.protocolForIdentifier("26.2-snapshot-3");
MinecraftVersion newest = MinecraftVersion.fromProtocol(754); // 1.16.5
List<MinecraftVersion> all = MinecraftVersion.versionsForProtocol(767); // 1.21, 1.21.1
VNC exposes a runtime snapshot of the current server:
MinecraftVersion server = VNC.SERVER_MINECRAFT_VERSION;
String classic = VNC.SERVER_CLASSIC_VERSION;
String drop = VNC.SERVER_DROP_VERSION;
int protocol = VNC.SERVER_PROTOCOL;
double legacy = VNC.SERVER_VERSION;
boolean modernRegistry = VNC.isAtLeast("1.20.5");
boolean legacyCommands = VNC.isBefore("1.13");
boolean inRange = VNC.isBetween("1.19", "1.21.11");
Player version resolution uses ViaVersion when present and falls back to the server version otherwise:
MinecraftVersion playerVersion = VNC.player(player);
if (playerVersion.supportsHex()) {
// Safe to send RGB formatting to this player
}
SERVER_VERSION is still available for compatibility with older plugins, but patch-sensitive checks should prefer:
VNC.isAtLeast("1.20.5");
VNC.isBefore("1.21.9");
VNC.compare(VNC.SERVER_MINECRAFT_VERSION, "26.1");
That avoids the common limitations of comparing versions only as double.
VNC.player(...) to resolve the effective client version instead of the server version
Do you hate the new Apple-like version numbering system? Same! Do you like it? Don't care! Do you care about the version numbering and how to convert old versions to its new version or viceversa? This project is for you!