A converter tool that transforms static Minecraft models from Blockbench format (.bbmodel) to MonoGame-compatible vertex data.
- Converts Blockbench .bbmodel files to MonoGame vertex data
- Supports multiple textures per model
- Generates both C# code and JSON data files
- Handles cube geometry with proper normals and UV mapping
- Compatible with MonoGame's VertexPositionNormalTexture format
dotnet run <input.bbmodel> <output_directory># Convert a Blockbench model to MonoGame format
dotnet run models/creeper.bbmodel output/
# This will generate:
# output/Creeper.cs - C# class with vertex/index data
# output/creeper_data.json - JSON data file for runtime loadingThe converter generates two types of files:
Contains static methods to get vertex data, indices, and texture names:
var vertices = Creeper.GetVertices();
var indices = Creeper.GetIndices();
var textureNames = Creeper.GetTextureNames();Contains the model data in JSON format for runtime loading.
Here's how to use the generated model in your MonoGame project:
// Using the generated C# class
var vertices = YourModel.GetVertices();
var indices = YourModel.GetIndices();
var textureNames = YourModel.GetTextureNames();
// Create vertex and index buffers
var vertexBuffer = new VertexBuffer(GraphicsDevice, typeof(VertexPositionNormalTexture),
vertices.Count, BufferUsage.WriteOnly);
vertexBuffer.SetData(vertices.ToArray());
var indexBuffer = new IndexBuffer(GraphicsDevice, typeof(int),
indices.Count, BufferUsage.WriteOnly);
indexBuffer.SetData(indices.ToArray());
// Load textures
var textures = new Texture2D[textureNames.Length];
for (int i = 0; i < textureNames.Length; i++)
{
textures[i] = Content.Load<Texture2D>(textureNames[i]);
}- ✅ Cube elements with position and size
- ✅ Face textures and UV mapping
- ✅ Multiple textures per model
- ✅ Element names and organization
⚠️ Basic rotation support (may need adjustment)- ❌ Animation data (static models only)
- ❌ Complex geometry (cubes only)
The converter transforms Blockbench coordinates to MonoGame:
- Blockbench uses pixel units (16 pixels = 1 block)
- MonoGame output uses world units (1.0f = 1 unit)
- Coordinates are divided by 16 during conversion
- .NET 6.0 or later
- MonoGame.Framework.DesktopGL 3.8.1.303
- Newtonsoft.Json 13.0.3
dotnet build
dotnet run -- models/your_model.bbmodel output/- Use consistent texture sizes (recommended: 16x16, 32x32, 64x64)
- Name your elements descriptively for better generated code
- Keep models relatively simple for better performance
- Test UV mapping carefully as coordinate systems differ
- Invalid dimensions: Check that your Blockbench elements have valid from/to coordinates
- Missing textures: Ensure texture paths are correctly set in Blockbench
- UV mapping issues: Verify texture coordinates in Blockbench match expected output
Feel free to submit issues or pull requests to improve the converter!