Getting the Server version - rodrigoo-r/Harmony GitHub Wiki
Explanation
Harmony automatically detects and registers the server version. This information is used to determine whether the server is running on legacy versions.
Usage
You can get the server version using the getServerVersion
method on your plugin class.
[!IMPORTANT] This will NOT return the raw string (i.e. "git-Folia-"1e5e215" (MC: 1.20.2)") If the return of Bukkit.getVersion() is: git-Folia-"1e5e215" (MC: 1.20.2) Harmony will process all the string and will get ONLY the version: 1.20.1
Example:
public final class ChatShield extends BackendPlugin {
@Override
public void whenInitialize() {
getServerVersion(); // 1.20.2 (Or the server version)
}
}