Started by
FRoginman
on
Topic category: Help with modding (Java Edition)
i want a keep an animation for a long time in mcreator geckolib 2023.1, it is possible? is a personal question.
im explain: I'm making a mod that when it rains or there's a storm it activates an animation and a potion effect on it. Is it possible to keep the same animation all the time until it stops raining? with geckolib? specifically he takes out an umbrella to cover himself from the water, but it bugs and resets all the time, also I don't know how to put the potion effect so that it doesn't move. Can someone help me? sorry my main language is not english. I attached some photos. https://imgur.com/a/X309KBm
To make it not move set it in cobweb for one tick, if the procedure is on a tick event then it will always be in a cobweb. You could also attempt to override motion vector x y z to 0. For the animtion I assume its an entity, make an animtion where the entities pulls out the umbrella. Then make a seperate animation where they are just still and holding the umbrella up. Then on tick update check if it is raining if yes, do animation wait, wait 20 ticks and play animation umbrella (assuming this is the animtion of getting the umbrella out) then set a variable to true that the umbrella is out. Now make an if logic is variable = true play animation (umbrella out standing), this animation should then play every tick. Then when it stops raining make the tick procedure register raining = false and make it make variable umbrella out = false, and play animation (putting umbrella away, just reverse getting the umbrella out) and done. Also your current procedure has 4 if statements that are identical you can just make the first (and) into an (or) and it should cover all possibilities. And I dont think it can thunder without it raining first.
this is my first mod on geckolib, everthing you say, i maked, but he animation of umbrella is bug, restart many times. why it happens? And last thanks for help me.
Well I dont really know. If you explain the problem or add an image I could help you out.
You made 3 animations for the umbrella I assume. One taking it out, one holding it up and one putting it away. You play the first one and immediately play the next. The animation where its holding the umbrella up should be basically still, the start and end should be identical if not then thats what is making the restarting look as you said. There could also be a problem with your procedure for this which is making it so only the 1st animation is playing over and over. Another issue could be that the entity is moving slightly and the walk animation plays for a tick or so which causes the umbrella animations to restart
Either post an image of your procedure and Ill see if theres anything wrong or you can try and figure out the problem with your animation.
this is the picture https://imgur.com/nCloy23 and the animation bug xd https://i.giphy.com/media/v1.Y2lkPTc5MGI3NjExa3kxdDlucHZ5MHc2aTdxbnV1NXg5Z2pzdzhzaGFhd3RucmN6a2FscyZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/6VYxiOxpyo2eMdTdfL/giphy-downsized-large.gif
For the restarting issue. Change the animation of the holding umbrella up. Literally make it 1 second of just the entity holding up the umbrella. No movement or anything. That way the entire animation should be the exact same.
If thats not the problem then your procedure may be wrong. You need some sort of logic nbt where it is false until it rains. Then when it rains set it to true and then play the first animation.
Something like this:
[On entity tick update]
If logic nbt (wet) = false
[and] {is it raining at x y z} = [true]
set logic nbt (wet) to [true]
play animation [taking umbrella out]
If logic nbt (wet) = true
If {is it raining at x y z} = [true]
play animation [umbrella out]
Else
set logic nbt (wet) to [false]
play animation [putting umbrella away]
thnk you guy, i try put this procedure.