Started by
Ryan_Davanzo
on
Topic category: Help with Minecraft modding (Java Edition)
You know then you hold a bone near a wolf and he tilts his head? Same deal but with a custom GeckoLib animation.
Topic category: Help with Minecraft modding (Java Edition)
You know then you hold a bone near a wolf and he tilts his head? Same deal but with a custom GeckoLib animation.
Geckolib can't target players or vanilla entities. There may be another plugin that does this though. (I'm pretty sure optifine has some tools for this, might be worth looking into.) If the entity you're targeting is a geckolib custom entity, then you should be able to make animations using blockbench. (Just be sure to install the blockbench geckolib plugin.)
I have the animations. i want the npc to play them when I hold an item
like, how do I create a procedure that does that?
If you have Geckolib installed in your MCreator workspace, and you've enabled it in the workspace settings for your mod, you should be able to access the 'Geckolib' procedures tab. You can use the 'play animation' function to play any of the animations in that entity's geckolib animation file. In your case, you would trigger this when there is both a player within a certain range, and the nearest player within that range is holding the item in their main hand. (Using the 'does entity exist within range' and 'nearest entity in range' world functions.)
Keep in mind that you can play an animation from the animation file even if it isn't linked to an entity's main animations, (idle, walk, etc.) As long as you have the correct name, you should be able to reference it.
Can you like...show me how to do a procedure of it? I can't find any ranged code on that. I tried right-click too but nothing happens. idk what i'm doing wrong... https://i.imgur.com/KvwbSuy.png
The ranged stuff is at the bottom of the 'world data' tab. You're looking for 'does entity exist in radius' function and 'nearest entity in radius' function. You need to make sure you first check an entity exists in that radius, because using 'nearest entity in radius' when an entity doesn't exist in that radius can crash the game.
Try to see if you can find this- I can send pictures though if you're having trouble.
There's no 'does entity exist in radius' and 'nearest entity in radius' functions. I searched manually and with the search bar. Is that another plugin? Also no "world data" but there's the data tap on world procedures. Or I'm dumb as a plastic chair...
yeah i have no idea what i'm doing....
can you...help me? i still cant get it to work.
Sorry! Something like this should work. If you're using the 1.16.5 generator though, it's possible these functions aren't available.
OMG IT WORKED! THANK YOU!
now to make them reset the animation when far lol
but again, thank you <3
You would just need to add an else statement that returns it to the original animation. (Though it will probably need to finish looping through the existing one first.) Since it'll only ever be in one of the two states, you don't even need another condition.
Its still doesnt work for me. I copied everything