Crates.io | mc_service |
lib.rs | mc_service |
version | 0.1.0 |
source | src |
created_at | 2023-09-11 23:27:30.496415 |
updated_at | 2023-09-11 23:27:30.496415 |
description | A Minecraft service that can interact with the Mojang API. |
homepage | |
repository | https://github.com/minecraft-rs/service |
max_upload_size | |
id | 970217 |
size | 36,224 |
Minecraft HTTP services wrapper for Rust.
To obtain or update data from a minecraft account, it is necessary to interact with its services through its rest api. With this library you can interact with the API in a simple way.
You need to authenticate the user before using this library and get an access_token. You can use our authentication library for that.
use mc_service::account::MinecraftAccount;
fn main() {
let account = MinecraftAccount::new("{your access token}");
let profile = account.get_profile().unwrap();
println!("Username: {}", profile.name);
println!("UUID: {}", profile.id);
println!("Skin: {}", profile.skins[0].url);
println!("Skin Variant: {}", profile.skins[0].variant);
println!("Cape: {}", profile.capes[0].alias);
println!("Cape URL: {}", profile.capes[0].url);
}
Feel free to contribute to the development of the library.