Document for GeockoLib Plugin 1.19.2

Started by S33R_OF_PYR3 on Sun, 11/20/2022 - 22:07

Topic category: Help with MCreator software

Last seen on 17:10, 22. Nov 2022
Joined Nov 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Document for GeockoLib Plugin 1.19.2
Sun, 11/20/2022 - 22:07

For the sake of a group I was helping with a mod I created a google doc with all the info I know about making the correct files to add custom animations to MCreator using the GeckoLib plugin for version 1.19.2. I tried looking up stuff for earlier versions but I wasn't able to get them to work so this only covers stuff for 1.19.2. I figured I'd post the doc here as well if anyone wants some guidance. I will just clarify that A. I don't ever check the email I used for the doc so don't bother contacting me there and B. I'm not usually on this site so I probably can't be contacted here either. Just wanted to offer it up in case someone is stuck. I'll also post the text from the doc below if you don't wana click a suspicious google doc link.

Link: https://docs.google.com/document/d/1M91N3NbScGPOcucXwByj5V2FG6MYHAPVtTIAoHpxKlU/edit?usp=sharing


Important Links

MCreator Version 20022.3: https://mcreator.net/download/eap-2022-3-44708

MCreator GeckoLib Plugin v 2.4: https://mcreator.net/plugin/91484/nerdys-geckolib-plugin-forge-1182-1192

GeckoLib Changelog: https://mcreator.net/forum/91485/tutorial-how-use-nerdys-geckolib-plugin

BlockBench Download: https://www.blockbench.net/downloads

BlockBench Plugin: go to File\Plugins and search Gecko, should be first option
 

How to Create GeckoLib Model

Once you’ve installed the version of BlockBench above (any semi recent version should be fine) and the BlockBench GeckoLib plugin, the first step is to create the correct model file.

Go to File\GeckoLib Animated Model and create a new project. 


File Name: this is the name of your entity. The entity you create and reference in MCreator should match the File Name exactly, so for simplicity’s sake they should have no capital letters or spaces, use _ instead.

Model Identifier: this is the name of the model itself, which usually cannot contain capital letters or spaces. Again, use the same name. This also makes it easier when referencing the models and entities in MCreator to ensure the correct name is used

While making the model using BlockBench, the cubes making it up need to be sorted into folders in order for them to be animated. You can only animate the folders as they make up the “bones” of the entity. The folders and cubes inside them can be named anything with any capitalization, although the folders can’t have the same name.

The animations themselves are slightly more complicated. Click the plus button at the top of the page to make a new folder to hold the animations. This folder should be named “entity_name”.animation.json, in the case above the beaver is the name of the entity.

The animations you create can be automatically used by the GeckoLib plugin in MCreator by naming them certain things. If you use one of the terms below as the name of an animation, once the model is established in MCreator, that is all that has to be done for the animation to work in game when the entity does whatever the word is.

Animation Plugin Code Names (Case Sensitive):

  • walk
  • death
  • swim
  • sneak
  • sprint
  • idle
  • attack

For custom animations like “break bush” in the example above, they will need to be called in a procedure in MCreator. 

Finally, the animations can be exported in one file that will be used in MCreator. Click Export Animations under the Animation tab and choose all of the animations to include in the file. If the file was named “entity_name”.animation.json at the start it will be named correctly, otherwise that can be fixed when you export the animations.

The same can be done to the model itself, go to File/Export/Export GeckoLib Model. It will be named “entity_name”.geo.json, but “entity_name” can be corrected here if it wasn’t named properly earlier. Both this file and the animations file are case sensitive and need to be named after the entity in order to be used in MCreator.

Adding Files to MCreator:

To add the animation and model files to MCreator, open the workspace folder as demonstrated below. Navigate to the assets folder by opening src/main/resources/assets/name_of_mod. name_of_mod will be whatever the MCreator workspace was called.

The animation file exported from BlockBench goes in the animations folder, the geo.json file goes into the models folder.

Creating the Entity

By adding the files in this way, MCreator will not need to have a separate json model imported in the Resources tab, nor will you need to select a custom model when creating an entity. The only thing you’ll need to upload in the Resources tab is a texture file. It can be named whatever you want, but you will need the name of the texture when registering the model. Choose that texture to represent it and change its bounding box as necessary. For model type, you can select the one with the most similar bounding box to make it easier to edit.

Registering the Model:

Only one procedure is needed to attach the built in animations to the model. Create a procedure and choose the trigger “Setup class (GeckoLib), then add the Register GeckoLib model block from the GeckoLib tab. They first box should have the EntityName as it was created in MCreator (so for example if you have an entity with model entity_name.geo.json and entity_name.animation.json, the name of the entity you make in MCreator would be EntityName. EntityName is what you put in the first box). The second box Model Name takes the name in front of the geo.json file (for model entity_name.geo.json, put entity_name in the second box). Finally, the third box Texture Name takes the name of the texture file you uploaded to MCreator through the Resources tab.

I haven’t messed with the Head animation thing much, I assume it chooses the head bone if your model has that and applies the minecraft default head bobbing when idle and stuff, but I’m not sure. 

Adding Custom Animations:

Adding custom animations can be somewhat tricky because the built in animations (idle, walk, attack, etc) seem to take precedence over an animation you call through a procedure. To add a new animation, create a procedure without an additional trigger. This procedure can be added in the Triggers tab of the entity model, triggered by right clicking, when the entity dies, or it can be a constantly running procedure with an if statement to check when it should run.

As shown above, the first block can be used to cancel the current animation, and the second is used to call the animation according to its name in the entity_name.animation.json file (the name of the animation can include spaces but is case sensitive. Open the animation.json file to check what it’s called to make sure it’s correct).

The first block is supposed to cancel the current animation (like if an entity walked towards something and then ran a custom animation, the first block should cancel the walk animation to run the custom animation). However I’ve had the issue where the custom animation doesn’t want to run sometimes. It could be a buggy thing due to MCreator or the plugin, or there might be an optimized way to do it that I’m not privy to, shrug.

But anyway that’s most of what I know. Check out videos on Youtube or MCreator’s help forum on their website to troubleshoot. o/

Last seen on 00:09, 27. Jan 2023
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Some things to note here:…
Tue, 11/22/2022 - 00:29

Some things to note here:

The procedure to stop animations only stops procedure animations

Procedure animations will play over built-in animations

There's some syncing issues with the procedure, so setting a scoreboard value instead and triggering the animation through a different procedure using it (like loaded entity tick) will solve the issue of it not playing, as shown in my tutorial

The exact method of making entities for 1.19.2 works for all supported versions the same way

Last seen on 23:00, 25. Dec 2022
Joined Dec 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
thanks for your time for…
Sun, 12/04/2022 - 05:36

thanks for your time for this tutorial! But when i finished the basic procedure "BobModel" I get the error that "the workspace contain mod elements that don't compile properly" and display that the mod element is that "BobModel"  

i name him bob because it's been a week since i tried to get geckolib's plugin to work, and as i see that I'm the only one getting this error, of course i did something wrong but i really can't point out why the java code of the procedure don't work, and it's been days since i followed tutorials after tutorials and still getting the exact same error (but with a different java errors for your tutorial because i didn't realized that the other geckolibs plugin would not really work on the 1.19. But as you said that you are not really active, i guess i'll have to wait for a response from somebody else. thanks in advence for those whou would like to help me! ^^
Here's the consol log with the java errors pointed out
https://pastebin.com/epu79QH9

Last seen on 00:09, 27. Jan 2023
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Well clearly you didn't…
Sun, 12/04/2022 - 11:22

Well clearly you didn't actually follow many tutorials, because you missed the FIRST step, which is enabling GeckoLib in workspace settings.