-
Notifications
You must be signed in to change notification settings - Fork 9
Creating Block Models
Block models should be centered on the origin, [0, 0, 0]. Standard Minecraft blocks are of the unit size (1x1x1). Once you have your block model, put the exported .obj file in your models/block folder.
Despite using obj's .mtl ending, Myron materials are very different, to accommodate the options and restrictions of Minecraft and Fabric's rendering API. The only things you need from the exported .mtl file are the names of each material. A basic example of the format is as follows:
# In addition to the materials used in your model itself, Myron
# will check for a material named "sprite". This texture will be
# used for the model's sprite. If no "sprite" material is found,
# the first material in the file will be used instead.
newmtl stone # The name of the material used in the obj file
ambient_occlusion true # Equivalent to Minecraft's ambient occlusion flag
uvlock true # Equivalent to Minecraft's uvlock flag
texture minecraft:block/stone # The texture this material uses
# Material files will often define more than one material
newmtl crystals
ambient_occlusion true
texture minecraft:block/diamond_block
For a comprehensive list of options, see materials.
Now that your model is done, all that's left is for it to be added to your BlockState file:
{
"multipart": [
{
"apply": { "model": "minecraft:block/stone", "uvlock": true}
},
{
"apply": [
{ "model": "myron:block/crystal_ore" },
{ "model": "myron:block/crystal_ore", "y": 90 },
{ "model": "myron:block/crystal_ore", "y": 180 },
{ "model": "myron:block/crystal_ore", "y": 270 },
{ "model": "myron:block/crystal_ore", "x": 90 },
{ "model": "myron:block/crystal_ore", "x": 270 }
]
}
]
}
Myron supports normal models, multipart models, and weighted variant models. Note that your model will have its UV's locked if either the uvlock option supplied in your block state file or the uvlock option in your material file is true.
Currently, multipart and variant models may not obey materials properly. There is a fix for this in the JMX library. There are plans to merge that fix into Fabric API itself.