Datapack.Net
0.3.2
dotnet add package Datapack.Net --version 0.3.2
NuGet\Install-Package Datapack.Net -Version 0.3.2
<PackageReference Include="Datapack.Net" Version="0.3.2" />
<PackageVersion Include="Datapack.Net" Version="0.3.2" />
<PackageReference Include="Datapack.Net" />
paket add Datapack.Net --version 0.3.2
#r "nuget: Datapack.Net, 0.3.2"
#:package Datapack.Net@0.3.2
#addin nuget:?package=Datapack.Net&version=0.3.2
#tool nuget:?package=Datapack.Net&version=0.3.2
Datapack.Net
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 | Versions 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. |
-
net10.0
- Newtonsoft.Json (>= 13.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.