| Crates.io | mc-launcher |
| lib.rs | mc-launcher |
| version | 0.1.2 |
| created_at | 2025-04-11 23:51:45.028189+00 |
| updated_at | 2025-04-12 01:17:21.253032+00 |
| description | Helpful crate for run Minecraft |
| homepage | |
| repository | https://github.com/smokingplaya/mc-launcher |
| max_upload_size | |
| id | 1630508 |
| size | 31,407 |
mc-launcher is a zero-dependency (lightweight) helpful crate, that adds functionality to run Minecraft via Rust.
cargo add mc-launcher
.minecraft/
🗁 assets/
🗁 libraries/
🗁 versions/
🗁 <version_name>/
🗁 natives
🖹 client.json
🖹 client.jar
let config = MinecraftConfiguration {
session: MinecraftSession {
username: String::from("smxkin"), // username of player
..Default::default()
},
client: MinecraftClient {
path: Path::new("C:\\Users\\smxkin\\AppData\\Roaming\\ru.riverfall.launcher\\clients\\technorpg").to_path_buf(),
version: String::from("Forge 1.12.2"),
..Default::default()
},
..Default::default()
};
MinecraftLauncher::new(config)
.start()?;
[!NOTE] The authlib-injector file should be located in
.minecraft/libraries/moe/yushi/authlibinjector/<version>/authlibinjector-<version>.jar.That is, for version 1.2.5 the path will be as follows:
.minecraft/libraries/moe/yushi/authlibinjector/1.2.5/authlibinjector-1.2.5.jar.
MinecraftConfiguration {
session: MinecraftSession {
username: "smxkin", // username of player
authlib_server: Some(AuthLibConfiguration {
server: String::from("https://auth.mojang.com"),
version: String::from("1.2.5")
}),
..Default::default()
},
};
let java = Java::find()?;
let java = Java::find()?;
if java.is_version_equal(8) {
println!("Version == 8");
}
if java.is_version_at_least(8) {
println!("Version >= 8");
}