Started by
Withie The Cryptid
on
Topic category: Help with Minecraft modding (Java Edition)
I have a mob that I want to change into another form and then change back with the same health. I know what I need to do, which is set the mob's health as a variable and then spawn the mob again, having the variable then change the mob's health. But every time I try it, it always says something's wrong and won't let me save. Does anyone know how to do this properly?
Could you screenshot the procedure?
Suddz
https://i.pinimg.com/originals/cb/12/d4/cb12d43a47dc77c29b8a93ada2febee3.jpg
Here's a link to a screenshot. Sorry if it isn't the best quality
Despawing a local varible wont work because the local varible is not the entity.
I am trying to recreate a working procedure but i need a bit more context for it.
Are you trying to make the entity lose max health after it is hit by an arrow? Like, tell me more in detail exactly what you want the entity to do and i might be able to fix it.
Basically I have 2 mobs, that are going to be 2 seperate forms. First there's the regular form, and then there's the protected form, which is immune to damage. Whenever it's hit with a projectile, I want it to change into it's protected form for a few seconds, and then switch back into it's regular form. However, I also don't want it's health to reset every time it goes back to it's regular form from it's protected form.
That's more or less what I'm trying to do.
I see, another way to do this is just to add a potion effect if the player hits the entity, and when this potion effect is active it cancels attack events. Unless you actually want the model to change.
Here is a tutorial on how to swap models:
https://www.youtube.com/watch?v=lYxj-7MnaUQ
I could help you with the potion procedure if you dont know how to make it
I tried what the video said, but the mob just despawned and the second one didn't spawn in
Its a very long procedure so doubble chech that everything is correct, if i remember correctly you can download it on his website aswell.
But was my potion idea any use for your mod or does the model change actualy swap how it looks?
I imported the procedure from the link and it worked perfectly! Thank you!
And yes the model actually changes it's look
Awesome! Good luck with the mod