MCCsharp 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package MCCsharp --version 1.0.0
                    
NuGet\Install-Package MCCsharp -Version 1.0.0
                    
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="MCCsharp" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MCCsharp" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="MCCsharp" />
                    
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 MCCsharp --version 1.0.0
                    
#r "nuget: MCCsharp, 1.0.0"
                    
#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.
#addin nuget:?package=MCCsharp&version=1.0.0
                    
Install MCCsharp as a Cake Addin
#tool nuget:?package=MCCsharp&version=1.0.0
                    
Install MCCsharp as a Cake Tool

MCCsharp

MCCsharp is a C# wrapper for the minecraft-data project. It provides access to Minecraft items, names, IDs, crafting recipes (recipes.json) and more, directly from .NET code.

๐Ÿ“ฆ Available on NuGet: nuget.org/packages/MCCsharp


๐Ÿš€ Features

  • Access Minecraft items by ID or name
  • Automatically load recipes even when not directly present in the version
  • Support for both crafting_shaped and crafting_shapeless recipes
  • Strongly-typed 3x3 matrix of ingredients
  • Handles Minecraft platform and version resolution via dataPaths.json

๐Ÿ› ๏ธ Installation

dotnet add package MCCsharp

๐Ÿ“ฆ Usage Example

using MCCsharp;
using MCCsharp.Enums;

var mc = new MinecraftData(Platform.Pc, "1.17");

var item = mc.GetItemByIdOrName("crafting_table");

var recipe = mc.GetRecipe(item);

Console.WriteLine($"Crafting: {item.DisplayName} x{recipe.ResultCount}");

for (int y = 0; y < 3; y++)
{
    for (int x = 0; x < 3; x++)
    {
        var cell = recipe.Matrix[y, x];
        Console.Write((cell?.DisplayName ?? " ") + "\t");
    }
    Console.WriteLine();
}

โœ… Compatibility

Platforms:

  • โœ… pc (Java Edition)
  • โœ… bedrock (planned or limited support)

Tested Minecraft versions:

  • 1.8 to 1.21.4 (Java)
  • Fully dynamic support through dataPaths.json

๐Ÿงฑ Advanced Features

  • GetAvailableVersions() โ€” Lists all supported versions with recipe availability
  • GetLatestVersionWithRecipes(Platform platform) โ€” Gets the latest recipe-compatible version

๐Ÿ“‚ Data Structure

Data files are based on minecraft-data, included as a submodule or local directory.

Data/
โ””โ”€โ”€ minecraft-data/
    โ”œโ”€โ”€ data/
    โ”‚   โ”œโ”€โ”€ pc/
    โ”‚   โ””โ”€โ”€ bedrock/
    โ””โ”€โ”€ dataPaths.json

๐Ÿงช Testing

Includes unit tests using xUnit:

dotnet test

๐Ÿ“– License

MIT โ€” use freely in personal or commercial projects.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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
1.0.3 247 4/16/2025
1.0.2 240 4/16/2025
1.0.1 234 4/16/2025
1.0.0 221 4/16/2025