A Rust library for reading asset files and resource packs for any version of Minecraft

Overview

minecraft-assets

Crates.io Docs.rs Tests

A Rust library for reading asset files and resource packs for any version of Minecraft.

Example

use minecraft_assets::api::AssetPack;

let assets = AssetPack::at_path("~/.minecraft/");

// Load the block states for `oak_planks`
let states = assets.load_blockstates("oak_planks").unwrap();
let variants = states.variants().unwrap();

assert_eq!(variants.len(), 1);

let model_properties = &variants[""].models()[0];
assert_eq!(model_properties.model, "block/oak_planks");

Documentation

This library is #![warn(missing_docs)], so the documentation is very complete:

Feature checklist

Assets parsing

  • assets/ /blockstates/*.json
  • assets/ /font/*.json
  • assets/ /lang/*.json
  • assets/ /models/block/*.json
  • assets/ /models/item/*.json
  • assets/ /particles/*.json
  • assets/ /shaders/{post,program}/*.json
  • assets/ /textures/*.mcmeta
  • assets/ /sounds.json
  • assets/pack.mcmeta

Data parsing

  • data/ /advancements/**/*.json
  • data/ /loot_tables/**/*.json
  • data/ /recipes/*.json
  • data/ /structures/**/*.json
  • data/ /tags/**/*.json

Projects using minecraft-assets

  • Brine: A multi-version Minecraft client written using Bevy.
  • Maybe your project here! :)

Tests

Integration tests in tests/ use the actual asset files from the minecraft-assets repository.

That repository is fairly large (~1 GB), so the tests in tests/ do not run by default. If you'd like to run them, use the tests/setup.sh script:

$ ./tests/setup.sh

This script will fetch the minecraft-assets repository and check out a few different versions at various paths in tests/. Then you can run the tests by enabling the tests feature:

$ cargo test --features tests

License

Licensed under either of

at your option.

Copyright Ben Reeves 2022

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

You might also like...
Minecraft using Bevy and Bevy-Meshem

minecraft_bevy Minecraft_bevy was built to showcase bevy_meshem. After a week of developing it has: Chunk loading / unloading each chunk's mesh is bei

Rust-based replacement for the default Minecraft renderer

wgpu-mc 🚀 A blazing fast alternative renderer for Minecraft Intro WebGPU is a new web specification designed to provide modern graphics and compute c

Rustcraft is a simple Minecraft engine written in rust using wgpu.
Rustcraft is a simple Minecraft engine written in rust using wgpu.

Rustcraft is a simple Minecraft engine written in rust using wgpu.

Easily update your minecraft mods with 1 file (guess I'm back to rust again)

Mod Updater This program updates all your mods to a newer/later version. To use: Create a file named config.toml Create a folder named mods; Add the f

A simple Minecraft written in Rust with the Piston game engine
A simple Minecraft written in Rust with the Piston game engine

hematite A simple Minecraft written in Rust with the Piston game engine How To Open a World This method is only for personal use. Never distribute cop

A simple, very minimal Minecraft server implementation in Rust.
A simple, very minimal Minecraft server implementation in Rust.

A simple, very minimal Minecraft server implementation in Rust. For a simple Minecraft server that isn't supposed to do much (for example, a limbo ser

Brine is my attempt at writing a Minecraft client in Rust using the Bevy game engine.
Brine is my attempt at writing a Minecraft client in Rust using the Bevy game engine.

Brine Brine is my attempt at writing a Minecraft client in Rust using the Bevy game engine. It's EXTREMELY work-in-progress. The thing that makes Brin

ULE - Minecraft's server core written in Rust

ULE - Minecraft's server core written in Rust This's server core fully written in Rust-Lang and using more custom code for best perfomance and control

A Rust framework for building Minecraft servers.

A Rust framework for building Minecraft: Java Edition servers. Like feather, Valence is an effort to build a Minecraft compatible server completely fr

Owner
Ben Reeves
haha Rust go brr
Ben Reeves
A Minecraft Java Edition to Bedrock Edition resource pack convertor in Rust

j2be A Minecraft Java Edition to Bedrock Edition resource pack convertor in Rust How to use Note: This project is still in development Run cargo build

Cqdet 11 Sep 15, 2021
Bevy plugin helping with asset loading and organisation

Bevy asset loader This Bevy plugin reduces boilerplate when loading game assets. The crate offers the AssetCollection trait and can automatically load

Niklas Eicker 205 Jan 2, 2023
An asset that provides 2d collision detector and kinematics, build from scratch in bevy

Busturi A physics engine An asset that provides 2d collision detector and kinematics, build from scratch in bevy How to use Add PhysicsPlugin to the p

NemuiSen 2 Jun 22, 2022
McShell - A programming language compiles to Minecraft mcfunction files

MCSH MCSH语言是一个语法类似Rust的编译型编程语言,其编译目标是mcfunction文件,以在Minecraft中运行。 MCSH有内存条,可实现函数递归操作。 MCSH 编译 使用 CLI 在虚拟仿真运行 编译 语法 标准库 编译 您需要先安装Rust 然后在您的控制台运行 git cl

FancyFlame 4 Feb 19, 2024
Shred - Shared resource dispatcher

shred - Shared resource dispatcher This library allows to dispatch systems, which can have interdependencies, shared and exclusive resource access, in

Amethyst Foundation 206 Nov 21, 2022
This is the core library with the full abstraction and implementation of the Minecraft protocol and logic. (Currently WIP)

MineRust (WIP) This is the core library with the full abstraction and implementation of the Minecraft protocol and logic. This project is currently WI

MineRust Project Suite 2 Nov 20, 2022
Rust library to download and run Minecraft instances.

Rust library to download and run Minecraft instances. Build the code To build the library, the do the following command: carbo build Run the example Y

Louis Bailleau 3 Oct 19, 2022
Minecraft Protocol Library

Protocol Minecraft Protocol Library This branch is dedicated to the Minecraft Bedrock Edition Protocol. If you have any concerns or questions you can

Netrex 5 Mar 19, 2022
This is a Minecraft Classic server written in Rust powered by tokio and classicl.

classicl_server Introduction This is a Minecraft Classic server written in Rust powered by tokio and classicl. Installation Cargo The project can be i

null 3 Nov 3, 2022
Libium is the backend of Ferium. It helps manage Minecraft mods from Modrinth, CurseForge, and Github Releases

Libium Libium is the backend of Ferium. It helps manage Minecraft mods from Modrinth, CurseForge, and Github Releases There are 3 main components in L

Ilesh Thiada 14 Dec 13, 2022