Skip to content

Adding a model

Goodbird-git edited this page Feb 7, 2024 · 7 revisions

Goal

Let's suppose that we have a Geckolib Model in blockbench and we would like to use it on our NPC. image

Creating a resource pack (1.16.5)

Let's create a resource pack.
First we need to create a folder with pack.mcmeta file and assets folder.
image
In pack.mcmeta we should write something like that

{
  "pack": {
    "pack_format": 6,
    "description": "CNPC-Gecko-Addon resource pack by Goodbird"
  }
}


In assets we need to create a folder with our resource pack name, in my case it's geckomodels.
And that folder will have three folders in it
image
The first will contain animations, the second is for models and the third is for textures.
In the texture one we should create a subfolder entity.
The resource pack structure is done!

Exporting blockbench model

First of all lets export the model itself (set of cubes and bones) into a .geo.json file.
image
And we will export it into the assets/geckomodels/geo folder.

The next thing is the texture.
We can right click it and select Show in File Explorer, and it will show us where the texture is located.
image
You just need to copy it into the assets/geckomodels/textures/entity.

Finally, we need to move the animation file to the assets/geckomodels/animations folder
You can find it by right clicking one of the animations and selecting Properties
image
And here you will see the path to the animation file.
image
So you just need to copy this file into the assets/geckomodels/animations folder.

Putting models into a mod (1.12.2 or 1.18.2)

Mods are distributed as .jar files which are based on .zip format. This means that you can unpack the mod as a regular .zip file.
You need to

  • Extract geckolib jar file
  • Put your .geo.json model file into assets/geckolib3/geo
  • Put your .json animation file into assets/geckolib3/animations
  • Put your texture file into assets/geckolib3/textures/model/entity
  • Pack everything back as a .zip file
  • Rename it to .jar file ignoring the warning

WARNINGS:

  • If you compress the mod back into a .rar or .7z or some other format, it will not work
  • While packing, you should select all of the mod component folders (assets, META-INF, software, ...), and not the top level geckolib-forge-*** folder
  • Don't leave the extracted geckolib folder in the mod folder. Remove it after repacking as it will cause crashes

Packing and testing

Now you just need to compress assets and pack.mcmeta into a .zip file
image
Now put the .zip file into the .minecraft/resourcepacks folder and select it in the Minecraft resource pack menu
image

Congratulations!
You have added your blockbench model to minecraft!
Now you will be able to select the model, the animation and the texture using the "Common use".
image
Here is the example resource pack we made in that tutorial
MyResourcePack.zip