datapack

Crates.iodatapack
lib.rsdatapack
version2.0.1
sourcesrc
created_at2022-06-26 08:09:05.889724
updated_at2022-07-15 12:45:19.968051
descriptionAn easy way to create Minecraft datapacks in rust
homepage
repositoryhttps://github.com/MediumDifficulty/datapack
max_upload_size
id613441
size19,745
MediumDifficulty (MediumDifficulty)

documentation

https://docs.rs/datapack/2.0.0/datapack/

README

A lightweight way to create Minecraft datapacks in rust

Covered datapack files that can be created easily

  • advancements
  • functions
  • item_modifiers
  • loot_tables
  • predicates
  • recipes
  • structures
  • tags/blocks
  • tags/entity_types
  • tags/fluids
  • tags/functions
  • tags/game_events
  • tags/items
  • dimension
  • dimension_type
  • worldgen/biome
  • worldgen/configured_carver
  • worldgen/configured_feature
  • worldgen/configured_structure_feature
  • worldgen/configured_surface_builder
  • worldgen/noise_settings
  • worldgen/placed_feature
  • worldgen/processor_list
  • worldgen/template_pool

Create a simple hello world datapack

use datapack::builder::DataPackBuilder;
use datapack::component::{Component, MCFunction};
use datapack::namespace::Namespace;

use std::fs::File;

let file = File::create("example.zip").unwrap();

DataPackBuilder::new()
    .add_namespace(
        Namespace::new("example")
            .add_component(Component::Function(MCFunction::new("say hello world", "hello", true, false)))
    ).build(&file)
Commit count: 16

cargo fmt