Datapack.Net 0.3.2

dotnet add package Datapack.Net --version 0.3.2
                    
NuGet\Install-Package Datapack.Net -Version 0.3.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Datapack.Net" Version="0.3.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Datapack.Net" Version="0.3.2" />
                    
Directory.Packages.props
<PackageReference Include="Datapack.Net" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Datapack.Net --version 0.3.2
                    
#r "nuget: Datapack.Net, 0.3.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Datapack.Net@0.3.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Datapack.Net&version=0.3.2
                    
Install as a Cake Addin
#tool nuget:?package=Datapack.Net&version=0.3.2
                    
Install as a Cake Tool

Datapack.Net

GitHub Actions Workflow Status NuGet Downloads

A Minecraft datapack generator and utility library.

Datapack.Net still has a long way to go, so feel free to play around and catch bugs. I might notice when bug reports are made.

Features

  • .NET 10
  • Datpack generation
  • Typesafe commands
    • As well as blocks, block states, biomes, and entities
    • Full target selector support
    • Not all commands have been created yet. Some commands are:
      • /data
      • /execute
      • /function
      • /random
      • /return
      • /say
      • /scoreboard
      • /tellraw
        • Tellraw formatting is incomplete
  • NBT writing
    • Reading is not implemented
  • Datapack optimizer
    • Currently only removes empty functions and commands that reference them
  • Supports 1.20.4
    • 1.20.5+ support is limited due to the new item components replacing NBT. Most things should still work. This will change in the future

Planned features

  • Fully generated data using SpyglassMC
  • 1.20.5 item components

Installation

Datapack.Net can be installed via NuGet here. The CubeLib (deprecated) analyzer is a separate package located here.

dotnet add package Datapack.Net
dotnet add package Datapack.Net.SourceGenerator

If cloning locally, you need to build the project and restart your IDE for the source generator to come into effect.

Usage

This is basic datapack creation and building. Scroll down for the more interesting stuff.

Creating a datapack:

var pack = new DP("The best description", "out.zip");

Creating a .mcfunction file:

var func = new MCFunction(new NamespacedID("namespace", "test"));
// Alternatively "namespace:test" can be used because there is an implicit cast from string to NamespacedID

Adding a command:

func.Add(new Execute().As(new NamedTarget("player")).Run(new SayCommand("Hi")));

Adding the function to the pack:

pack.Functions.Add(func);

Building the pack:

pack.Build();

See the tests for examples of commands and other features.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.2 168 10/7/2025
0.3.1 165 10/7/2025
0.3.0 166 10/6/2025
0.1.2 184 6/25/2024
0.1.1 155 6/21/2024
0.1.0 175 6/19/2024