Skip to content

Trivernis/minecraft-data-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

minecraft-data-rs

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.

Excluding the minecraft-data 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.

Usage

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);
}

Features

Feature Description
include-data includes the whole minecraft-data repository in the binary
api enables the api to query minecraft data

License

This project is Licensed under MIT.

About

Rust wrapper for minecraft-data

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages