Started by
maxpingouin
on
Topic category: Help with Minecraft modding (Java Edition)
Hello,
I checked the recent updates and I would like to use custom animations in 1.12.2 in order to advance and finish a big project.
Since it isn't possible with MCreator basic tools I would like to know how could I execute an animation (with with special AoE damage) which would start at precise events or conditions using the code modifier.
It would help a lot and if I finish the project I could give some credits.
I plan on making special bosses and I can hardly imagine them using base animations due to their size / form / attack type.
what "animations" are you looking to make?
Attack / appearance / death / Idle / Moving and others
I have no problems with making the animations but I want to know how to use them
you mean like arm swing animations as opposed to effects or texture animations?
if so, that requires a lot of trig math and you'll need to code them.
I am asking how could I do it
using code
that requires modifying your entity class to add some fields for the wing swing amount. then you need to modify your entity's renderer class to pass along your wing swing amount to your model class. and at last in your model class' render method you will need to rotate your wing according to the wing swing amount.
to rotate the wing:
something like that, if your wing rotate along the Z axis. wingSwingProgress is your custom defined field passed from your entity's class through its renderer class.
in your entity class you need to define a wingSwingProgress that goes from 0.0F to 1.0F, where 0.0 is the wing's resting state, 0.5 is the most extended state, and 1.0 is back to resting state. so in your entity's onUpdate/onEntityUpdate method you just cycle that field from 0.0 to 1.0 continuously.
uh oh, x 2.0F maybe a bit too much, just x 1.0F and x -1.0F