Topic category: User side tutorials
NEWS
There are a lot of people asking about what versions of MCreator and Minecraft this is for. To check that, please look at the Troubleshooting and Notes section at the bottom of this tutorial!
All loading problems were fixed, you can now use the Export tab under "File" to export your model!
Edit 1: Bad news, I just talked to the developer for Geckolib and they no longer support MCreator or .java models. It only supports bedrock models, and similar. Until further notice, this entire tutorial is outdated and will not work.
Edit 2: There is some news I have to share. I talked with Gecko recently, and I was told he will be making an official MCreator plugin sometime. There is no planned date, but we will have official support for MCreator from the author. Sadly, there is no temporary solution, unless someone managed to create an archive of the 2.0.0 Geckolib plugin. If you did, please contact me a soon as possible!
Edit 3: An archive has been found! You can now download the old Blockbench plugin, load it, and use this old tutorial to continue using it's features! Download link below in the Blockbench installation section.
Edit 4: Successful tests were completed! It was tested by myself and a few others on multiple different operating systems, and we were all able to spawn mobs with animations :D There is also no requirement to change code by hand, making it incredibly user friendly.
Tutorial
This tutorial will teach you how to use the amazing and much awaited Geckolib plugin! For those of you who don't know, Feder's Geckolib plugin is an MCreator add-on that allows users to create custom animations for modded mobs. This guide will walk you through the steps for installation and some info on how to use it, but will not teach you how to create animations. In the examples I will use a custom zombie model and animations I made.
Check - Before we begin, please look at the "Notes" section below for important information.
Installation
Blockbench
The first thing you will need to install is Blockbench. Blockbench is a 3D modeling program aimed towards blockier, Minecraft-style creations, and it is completely free. Without Blockbench, you will not be able to use this plugin, and I'll explain why in a bit. To install Blockbench, simply download the latest release from here and follow the installation wizard. To get the max performance out of the old plugin, download the 3.6.6 release from here, and install it normally. (You can have multiple versions of Blockbench installed, no un-installation required!)
But you aren't ready to create animations yet! First, you need to install the GeckoLib plugin to Blockbench. To do this, open up Blockbench to the startup page. From there, navigate to Filter -> Plugins. This will open up a menu labeling all your installed and available plugins. Click on the "available" tab and scroll down until you see the GeckoLib Animation Utils option. Hit install, and you're ready to animate! (This method is outdated, download the plugin from the link below)
To load the old Geckolib plugin, download it from here. Make sure you don't rename it! Next, go to the plugin menu in Blockbench, hit "Load plugin from file." Select the file from where you downloaded it to and and click "open". Accept the confirmation message and the plugin should be installed!
If you want to learn about animating Java models with this plugin, I suggest this YouTube video by TurtyWurty. It explains everything you need to know in depth. This video is made for animating Bedrock only models, but the UI looks same for animated Java models after you install the plugin.
MCreator
This section will teach you how to install the plugin to MCreator. First, go to this page for the latest download, or this one for a direct download to the current one. Once downloaded, make sure it's in zip file format, and save it to wherever you want! Alright, now you can open up MCreator. Open the workspace you want to add the plugin to first. Then, navigate to File -> Preferences -> Manage Plugins. Here, you should click the "Load plugin..." button. Navigate to where you saved the downloaded zip, and select it. Hit "Save" and let it load.
Now that you have installed the plugin, you will need to activate it. Navigate to Workspace -> Workspace Settings - > External APIs. Here, you will see a checkbox labeled "GeckoLib API". check it and hit "save changes." That's it, you've installed the plugin!
Note: if there were any elements in your workspace prior to adding the plugin, you will be prompted to refactor the workspace. Simply hit "Yes, refactor workspace" and let MCreator handle the rest!
Usage
Exporting From Blockbench
Let's say you finished an animation in Blockbench, but you have no clue how to export it! First, in Blockbench, you will need to save the files. GeckoLib stores it's animations in 2 files: a .java file that stores the 3D model, and a .json file that stores all the animations. Before exporting them, we need to complete one important change. Go to File -> Project... and scroll down to an input box labeled "Model Identifier:" This is the name that your game will use to reference your model, so we can't leave it blank! The easiest solution is to name it the same as your mob, such as "blue_bird" or "big_boar_variant_1." There are some small naming rules you must follow:
1. Do all lowercase letters. This will make loading the mob easier later.
2. No whitespace or special characters. Use an underscore instead of spaces, and never use symbols that aren't alphanumeric.
3. Numbers are allowed, but the name cannot start with a number. Examples: Correct: "red_chest", "one_sign" Wrong: "1_dash", "235_variant_mob", "23bob".
Once done naming, hit confirm and the file should be ready for exporting!
To export the files, you'll need to start with the .java file. Navigate to File -> Export -> Export Animated Java Entity and a prompt window will appear. Name the file whatever you need, and save it to a directory of your choice.
Next, to export the .json file, you'll need to be in the animation tab. From there, navigate to Animation -> Export Animations and save the file to whatever name you want.
(Note: Hitting CMD/CTRL + S will save both files automatically.)
Importing to MCreator
This is a bit harder than exporting. First, let's import the .java file. In your workspace, go to Resources -> 3D models and texture mappings. Hit the "Import JAVA model" button and select your .java file. Click the "Keep current animations" button, and the file should import correctly!
Now we need to import the animations. This requires a bit more effort. In MCreator in the workspace, go to Workspace -> Open workspace folder. This should open a file explorer with wherever on your computer your MCreator workspace is stored. From here, navigate to src/main/resources/assets/<name_of_your_mod>/ and create a new folder called "animations" (minus the parentheses). Now, whenever you create a new animation .json file, just put it in that folder. That's all!
Using Your Animations
Now that you've installed everything and created an animated entity, you want to figure out how to use those animations. Geckolib allows you to set the animation of any mob using procedures. Simply use the "Play Animation" procedure block by entering the desired entity, animation name, and looping condition, and your mobs will now be animated!
Troubleshooting
I'll cover some common issues and mistakes people make when using this tutorial:
1. Correct version for all downloads. Make sure that you download all the right versions for the software listed here. Other versions may not be compatible with each other and might lead to crashes. Here is a list of the correct versions:
- MCreator - 2020.5 Latest Release - (link to download)
- Blockbench - 3.6.6 Release - (link to download)
- Geckolib Animation Blockbench Plugin - 2.0.0 Release - (link to download)
- Geckolib Animation MCreator Plugin - 1.0.1 Bug Fix - (link to download)
2. Not giving your model a model identifier. This is important for keeping track of models, especially when you plan to add more than one. The steps to do this are covered in Usage -> Exporting From Blockbench in the above tutorial.
3. Trying to mod in the wrong version. The Geckolib Animation MCreator Plugin currently only supports 1.15.2 modding, no other versions can use this tool.
4. Using the wrong animation name when trying to play animations. When animating in Blockbench, make sure that you copy paste the exact name that you used for the animation you want into MCreator, and not the animation file name. Many people try to use the name of the animations.json file, but this file contains a list of all animations for the mob. You have to use the names of the animation, and not the name of the file.
Notes:
This plugin will only work with MCreator 2020.5. It does not work with the latest, as of the time of edit for this post (12/9/2020 4:49pm EST)
The Geckolib plugin also does not work with the latest Blockbench release as of this edit (same date as above), it requires Blockbench 3.6.6
IMPORTANT! - Although 2020.5 has been released, there is an issue with loading the plugin! This means that it is not available to use until the author updates it! Thank you for your patience. - After testing, the plugin should work with MCreator now. I plan on making a video tutorial in the future and linking it here, so stay tuned!
Contact:
IMPORTANT! Do not contact me unless you are sure that your question cannot be answered by the post or by a previous comment. If you have an important question though, feel free. My discord is [revoked], so message me if you need help or clarification. I will respond as fast as I can!
Regarding the above message, I have decided to stop answering questions since I have become very busy lately. Sorry for any inconveniences.
Changes:
Added and fixed images - 9/23/2020
Fixed the errors in the current plugin and changed the download link - 1/4/2021
Added toubleshooting section after lots of similar problems - 2/13/2021
If you guys have any questions or suggestions to add or remove from this tutorial, feel free to post them below!
This short tutorial is a very big help! But one thing that I need a little feedback on is how to get the plugin securely. Where do I get the gecko lib plugin? I tried to use it from the plugins tab in Blockbench, but it won't even let me export my model!!!! It will only let me export OBJ format, GlTF, and Sketchfab upload. And when I deleted the plugin, I tried to reinstall it, but it said it's only for a higher version!!!!!! What do I do?
I want to make animations for blocks and entities!!! It's very crucial!
Mainly, I just want to know how to export models with a good versoin of the Blockbench plugin.
SAME DID YOU FIGURE IT OUT????
The download link is there in the tutorial (Troubleshooting #1)
if i span the entity, my game is crashed.
// Don't be sad, have a hug! <3
Time: 3/11/21 12:27 PM
Description: Unexpected error
java.lang.NullPointerException: Unexpected error
at net.minecraft.client.renderer.entity.EntityRendererManager.shouldRender(EntityRendererManager.java:233) ~[forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
at net.minecraft.client.renderer.WorldRenderer.updateCameraAndRender(WorldRenderer.java:947) ~[forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
at net.minecraft.client.renderer.GameRenderer.renderWorld(GameRenderer.java:612) ~[forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
at net.minecraft.client.renderer.GameRenderer.updateCameraAndRender(GameRenderer.java:434) ~[forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:961) ~[forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
at net.minecraft.client.Minecraft.run(Minecraft.java:558) ~[forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
at net.minecraft.client.main.Main.main(Main.java:177) ~[forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_265] {}
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_265] {}
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_265] {}
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_265] {}
at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) ~[forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {}
at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-5.1.2.jar:?] {}
at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-5.1.2.jar:?] {}
at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-5.1.2.jar:?] {}
at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) [modlauncher-5.1.2.jar:?] {}
at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-5.1.2.jar:?] {}
at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:102) [forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {}
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- Head --
Thread: Render thread
Stacktrace:
at net.minecraft.client.renderer.entity.EntityRendererManager.shouldRender(EntityRendererManager.java:233)
at net.minecraft.client.renderer.WorldRenderer.updateCameraAndRender(WorldRenderer.java:947)
at net.minecraft.client.renderer.GameRenderer.renderWorld(GameRenderer.java:612)
-- Affected level --
Details:
All players: 1 total; [ClientPlayerEntity['Dev'/209, l='MpServer', x=-218.17, y=4.00, z=-109.62]]
Chunk stats: Client Chunk Cache: 225, 121
Level dimension: DimensionType{minecraft:overworld}
Level name: MpServer
Level seed: 2398658783896750172
Level generator: ID 01 - flat, ver 0. Features enabled: false
Level generator options: {}
Level spawn location: World: (-208,4,-112), Chunk: (at 0,0,0 in -13,-7; contains blocks -208,0,-112 to -193,255,-97), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1)
Level time: 3592 game time, 3592 day time
Known server brands:
Level was modded: false
Level storage version: 0x00000 - Unknown?
Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
Server brand: forge
Server type: Integrated singleplayer server
Stacktrace:
at net.minecraft.client.world.ClientWorld.fillCrashReport(ClientWorld.java:457)
at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:1839)
at net.minecraft.client.Minecraft.run(Minecraft.java:577)
at net.minecraft.client.main.Main.main(Main.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55)
at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37)
at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54)
at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72)
at cpw.mods.modlauncher.Launcher.run(Launcher.java:81)
at cpw.mods.modlauncher.Launcher.main(Launcher.java:65)
at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:102)
-- System Details --
Details:
Minecraft Version: 1.15.2
Minecraft Version ID: 1.15.2
Operating System: Linux (amd64) version 5.8.0-44-generic
Java Version: 1.8.0_265, BellSoft
Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), BellSoft
Memory: 506569808 bytes (483 MB) / 1136132096 bytes (1083 MB) up to 1836580864 bytes (1751 MB)
CPUs: 4
JVM Flags: 0 total;
ModLauncher: 5.1.2+70+master.2845bb9
ModLauncher launch target: fmluserdevclient
ModLauncher naming: mcp
ModLauncher services:
/eventbus-2.2.0-service.jar eventbus PLUGINSERVICE
/forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-launcher.jar object_holder_definalize PLUGINSERVICE
/forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-launcher.jar runtime_enum_extender PLUGINSERVICE
/accesstransformers-2.1.1-shadowed.jar accesstransformer PLUGINSERVICE
/forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-launcher.jar capability_inject_definalize PLUGINSERVICE
/forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-launcher.jar runtimedistcleaner PLUGINSERVICE
/forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-launcher.jar fml TRANSFORMATIONSERVICE
FML: 31.2
Forge: net.minecraftforge:31.2.0
FML Language Providers:
javafml@31.2
minecraft@1
Mod List:
client-extra.jar Minecraft {minecraft@1.15.2 DONE}
forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-recomp.jar Forge {forge@31.2.0 DONE}
main Time Machine {time_machine@1.0 DONE}
forge-1.15.2-geckolib-2.0.0_mapped_snapshot_20200514-1.15.1.jar Geckolib {geckolib@2.0.0 DONE}
Launched Version: MOD_DEV
Backend library: LWJGL version 3.2.2 build 10
Backend API: GeForce 940M/PCIe/SSE2 GL version 4.6.0 NVIDIA 460.39, NVIDIA Corporation
GL Caps: Using framebuffer using OpenGL 3.0
Using VBOs: Yes
Is Modded: Definitely; Client brand changed to 'forge'
Type: Client (map_client.txt)
Resource Packs:
Current Language: English (US)
CPU: 4x Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
32:27.08 [Render thread/INFO] [STDOUT/]: [net.minecraft.util.registry.Bootstrap:printToSYSOUT:110 #@!@# Game crashed! Crash report saved to: #@!@# /home/thekralgame/MCreatorWorkspaces/time_machine/run/./crash-reports/crash-2021-03-11_12.27.08-client.txt
AL lib: (EE) alc_cleanup. 1 device not closed
> Task :runClient FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':runClient'.
> Process 'command '/home/thekralgame/Desktop/MCreator20205/jdk/bin/java'' finished with non-zero exit value 255
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.10.3/userguide/command_line_interface.html#se…
BUILD FAILED in 2m 33s
10 actionable tasks: 4 executed, 6 up-to-date
BUILD FAILED
Task completed in 154076 milliseconds
As of right now I've followed the tutorial using all the right versions and it still crashed my game. Even on the official release of 2020.5
So, I got up to the point of the second gif thing. I had created a test mob, and did everything as specified, but the animation still won't work. Am I missing something? The procedure has ||Play animation "[the name of the animation according to the Blockbench animation tab]" as entity Event/target entity. Should loop true.|| and I even added an if block that reads ||is Event/target entity (sub)type of [entity name]||. Do I leave it unconnected to the mob in question or do I add it to one of the triggers? Currently I have it set to "On initial entity spawn" but whenever I use the spawn egg the mob just sits there. It can move and look around but no animation happens. Please help, I've been at this for hours and I'm losing my mind.
the animations don't play, I fixed the crash by changing the modifier, but the animations just don't play (everything is done according to your guide)
everything works.
same. It seems like the "animated java model" makes it crash i think
Hi, I'm wondering if I can use the Geckolib plugin on the new MCreator 2021 with version 1.16.5
Is there any new information?
Does it still work with Java models, i'm trying but i am not able to do it