17 releases

new 0.8.1 Feb 28, 2024
0.7.2 Apr 5, 2023
0.7.1 Dec 28, 2022
0.6.0 Nov 8, 2022
0.3.0 Apr 18, 2021

#323 in Game dev

Download history 7/week @ 2023-11-10 12/week @ 2023-11-17 42/week @ 2023-11-24 66/week @ 2023-12-01 19/week @ 2023-12-08 23/week @ 2023-12-15 41/week @ 2023-12-22 4/week @ 2023-12-29 11/week @ 2024-01-05 8/week @ 2024-01-12 22/week @ 2024-01-19 23/week @ 2024-01-26 19/week @ 2024-02-02 29/week @ 2024-02-09 208/week @ 2024-02-16 581/week @ 2024-02-23

839 downloads per month

MIT license

73KB
2K SLoC

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.

Dependencies

~0.7–2.6MB
~44K SLoC