[TUTORIAL] How to use Nerdy's GeckoLib Plugin 5.2+ [2023.4+]

Started by NerdyPuzzle on

Topic category: User side tutorials

Last seen on 17:28, 23. Apr 2024
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[TUTORIAL] How to use Nerdy's GeckoLib Plugin 5.2+ [2023.4+]
Sun, 04/07/2024 - 12:14 (edited)

How to use Nerdy's GeckoLib Plugin 5.2+ for MCreator 2023.4+


Loading the plugin

 

This plugin is a Java Plugin, which means It requires the Java Plugins feature to be enabled. This is due to the new Mod Elements that it introduces.

 

java plugin

 

Once enabled, load the plugin. You will then need to restart MCreator so the changes can be properly applied. Note that if you already have an older version of the plugin loaded, you will first need to open the plugins folder and delete it.


Enabling the API

 

In order to use any of the features provided by the plugin, you will first need to enable the GeckoLib API, as it is what provides all of the code required to use animated models. This also means that your mod will require the GeckoLib mod to launch after exported.

To enable the API, you will need to head over to workspace settings.

workspace settings

And if you have installed the plugin correctly, GeckoLib will be an option you can enable in External APIs.

apis


Using GeckoLib in Blockbench

 

If you already know what you're doing, this step can be skipped.

 

To use animated models with the plugin, they will need to be made using the GeckoLib format in Blockbench.

In order to use this format, you will need to install the GeckoLib Animation Utils plugin.

plugin


And if you do not have the plugin installed, you will find it in the available section.

available

If you do already have the plugin and it is older than what is shown above, remove it and reinstall the current version.

You can now create a GeckoLib model.

model

If you already have a model in a different format and want to animate it using GeckoLib, you can convert it to the GeckoLib format by opening the project and clicking convert under the file options.

convert

After doing so, you can animate the model.

A key thing to note is that blocks/items, entities and armors all use different types of GeckoLib models. The type of the model can be changed by clicking on GeckoLib model settings and changing the Object type.

model type

Once finished with your model, you will need to export it using the option export GeckoLib Model.

export

If your model is of the type block/item, you will also have the option to export the display settings. This should also be done if that is the case as those will be required.

Your animations will all need to be under the same category in order to be included in a single file, and can be exported by looking under the Animation tab.

anims

Take note of the exact name you used when creating each animation, as that full name will need to be used for your entity.

name

After exporting both files, make sure both start with the same name if you are using a version older than 5.1. For example here, the name "name" is used.

names

This is it. For the display settings, it will not matter what you decide to name them as.


Importing GeckoLib models in MCreator.


To import GeckoLib models and animations, you will need to look for the new GeckoLib category in the top menu bar. If it is not there, you have not enabled Java Plugins.

barr

After clicking it, you will have the option to click "Import GeckoLib model...". Clicking that will allow you to first select your .geo.json file and the .animation.json file after the first one is selected.

gfg

Once again, if you are using a geckolib plugin version older than 5.1 make sure the files you have selected both start with the same name, otherwise there will be crashes when using them.
 If you also have a display settings file, make sure you also import that by clicking "Import GeckoLib display settings..."

disss


Animated Entities

 

To create an animated entity and use the animations and models, you will need to use the Animated Entity element to create it.

entity

Once in the menu, you will need to select the GeckoLib model you have imported. If everything was done correctly, it should automatically be part of the list.

listof

Now, you will head over to the "Animations" page of the element.

animsss

Your entity will require an idle animation. This animation can of course have empty keyframes, but it will be required nonetheless.

idle

Once that is done, you can enable/disable other Built-In animation triggers that are included with the entity's code. These animations will play automatically without any need for procedures/conditions. More information on them can be found by clicking the "?" icon next to their names.

The loop settings for these animations are handled automatically in the code of the entity. So to avoid issues, make sure all of these animations are only set to play once in blockbench.

builtin

There are some other options that can be modified on the right panel, but those will not be explained here other than the conditions, as enough explanation is provided by clicking their "?" icon.

right

In order to use more than just the built-in animations, you will use animation procedures

procedure

To use the animation procedure, you will need to specify the entity element that the animation will play for.

procedure2

That's it.

This is about everything you need to know about animated entities.


Animated Blocks/Items

 

To get started, you will need to make sure you have also exported the display settings file that was mentioned in the blockbench tutorial, as blocks and items require it. Here is an example of what one of those files can look like after exported. Your geo/animation files will also need to be imported in the same way as entities. Scroll up to that part of the tutorial if you do not know where that happens already.

displays

You will now need to create either an Animated Block or Animated Item using their respective elements.

elems

You will find two model selectors in the first page, one for your GeckoLib model, and one for the display settings. Simply select the ones you exported for your specific block or item.

sgr

 

 

Animated block/item animations

Blocks and items both have a different animation system. Blocks use numbers, while items use regular names.

Your animated block will require an animation to be named "0" in blockbench, as that is the idle animation that will always loop.

0

To use more than 1 animation with animation procedures on blocks, you will need to increase that number in the block element.


Your animated item will require an idle animation, which can be set in the first page of the animated item element.

hh

In a similar fashion, all your block animations will need to be numbers. These can range from 1-1000, though using that many procedure animations with one block will eat alot of ram.

blockproc

For animated items, your animation procedure will work the same way as entity animation procedures.

testtt


First person arm rendering for Animated Items

The animated item element also has a unique feature which allows you to include player arms in the model which are only visible in first person when held.

In order to use this feature, you will need to include 2 new groups in your model, which will represent the player arms.

arms

You need to be certain that the scale of these cubes matches the scale of the player model's arms.

scale

The texture you use for them does not matter, as these arms will automatically adapt to the player's skin.

You will need to position these arms to face up, and center the pivot to the center of the very bottom of the cube.
This is required as the arms are not part of the actual model. The rotations will all need to be handled in animations.

pivot

Note that you will need to only select the group, and not the cube, otherwise the pivots will not be correct.

You can now animate the cubes in animations.

animate

Once you are done animating the arms, you can enable first person arm rendering in the element and use the name of the groups you created for the arms.

enablearms


Animated Armors

In blockbench, you will need to set your geckolib model type to armor.

ad

Once that is done, a template of an armor model structure will generate. You can either use this template, or you can convert your own armor set.
If you do decide to use the template, you need to check that the pivots of the model part groups are correctly positioned. Sometimes, there are some slight mistakes.

The model parts of the armor are split into 8 groups

  • Head

  • Body

  • Right Arm

  • Left Arm

  • Right Leg

  • Left Leg

  • Right Boot

  • Left Boot

geg

These groups can be named whatever you like as you can specify their names in the armor element, but there is no need to rename the template's groups.

These are the parts that will need to have their pivots positioned relative to the player model. Inside, you can make the armor's model.

g

The exported model and animation file should be placed in the same directory as entities. If you do not know where that is, scroll up and find the part of the tutorial that explains it.

Now, make the armor using the animated armor element.

gw

In the GeckoLib properties page, you can set the group names of the model parts

armorrrr


This is it!

Plugin Link


Common crash causes
-You didn't create a GeckoLib model.
-You enabled the head animation, but there is no group in your model that matches group name you provided
-Your animation file name does not match your model name, or your model name does not match your animation name.
-Your animations file has incorrect formatting. If you used the bedrock entity wizard or other model animating blockbench plugins, you likely have to make the animations again.

Edited by NerdyPuzzle on Sun, 04/07/2024 - 12:14
Last seen on 16:09, 20. Mar 2023
Joined Mar 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
hi, can u pleas help me i…
Sat, 03/18/2023 - 21:08

hi, can u pleas help me i mybe didnt do something right, and its giving me this error can u pls help me fix it?

the error is java.lang.reflection.invactionTargetExeption: null

 

Last seen on 21:54, 20. Mar 2023
Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I was trying to change the…
Sun, 03/19/2023 - 01:45

nbvc

I was trying to change the texture of my entity when you shift right click but it doesn't work well because it works but when I exit and re-enter the world the texture returns to the original textureIs there any way to do it and that the texture changes and stays saved?

Last seen on 16:07, 8. Apr 2023
Joined Mar 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Nerdy, In the next update…
Sun, 03/19/2023 - 03:24

Nerdy, In the next update you can create player animations?, I hope it's not a problem Great Job!

Last seen on 13:55, 23. Apr 2024
Joined Feb 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@juankay11 Could could add a…
Sun, 03/19/2023 - 07:34

@juankay11

Could could add a NBT Logic Property inside your Mob on Spawn and if you right click the Mob it sets to true. After that make a Update Tick Procedure for your Mob where you check if this NBT Logic value is true and then make it so that it changes its texture every tick. This should fixing your problem.

 

I think you know what I wana try to say! :)

Last seen on 19:58, 21. Apr 2024
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
yo bro, why i cant detect…
Wed, 03/22/2023 - 07:52

yo bro, why i cant detect armor with this

Last seen on 19:58, 21. Apr 2024
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
yo bro, why i cant detect…
Wed, 03/22/2023 - 08:00

yo bro, why i cant detect armor with this

Last seen on 13:55, 23. Apr 2024
Joined Feb 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@Kuroshi23 Use the Procedure…
Wed, 03/22/2023 - 08:39

@Kuroshi23

Use the Procedure Block "get Item Registry Name" for it.

Last seen on 19:58, 21. Apr 2024
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@GamesofFreak, thx u!
Wed, 03/22/2023 - 10:49

@GamesofFreak, thx u!

Last seen on 19:58, 21. Apr 2024
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@GamesofFreak yo but this…
Wed, 03/22/2023 - 10:52

@GamesofFreak yo but this block doesnt work

Last seen on 13:55, 23. Apr 2024
Joined Feb 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It's working! You need to…
Wed, 03/22/2023 - 11:58

It's working!

You need to write this format: "modid:item_id".

Last seen on 19:58, 21. Apr 2024
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@GamesofFreak i cant put it…
Thu, 03/23/2023 - 03:33

@GamesofFreak i cant put it on

Last seen on 19:39, 9. Apr 2023
Joined Nov 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
i need more detail on hand…
Sat, 03/25/2023 - 03:30

i need more detail on hand animations

Last seen on 19:38, 22. Apr 2024
Joined Jan 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
wow i cant belive how much…
Sat, 03/25/2023 - 21:29

wow i cant belive how much better you have made the tutorial i tought i was in trouble as there is no tutorials

Last seen on 10:18, 20. Apr 2024
Joined Nov 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Feedback a question.When…
Tue, 03/28/2023 - 04:16

Feedback a question.
When using this plugin to make animation blocks, it will crowd out the tool json for normal blocks.
For example:
Make A block A from the original Mcr and a block B from the animation blocks of this plugin.
Both of these blocks need to be mined with the pickaxe tool.
The generated pickaxe.json will only have block B of the animation blocks generated by this plugin registered,block A will be crowded out and disappear.
(Please forgive me if there may be some inaccuracies in English translation with translation software.)
Mcr version: 2023.1.10610
Plug-in version: V4.7.1