Minecraft Version Loader
Simple library/utility to find the Minecraft version in code universally whatever is the Minecraft version.
介绍
Minecraft Version Loader
What is it?
The Minecraft Version Loader is a straightforward library/utility mod designed to offer a consistent API across all Minecraft versions. Its main purpose is to conveniently retrieve the exact version of Minecraft being used.
But why?
This mod serves a crucial role in situations where a universal mod is required to function across all Minecraft versions, while also needing to identify the specific version of Minecraft it’s running on. This information is essential for determining which code should be loaded for each precise Minecraft version within the mod’s codebase.
Important
This mod is currently in its early release stage, and it has been tested and confirmed to support Minecraft versions ranging from 1.18 to 1.20.1. While it is possible that the mod may work with other versions, if you encounter any issues, please create a ticket on the GitHub issue page.
How to use it?
- Retrieve the mod from the Maven Central repository using the following code snippet in your Gradle build script:
dependencies {
modImplementation "lv.cebbys.mcmods:minecraft-version-loader:${version}"
}
- Import the necessary classes and call the method as shown below:
import lv.cebbys.mcmods.mvl.api.MinecraftVersionLoader;
import lv.cebbys.mcmods.mvl.dto.MinecraftVersion;
public void () {
MinecraftVersion version = MinecraftVersionLoader.getMinecraftVersion();
// Prepare things with the version how you like - burned, medium, raw
}
常见问题
Minecraft Version Loader 支持哪些 Minecraft 版本?
Minecraft Version Loader 支持 Minecraft Java 版 1.18–1.20.1,共 10 个版本,可用的加载器:Fabric。下载时注意选择和你游戏版本一致的文件。
Minecraft Version Loader 怎么安装?
先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。运行环境:客户端 / 服务端。
评论
登录后评论和评分