
Violet Crystal is a Rust framework for rust-powered MCBE addon development (Still in development)
Available features:
- Pack generation
- Items (all the components are there!)
- Script support (pairing a folder with .js scripts with the pack)
- Recipes
- Blocks*
* - Traits and some components are still not available
Plans:
- Entities;
- Animation / Render controllers;
Getting Started
Let's start with configuring a new project by creating a new Pack.
let scripts = Some; // Script Data. Can be set to None if project doesn't use scripts
let mut pack = new;
To generate the pack we'll use Pack.generate() and Pack.build_to_dev(). Put this in the end of function.
// Your code here
// Your code here
pack.generate; // Generates to "violet_crystal_results" folder.
pack.build_to_dev; // Copies to specified dev folders.
This will already create a pack. After first generation change pack.generate(None) to pack.generate(Some(false)). This is done so Violet Crystal does not change the manifest thus the UUIDs.
Let's add a new Item!
Use Pack.register_item() to add a new item, which requires an Item parameter.
pack.register_item;
This will add new item. But wait... It does not have a texture! To add a texture we first need to register it with Pack.register_item_texture() which requires an ItemAtlasEntry parameter.
pack.register_item_texture;
Then let's add it to the item. Remember the components field?
pack.register_item;
This will add the texture to item. All item components are there. I won't document all of them. You can see the docs for them on official MC docs.
Blocks
Adding blocks is also done in similar way. Currently, in Beta 1 you don't need to register texture, just specify the path in texture_set field. It might be changed to a way like items are done for consistency. Example of a block
pack.register_block;
With this knowledge you're good to go!