Crates.io | minecraft-data-rs |
lib.rs | minecraft-data-rs |
version | 0.8.1 |
source | src |
created_at | 2021-04-06 19:58:48.299246 |
updated_at | 2024-02-28 12:39:54.560922 |
description | A wrapper for minecraft-data |
homepage | |
repository | https://github.com/Trivernis/minecraft-data-rs |
max_upload_size | |
id | 379983 |
size | 78,199 |
This repository is a rust library to access minecraft data. The data itself hosted in the minecraft-data repository and included into the library at compile time.
By adding default-features=false
to the dependency in your Cargo.toml
file, you can exclude the minecraft-data from the library.
use std::collections::HashMap;
use minecraft_data_rs::Api;
use minecraft_data_rs::models::food::Food;
use minecraft_data_rs::models::version::Version;
// create an api wrapper for the latest stable version
let api = Api::latest().expect("failed to retrieve latest version");
let food: Vec<Food> = api.foods.foods_array().unwrap();
for food in food {
println!("When eating {} you gain {} food points", food.name, food.food_points);
}
Feature | Description |
---|---|
include-data | includes the whole minecraft-data repository in the binary |
api | enables the api to query minecraft data |
This project is Licensed under MIT.